Last updated

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:

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.

  1. Optionally, to test transactions, create a new test customer and a Rebilly hosted payment form:

    1. In the left navigation bar, press Data tables, then press Customers.
    2. In the top right of the screen, press Add customer.
    3. Enter the test customers details, then press Save customer.
    4. In the right of the screen, press , then press 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 press Submit.
    7. Press Copy URL and open the URL in a browser.
    8. Use any card number from the steps below.
  2. Simulate an approved transaction: Use any card in Simulate approved transactions.

  3. Simulate a declined transaction. Use any card in Simulate declined transactions.

  4. 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 to approved. Visa: 4000000000000200
    • Timeout (Declined): Simulate a timeout from a downstream gateway. After execution, the result is updated 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
    • Waiting on gateway flow: This test simulates waiting-gateway status, waiting on an asynchronous response from the processor. The transaction is marked as approved 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 brandNumberCountry
Visa4111111111111111US
Visa4123400073320224DE
Visa4761229700150465AU
Visa4761209980011439NZ
Mastercard5555555555554444CA
Mastercard5204245250460049DE
American Express378282246310005US
Discover6011111111111117
Diners Club30569309025904
JCB3530111333300000JP
China UnionPay6253111111111114
Maestro6759641111111119
IBANDE89370400440532013000

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 brandNumberCountry
Visa4000000000000002US
Mastercard5105105105105100CA
American Express371449635398431US
Discover6011000990139424US
Diners Club38520000023237
JCB3566002020360505
China UnionPay6243030000000001
Maestro6771790000000018AT
IBANDE62370400440532013001

Test a generic offsite approval flow

Use this process to test a generic offsite approval flow.

  1. Ensure that 3DS is not active on the payment gateway account:

    1. In the left navigation bar, press Settings .
    2. In the Configuration section, press Gateway accounts.
    3. Press TestProcessor.
    4. Press 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, press Save gateway account.
  2. Create a new customer and test the transaction:

    1. In the left navigation bar, press Data tables, then press Customers.
    2. In the top right of the screen, press Add customer.
    3. Enter the test customers details, then press Save customer.
    4. In the right of the screen, press , then press Collect payment.
    5. Enter the amount and add a description for the payment.
    6. Select the Pay with Rebilly hosted payment form option, and press Submit.
    7. Press 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. 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).

  1. Configure 3DS on the payment gateway account:

    1. In the left navigation bar, press Settings .

    2. In the Configuration section, press Gateway accounts.

    3. Press TestProcessor.

    4. Press 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, then select the Activate 3D secure checkbox.

    8. In the 3D server dropdown, select ThreeDSecureIO3dsServer.

    9. 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
        1. In the Acquirer merchant ID Visa field, enter test-visa.
        2. In the Merchant acquirer BIN Visa field, enter 411111.
      • Mastercard
        1. In the Acquirer merchant ID Mastercard field, enter test-mastercard.
        2. In the Merchant acquirer BIN Mastercard field, enter 555555.
      • American Express (AMEX)
        1. In the Acquirer merchant ID AMEX field, enter test-amex.
        2. In the Merchant acquirer BIN Amex field, enter 378282.
      • Discover
        1. In the Acquirer merchant ID Discover field, enter test-discover.
        2. In the Merchant acquirer BIN Discover field, enter 601111.
      • JCB
        1. In the Acquirer merchant ID JCB field, enter test-jcb.
        2. In the Merchant acquirer BIN JCB field, enter 305693.
    10. In the Merchant name field, enter your merchant name.

    11. In the Merchant country dropdown, select a country.

    12. In the Merchant URL field, enter any valid URL.

    13. In the Transaction type dropdown, select Goods/Service purchase

    14. Clear the Use 3DS for merchant-initiated transactions checkbox.

    15. Do not select a 3RI type.

    16. At the bottom of the screen, press Save gateway account.

  2. Create a new customer and test the transaction:

    1. In the left navigation bar, press Data tables, then press Customers.
    2. In the top right of the screen, press Add customer.
    3. Enter the test customers details, then press Save customer.
    4. In the right of the screen, press , then press Collect payment.
    5. Enter the amount and add a description for the payment.
    6. Select the Pay with Rebilly hosted payment form option, and press Submit.
    7. Press 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. 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 brandNumberOutcome
Visa4111111111111111Manual challenge
Mastercard5555555555554444Frictionless flow, authenticated
Visa4000000000000002Frictionless flow, not authenticated
Mastercard5105105105105100Frictionless flow, not authenticated