Test 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 order .
  • 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 Apply additional filters in Set up a payment gateway .

After completing the test transactions, log in to your payment gateway account and confirm that the corresponding test transactions are present.

Tests

Use this process to test payment transactions.

  1. Optionally, to test transactions, create a new test customer and a Rebilly hosted payment form:
    1. In the left navigation bar, click Data tables icon , then click Customers .
    2. In the top right of the screen, click Add customer .
    3. Enter the test customers details, then click Save customer .
    4. In the right of the screen, click Action icon , then click Collect payment .
    5. Enter the amount and add a description for the test payment.
    6. Select the Pay with Rebilly hosted payment form option, and click Submit .
    7. Click Copy URL and open the URL in a browser.
    8. Use any card number from the steps below.
  2. Simulate an approved transaction. Select from the following cards:
    note

    Use a future expiration date, and any valid CVV. Amex cards have a 4 digit CVV, all others have a 3 digit CVV.

    Card type Number
    Visa 4111111111111111
    Mastercard 5555555555554444
    American Express 378282246310005
    Discover 6011111111111117
    Diners Club 30569309025904
    JCB 3530111333300000
    China UnionPay 6253111111111114
    Maestro 6759641111111119
    IBAN DE89370400440532013000
  3. Simulate a declined transaction. Select from the following cards:
    note

    Use a future expiration date, and any valid CVV. Amex cards have a 4 digit CVV, all others have a 3 digit CVV.

    Card type Number
    Visa 4000000000000002
    Mastercard 5105105105105100
    American Express 371449635398431
    Discover 6011000990139424
    Diners Club 38520000023237
    JCB 3566002020360505
    China UnionPay 6243030000000001
    Maestro 6771790000000018
    IBAN DE62370400440532013001
  4. Simulate special cases:
    note

    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 timeout value changes from "timeout" to "approved". Visa: 4000000000000200
    • Timeout (Declined) : Simulate a timeout from a downstream gateway. After execution, the timeout value changes from "timeout" to "declined". 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
    • Test ACH bank accounts : Use this test bank account to test ACH:
    • Routing number: 123456789
    • Account number: 1234567890

Test 3DS payment flows

This section describes how to test 3DS payment flows.

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 Configure 3D Secure (3DS) in Set up a payment gateway.

Test a generic offsite approval flow

Use this process to test a generic offsite 3DS approval flow.

  1. Ensure that 3DS is not active on the payment gateway account:
    1. In the left navigation bar, click Settings icon Settings .
    2. In the Configuration section, click Gateway accounts .
    3. Click TestProcessor .
    4. Click Edit gateway account .
    5. In the Setup instruction section, in the Instruction dropdown, select Authorize .
    6. In the Advanced configuration section, turn on the Advanced configuration toggle.
    7. Scroll down the page to the 3D secure section, and ensure that the Activate 3D secure checkbox is clear.
    8. At the bottom of the page, click Save gateway account .
  2. Create a new customer and test the transaction:
    1. In the left navigation bar, click Data tables icon , then click Customers .
    2. In the top right of the screen, click Add customer .
    3. Enter the test customers details, then click Save customer .
    4. In the right of the screen, click Action icon , then click Collect payment .
    5. Enter the amount and add a description for the payment.
    6. Select the Pay with Rebilly hosted payment form option, and click Submit .
    7. Click Copy URL and open the URL in a browser.
    8. In the payment card number field, enter 4000000000000101. Use a future expiration date, and any valid CVV.
    9. Click Continue , then click Confirm .

    In the response, an approvalUrl 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.

  1. Configure 3DS on the payment gateway account:
    1. In the left navigation bar, click Settings icon Settings .
    2. In the Configuration section, click Gateway accounts .
    3. Click TestProcessor .
    4. Click Edit gateway account settings .
    5. In the Setup instruction section, in the Instruction dropdown, select Authorize .
    6. In the Advanced configuration section, turn on the Advanced configuration toggle.
    7. Scroll down the page to the 3D secure section, then select the Activate 3D secure checkbox.
    8. In the 3DS server dropdown, select ThreeDSecureIO3dsServer .
    9. In the Merchant ID field, enter Test .
    10. In the Merchant acquirer BIN VISA field, enter 411111.
    11. In the Merchant acquirer BIN Mastercard field, enter 55555.
    12. In the Merchant country field, enter US .
    13. In the Merchant URL field, enter any valid URL.
    14. Clear the V1 checkbox, and select the V2 checkbox.
    15. In the Transaction type dropdown, select Goods/Service purchase
    16. Clear the Use 3DS for merchant-initiated transactions checkbox.
    17. Do not select a 3RI type.
    18. At the bottom of the screen, click Save gateway account .
  2. Create a new customer and test the transaction:
    1. In the left navigation bar, click Data tables icon , then click Customers .
    2. In the top right of the screen, click Add customer .
    3. Enter the test customers details, then click Save customer .
    4. In the right of the screen, click Action icon , then click Collect payment .
    5. Enter the amount and add a description for the payment.
    6. Select the Pay with Rebilly hosted payment form option, and click Submit .
    7. Click Copy URL and open the URL in a browser.
    8. In the payment card number field, enter 4111111111111111. Use a future expiration date, and any valid CVV.
    9. Click Continue , then click Confirm .

    In the response, an approvalUrl returned. At the URL, simulate the different outcomes of the challenge flow in a 3DSecure.io sandbox environment.