Test transactions

This topic describes how to test transactions in the Rebilly sandbox environment and the Rebilly live environment.

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

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.
  • Cancel a subscription.
  • Issue a partial and a full refund.
  • Limit the payment gateway to using one, or a small number of, test customer IDs. Do this by setting additional filters in the advanced gateway configuration settings.

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

Tests

When using the cards described in this section, use a future expiration date, and any valid CVV. Amex cards have a 4 digit CVV, all others have a 3 digit CVV.

  1. Simulate an approved transaction:

    Card type Number
    Visa 4111111111111111
    MasterCard 5555555555554444
    American Express 378282246310005
    Discover 6011111111111117
    Diners Club 30569309025904
    JCB 3530111333300000
    China UnionPay 6253111111111114
    Maestro 6759641111111119
    IBAN DE89370400440532013000
  2. Simulate a declined transaction:

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

    • 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 will change from "timeout" to "approved". Visa: 4000000000000200
    • Timeout (Declined): Simulate a timeout from a downstream gateway. After execution, the timeout value will change from "timeout" to "declined". Visa: 4462030000000000
    • Connection Error: Simulate a connection exception. Visa: 4000000000001000
    • Refund request morphed to void: Where possible, Rebilly will void 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/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