Skip to Content
Resources

Testing

Sandbox test cards and the scenarios to run for each checkout, for Altruon.js callbacks, trials and coupons before you go live.

Test your integration in sandbox before you take a real payment. Sandbox is a separate environment with its own backoffice, URLs and keys. This page lists the test cards and the scenarios to run.

Sandbox at a glance

Sandbox value
Backofficehttps://login.sandbox.altruon.io
API base URLhttps://{your-domain}.api.sandbox.altruon.io
Hosted page linkhttps://{your-domain}.sandbox.altruon.io/checkout/p/{id}
Dynamic hosted checkout URLhttps://{your-domain}.sandbox.altruon.io/checkout/s/{sessionId}
Secret key (server only)sk_sandbox_...
Publishable key (browser)pk_sandbox_...

See Sandbox and environments for how to get access.

Test cards

Use these card numbers in sandbox. Enter any future expiry date and any three-digit CVC.

ScenarioCard number
Successful payment4111 1111 1111 1111
Declined payment4000 0000 0000 0002
3D Secure required4000 0027 6000 3184
Insufficient funds4000 0000 0000 9995

Test a hosted checkout

These steps apply to hosted pages and to dynamic hosted checkout.

  1. Open the hosted page link, or create a sandbox session with hostedCheckout: true and open its checkout_url.
  2. Check the page: your logo and colors, the plan and any pre-applied coupons in the order summary, the fields you enabled, and the payment methods routed for the currency.
  3. On dynamic hosted checkout, check that the fields you sent in customerData are pre-filled.
  4. Pay with the successful test card.

Once the payment succeeds:

  • The shopper is redirected to your redirect URL.
  • A subscription is created on your billing platform.
  • The invoice is marked paid.
  • The transaction is recorded with the acquirer's own transaction ID.
  • For a hosted page, the Converted counter and the conversion rate of the page update under Settings > Hosted Pages.

Scenarios worth running

ScenarioWhat to expect
A declined card or a failed 3D Secure challenge on dynamic hosted checkoutThe shopper returns to the same /checkout/s/{sessionId} URL with the form restored and can retry while the session is valid.
A failed payment on a session created without paymentData.paymentMethodEvery routed payment method stays available, so the shopper can switch method.
A session left open for more than 15 minutesThe session expires. A hosted page link can be opened again and the session counts in the Expired column. A dynamic session cannot be restarted: create a new one.
A hosted page in Draft or Archived statusThe link is rejected at checkout.

Test Altruon.js callbacks

Trigger each callback of your Altruon.js integration at least once.

CallbackHow to trigger it
onSuccessPay with the successful test card, 4111 1111 1111 1111.
onFailurePay with the declined test card, 4000 0000 0000 0002.
onDataRequiredLeave required fields empty and attempt the payment.
onActionRequired with a redirectPay with the 3D Secure test card, 4000 0027 6000 3184.
onActionRequired with a QR codeSelect Pix or UPI as the payment method.

A session is single use. After a failed payment in Altruon.js, create a new session before the shopper retries. See Payment results for how to handle each callback, and the callbacks reference for their payloads.

To see a complete integration running against your sandbox keys, clone the merchant demo described in Altruon.js examples.

Test trials

  1. Use sandbox plans with a trial period configured on each billing platform you connect.
  2. Check that the estimate returns trialEnd before the payment.
  3. Complete the checkout, then confirm that the subscription is in trial status in Altruon.
  4. Confirm that the subscription becomes active after the trial end webhooks arrive.
  5. Run a checkout without a trial and one with an amount due today, and confirm that both still charge as before.

See Trials for the supported acquirers and payment methods.

Test coupons

Test every coupon in sandbox before you use it in production. Invalid or unknown codes are rejected by the billing platform. See Coupons for the identifier each billing platform expects.

Check the result

After a successful test payment, look up the outcome from your server with the transaction ID:

GET https://{your-domain}.api.sandbox.altruon.io/api/v1/transaction/{transactionId}/details

The response describes the transaction with its customer, invoice and subscription. See Get transaction details.

Next steps