Test payment transactions
This topic describes how to test payment transactions in Rebilly.
Environments
Sandbox environment
Use the sandbox environment to test code changes and experiment without risk.
By default, the sandbox is configured with a testing payment gateway called TestProcessor. No information is sent to third parties when using this gateway.
Live environment
Use the live environment as your product environment. Experimenting in this environment involves risk. Plan your tests carefully.
Live environment release checklist
Before releasing to your users, complete the following:
- Define a series of small-value test transactions for various scenarios, and test these using all enabled card types.
- Test the checkout flow.
- Subscribe to a plan and ensure that the card is charged immediately. For more information, see Create a product and pricing plan.
- Cancel a subscription. For more information, see Cancel a subscription.
- Issue a partial and a full refund. For more information, see Refund transactions.
- Limit the payment gateway to using one, or a small number of, test customer IDs. For more information, see in Set up a payment gateway - Configure additional filters.
After completing the test transactions, log in to your payment gateway account and confirm that the corresponding test transactions are present.
Test transactions
Use this process to test transactions using the TestProcessor payment gateway in sandbox environment. To test all other payment gateways, refer to their specific documentation.
Optionally, to test transactions, create a new test customer and a Rebilly hosted payment form:
- In the left navigation bar, press Data tables, then press Customers.
- In the top right of the screen, press Add customer.
- Enter the test customers details, then press Save customer.
- In the right of the screen, press , then press Collect payment.
- Enter the amount and add a description for the test payment.
- Select the Pay with Rebilly hosted payment form option, and press Submit.
- Press Copy URL and open the URL in a browser.
- Use any card number from the steps below.
Simulate an approved transaction: Use any card in Simulate approved transactions.
Simulate a declined transaction. Use any card in Simulate declined transactions.
Simulate special cases:
Use a future expiration date, and any valid CVV. Amex cards have a 4 digit CVV, all others have a 3 digit CVV.
- First transaction approved, subsequent transactions declined: Simulate a successful subscription creation followed by declines on all rebills. Visa: 4000000000000010
- Timeout (Approved): Simulate a timeout from a downstream gateway. After execution, the result is updated from
timeout
toapproved
. Visa: 4000000000000200 - Timeout (Declined): Simulate a timeout from a downstream gateway. After execution, the result is updated from
timeout
todeclined
. Visa: 4462030000000000 - Connection error: Simulate a connection exception. Visa: 4000000000001000
- Refund request morphed to void: Where possible, Rebilly voids a transaction instead of refunding it. A void transaction prevents the transaction from occurring. A refund is a secondary transaction. Visa: 4000000000020000
- Refund declined: Simulate a refund declined scenario. Visa: 4000000000100000
- Alternating approved or declined: This test starts with an approved status: Visa: 4000000002000000
- Declined with reason code Fraud: Test this scenario if you handle declines with reason code Fraud, or want to test rules that are in place to handle this automatically, such as adding those customers to a blocklist. Visa: 4000000010000000
- Offsite payment flow: Offsite payment is used for scenarios that involve Dynamic Currency Conversion (DCC) and 3D Secure. The offsite payment workflow is advanced, contact us for more information. To trigger an offsite payment flow, use the following:
- Simulate
waiting-approval
and then approve after a simulated 3DS flow is completed: Visa: 4000000000000101 - Approve instantly: Visa: 4000001000000000
- Simulate
- Waiting on gateway flow: This test simulates
waiting-gateway
status, waiting on an asynchronous response from the processor. The transaction is marked asapproved
within 10 minutes. Visa: 4263982640269299 - Test ACH bank accounts: Use this test bank account to test ACH:
- Routing number: 123456789
- Account number: 1234567890
Test payment cards and IBANs
Use the following payment card numbers to simulate different outcomes in Rebilly when processing payments. These payment cards do not generate real charges.
Simulate approved transactions
The following test card numbers and IBAN simulate approved transactions. Use a future expiration date, and any valid CVV. Amex cards have a 4 digit CVV, all others have a 3 digit CVV.
Card brand | Number | Country |
---|---|---|
Visa | 4111111111111111 | US |
Visa | 4123400073320224 | DE |
Visa | 4761229700150465 | AU |
Visa | 4761209980011439 | NZ |
Mastercard | 5555555555554444 | CA |
Mastercard | 5204245250460049 | DE |
American Express | 378282246310005 | US |
Discover | 6011111111111117 | |
Diners Club | 30569309025904 | |
JCB | 3530111333300000 | JP |
China UnionPay | 6253111111111114 | |
Maestro | 6759641111111119 | |
IBAN | DE89370400440532013000 |
Simulate declined transactions
The following test card numbers simulate declined transactions. Use a future expiration date, and any valid CVV. Amex cards have a 4 digit CVV, all others have a 3 digit CVV.
Card brand | Number | Country |
---|---|---|
Visa | 4000000000000002 | US |
Mastercard | 5105105105105100 | CA |
American Express | 371449635398431 | US |
Discover | 6011000990139424 | US |
Diners Club | 38520000023237 | |
JCB | 3566002020360505 | |
China UnionPay | 6243030000000001 | |
Maestro | 6771790000000018 | AT |
IBAN | DE62370400440532013001 |
Test a generic offsite approval flow
Use this process to test a generic offsite approval flow.
Ensure that 3DS is not active on the payment gateway account:
- In the left navigation bar, press Settings .
- In the Configuration section, press Gateway accounts.
- Press TestProcessor.
- Press Edit gateway account.
- In the Setup instruction section, in the Instruction dropdown, select Authorize.
- In the Advanced configuration section, turn on the Advanced configuration toggle.
- Scroll down the page to the 3D secure section, and ensure that the Activate 3D secure checkbox is clear.
- At the bottom of the page, press Save gateway account.
Create a new customer and test the transaction:
- In the left navigation bar, press Data tables, then press Customers.
- In the top right of the screen, press Add customer.
- Enter the test customers details, then press Save customer.
- In the right of the screen, press , then press Collect payment.
- Enter the amount and add a description for the payment.
- Select the Pay with Rebilly hosted payment form option, and press Submit.
- Press Copy URL and open the URL in a browser.
- In the payment card number field, enter 4000000000000101. Use a future expiration date, and any valid CVV.
- Press Continue, then press Confirm.
In the response, an approvalUrl
value is returned. From the URL you have the option to approve, decline, or cancel the transaction.
Test a 3DS challenge flow
Use this process to test a 3DS challenge flow.
3DS is an additional security layer for online credit and debit card transactions. 3D stands for the three domains which interact using the protocol: the merchant or acquirer domain, the issuer domain, and the interoperability domain. For more information, see 3D Secure (3DS).
Configure 3DS on the payment gateway account:
In the left navigation bar, press Settings .
In the Configuration section, press Gateway accounts.
Press TestProcessor.
Press Edit gateway account.
In the Setup instruction section, in the Instruction dropdown, select Authorize.
In the Advanced configuration section, turn on the Advanced configuration toggle.
Scroll down the page to the 3D secure section, then select the Activate 3D secure checkbox.
In the 3D server dropdown, select ThreeDSecureIO3dsServer.
Depending on which payment cards you would like to test using 3Ds, select from the following:
At a minimum, you must enter details for Visa and Mastercard.
Visa
- In the Acquirer merchant ID Visa field, enter
test-visa
. - In the Merchant acquirer BIN Visa field, enter 411111.
- In the Acquirer merchant ID Visa field, enter
Mastercard
- In the Acquirer merchant ID Mastercard field, enter
test-mastercard
. - In the Merchant acquirer BIN Mastercard field, enter 555555.
- In the Acquirer merchant ID Mastercard field, enter
American Express (AMEX)
- In the Acquirer merchant ID AMEX field, enter
test-amex
. - In the Merchant acquirer BIN Amex field, enter 378282.
- In the Acquirer merchant ID AMEX field, enter
Discover
- In the Acquirer merchant ID Discover field, enter
test-discover
. - In the Merchant acquirer BIN Discover field, enter 601111.
- In the Acquirer merchant ID Discover field, enter
JCB
- In the Acquirer merchant ID JCB field, enter
test-jcb
. - In the Merchant acquirer BIN JCB field, enter 305693.
- In the Acquirer merchant ID JCB field, enter
In the Merchant name field, enter your merchant name.
In the Merchant country dropdown, select a country.
In the Merchant URL field, enter any valid URL.
In the Transaction type dropdown, select Goods/Service purchase
Clear the Use 3DS for merchant-initiated transactions checkbox.
Do not select a 3RI type.
At the bottom of the screen, press Save gateway account.
Create a new customer and test the transaction:
- In the left navigation bar, press Data tables, then press Customers.
- In the top right of the screen, press Add customer.
- Enter the test customers details, then press Save customer.
- In the right of the screen, press , then press Collect payment.
- Enter the amount and add a description for the payment.
- Select the Pay with Rebilly hosted payment form option, and press Submit.
- Press Copy URL and open the URL in a browser.
- In the payment card number field, enter 4111111111111111. Use a future expiration date, and any valid CVV.
- Press Continue, then press Confirm.
In the response, an approvalUrl
value is returned. At the URL, simulate the different outcomes of the challenge flow in a 3DSecure.io sandbox environment. To test different 3DS flows, use the last four digits from 3dsecure.io to generate a card number which passes Luhn check. For more information, see 3DS browser tests.
Alternatively, select from the following predefined cards numbers to test 3DS outcomes:
Card brand | Number | Outcome |
---|---|---|
Visa | 4111111111111111 | Manual challenge |
Mastercard | 5555555555554444 | Frictionless flow, authenticated |
Visa | 4000000000000002 | Frictionless flow, not authenticated |
Mastercard | 5105105105105100 | Frictionless flow, not authenticated |