Testing
To conduct a test transaction, use the test credentials provided during onboarding. The test environment is configured to generate results based on the transaction and details supplied in the request.
You can further enhance your testing by using the Postman collection here.
Recurring plan test cases
The following are the test cases for the /plans endpoint.
Retrieve recurring plans
HTTP Method: GET
Endpoint: /plans
Test case | Test data | responseStatus | responseCode |
---|---|---|---|
Merchant not authorized to access | Do not pass merchantId in the HTTP request header | ERROR | UNAUTHORIZED |
Merchant not entitled for Managed Recurring Payments service |
Pass invalid Authorization header | ERROR | FORBIDDEN |
Fetch plans by Status successfully | Pass any of the valid values for plan-status (ACTIVE, DRAFT, CANCELLED) | SUCCESS | ACCEPTED |
Fetch plans by Amount successfully | Pass a valid plan-amount (numeric) | SUCCESS | ACCEPTED |
Invalid query parameters for fetching plans | Pass a plan-id in the query parameters | ERROR | UNSUPPORTED_ACTION |
No records for given search criteria for fetching plans | Pass a value for plan-amount for which there are no plans in the system | ERROR | RECORD_NOT_FOUND |
Create a recurring plan
HTTP Method: POST
Endpoint: /plans
Test case | Test data | responseStatus | responseCode |
---|---|---|---|
Merchant not authorized to access | Do not pass merchantId in the HTTP request header | ERROR | UNAUTHORIZED |
Merchant not entitled for Managed Recurring Payments service | Pass invalid Authorization header | ERROR | FORBIDDEN |
Missing mandatory fields | Pass planName as blank | ERROR | VALIDATION_ERROR |
Field length is not within allowed range | Pass planName with more than 100 characters in length | ERROR | VALIDATION_ERROR |
Invalid data | Pass planAmount as decimal value instead of integer | ERROR | VALIDATION_ERROR |
Invalid data | Pass planStatus as any random string value instead of the valid values |
ERROR | VALIDATION_ERROR |
Create a plan with duplicate merchant plan ID | Pass duplicate merchantPlanId while creating a new plan | ERROR | DUPLICATE_PLAN |
Create a plan with plan amount as 0 and plan type as not Autopay | Pass planAmount=0 and planType=SUBSCRIPTION | ERROR | INVALID_PLAN_AMOUNT |
Update a recurring plan
HTTP method: PATCH
Endpoint: /plans/{plan-id}
Test case | Test data | responseStatus | responseCode |
---|---|---|---|
Merchant is not authorized to access | Do not pass merchantId in the HTTP request header | ERROR | UNAUTHORIZED |
Merchant not entitled for Recurring Revenue service | Pass invalid Authorization header | ERROR | FORBIDDEN |
Field length is not within allowed range | Pass planName with more than 100 characters in length | ERROR | VALIDATION_ERROR |
Invalid data | Pass planAmount as decimal value instead of integer | ERROR | VALIDATION_ERROR |
Update plan amount for ACTIVE plan | Update planAmount for a plan whose status is ACTIVE | ERROR | PLAN_AMOUNT_UPDATE_NOT_ALLOWED |
Update plan type for ACTIVE plan | Update planType for a plan whose status is ACTIVE | ERROR | PLAN_TYPE_UPDATE_NOT_ALLOWED |
Update billingFrequencyCount or billingFrequencyUnit for an ACTIVE plan | Update billingFrequencyCount or billingFrequencyUnit for a plan whose status is ACTIVE | ERROR | BILLING_FREQUENCY_COUNT_UPDATE_NOT_ALLOWED BILLING_FREQUENCY_UNIT_UPDATE_NOT_ALLOWED |
Update planStatus for an ACTIVE plan linked to a recurring program | Update planStatus for a plan whose status is ACTIVE and recurringPrograms are attached to the same plan | ERROR | PLAN_STATUS_UPDATE_NOT_ALLOWED |
Invalid planId passed in the request | Pass invalid planId to the endpoint | ERROR | INVALID_PLAN_ID |
Recurring program test cases
The following are the test cases you can try out for the /recurringprograms endpoint.
Retrieve a recurring program
HTTP Method: GET
Endpoint: /recurringprograms
Test case | Test data | responseStatus | responseCode |
---|---|---|---|
Merchant not authorized to access | Do not pass merchantId in the HTTP request header | ERROR | UNAUTHORIZED |
Merchant not entitled for Managed Recurring Payments service | Pass invalid Authorization header | ERROR | FORBIDDEN |
Fetch recurringPrograms by Status successfully | Pass any of the valid values for recurringProgramStatus (SCHEDULED, ACTIVE, CANCELLED) | SUCCESS | ACCEPTED |
Fetch recurringPrograms by consumerProfileId successfully | Pass a valid consumerProfileId | SUCCESS | ACCEPTED |
Invalid query parameter for fetching plans | Pass recurringProgramStts in the query parameters | ERROR | UNSUPPORTED_ACTION |
No records for given search criteria for fetching recurring programs | Pass a value for recurringProgramId for which no recurringPrograms are in the system | ERROR | RECORD_NOT_FOUND |
Create a recurring program
HTTP Method: POST
Endpoint: /recurringprograms
Test case | Test data | responseStatus | responseCode |
---|---|---|---|
Merchant not authorized to access | Do not pass merchantId in the HTTP request header | ERROR | UNAUTHORIZED |
Merchant not entitled for Managed Recurring Payments service | Pass invalid Authorization header | ERROR | FORBIDDEN |
Missing mandatory field | Pass planId as blank | ERROR | VALIDATION_ERROR |
Field length is not within allowed range | Pass recurringProgramName with more than 100 characters in length | ERROR | VALIDATION_ERROR |
Invalid data | Pass recurringProgramQuantity as non-numeric | ERROR | VALIDATION_ERROR |
Create a recurring program with start date in the past | Pass startDate with a value in the past | ERROR | INVALID_START_DATE |
Create a recurring program with end date in the past | ass endDate with a value in the past | ERROR | INVALID_END_DATE |
Create a recurring program with invalid plan ID | Pass planId as any random string | ERROR | INVALID_PLAN_ID |
Create a recurring program with duplicate merchant plan ID | Pass duplicate merchantRecurringProgramId while creating a new recurring program | ERROR | DUPLICATE_MERCHANT_RECURRING_PROGRAM_ID |
Create a recurring program with invalid paymentMethodId or consumerProfileId | Pass invalid paymentMethodId or consumerProfileId while creating a new recurring program |
ERROR | INVALID_CONSUMER_PROFILE_ID |
Update a recurring program
HTTP method: PATCH
Endpoint: /recurringprograms/{recurring-program-id}
Test case | Test codes | responseStatus | responseCode |
---|---|---|---|
Merchant not authorized to access | Do not pass merchantId in the HTTP request header | ERROR | UNAUTHORIZED |
Merchant not entitled for Managed Recurring Payments service | Pass invalid Authorization header | ERROR | FORBIDDEN |
Field length is not within allowed range | Pass recurringProgramName with more than 100 characters in length | ERROR | VALIDATION_ERROR |
Invalid data | Pass recurringProgramQuantity as non-numeric | ERROR | VALIDATION_ERROR |
Update a recurring program in SCHEDULED status with start date in the past | Pass startDate with a value in the past | ERROR | INVALID_START_DATE |
Update a recurring program with end date in the past | Pass endDate with a value in the past | ERROR | INVALID_END_DATE |
Update a recurring program in SCHEDULED status with invalid plan ID | Pass planId as any random string | ERROR | INVALID_PLAN_ID |
Update a recurring program in SCHEDULED status with duplicate merchant plan ID | Pass duplicate merchantRecurringProgramId while creating a new recurring program | ERROR | DUPLICATE_MERCHANT_RECURRING_PROGRAM_ID |
Update a recurring program whose current status is CANCELLED with new status as ACTIVE | Pass recurringProgramStatus = ACTIVE | ERROR | RECURRING_PROGRAM_UPDATE_NOT_ALLOWED |
Update start date to any date in the future for a recurring program in ACTIVE status | Pass startDate as any value in the future | ERROR | RECURRING_PROGRAM_UPDATE_NOT_ALLOWED |
Update consumerProfileId for a recurring program in ACTIVE status | Pass any valid consumerProfileId | ERROR | RECURRING_PROGRAM_UPDATE_NOT_ALLOWED |
Update recurring program without passing recurringProgramAmount and changing recurringPlanDefault to True | Pass recurringPlanDefault = True and do not pass recurringProgramAmount | ERROR | MISSING_RECURRING_PROGRAM_AMOUNT |
Invalid recurringProgramId passed in the request | Pass invalid recurringProgramId | ERROR | INVALID_RECURRING_PROGRAM_ID |
Refunds test cases
The following are the test cases you can try out for the /refunds endpoint.
HTTP method: POST
Endpoint: /refunds
Test case | Test data | responseStatus | responseCode |
---|---|---|---|
Merchant not authorized to access | Do not pass merchantId in the HTTP request header |
ERROR | UNAUTHORIZED |
Merchant not entitled for Managed Recurring Payments service | Pass invalid Authorization header | ERROR | FORBIDDEN |
Refund using Invalid recurringProgramId passed in the request | Pass invalid recurringProgramId in the request | ERROR | INVALID_RECURRING_PROGRAM_ID |
Refunding on a billing cycle when Invalid Billing Start date passed in the request | Pass invalid billingCycleStartDate in the request | ERROR | INVALID_BILLING_CYCLE_START_DATE |
Refunding on a billing cycle when Invalid Refund Amount passed in the request |
Pass invalid refundAmount in the request | ERROR | INVALID_REFUND_AMOUNT |
Refunding on a billing cycle whose payment is not collected | N/A | ERROR | REFUND_VALIDATION_ERROR |