Skip to Content
StagePayDocs v2

Testing

How to verify your integration using the beta environment, PG-specific test payment methods, the test whitelist, callback resends, and the USDT mock chain.

Test environment setup

Itembeta (test)real (production)
Checkouthttps://beta-pay.stagepay.iohttps://pay.stagepay.io
PG credentialsPG sandbox/test keysPG production keys
Callback URLpurchaseTestUrlpurchaseRealUrl
Real chargesNoYes

Test payments by PG

PGHow to test
STRIPECard 4242 4242 4242 4242, any future expiry date, any 3-digit CVC. For 3D Secure testing, use 4000 0027 6000 3184
KCPUse KCP test cards/accounts in an app connected with a KCP test site code (no real charge after approval)
TOSSWhen Toss Payments test keys are connected, use the payment widget's test payment
MYCARDTest cards in the MyCard test (testb2b) environment
EBANX / ENJOYPAYTest payment methods in each PG's sandbox account
USDTUse the StagePay mock chain instead of a testnet (see below)

The StagePay operations team connects PG test accounts to your app. To see which PGs are connected to your beta app, check Apps → Payment methods in the console.

USDT testing (mock chain)

In the beta environment, USDT payments are checked against the StagePay mock chain instead of a real blockchain. You do not need real USDT or testnet tokens.

  1. Start a payment on the beta checkout with pg=USDT&method=TRC20 (or another network) and note the receiving address and the exact amount.
  2. Ask the StagePay operations team for a mock deposit, quoting the transaction ID (tid). The mock deposit goes through the same matching and confirmation path as a real on-chain deposit, and a payment.succeeded callback is sent.
  3. Request a different amount to exercise underpaid / overpaid, or request it after the payment window has expired to exercise late → USDT exceptions.

QA in production: the test whitelist

If you want only specific users of a production app to be routed to the test callback URL, register their IP or userId in the console under App settings → Test whitelist.

  • Callbacks for whitelisted payments are sent to purchaseTestUrl, and environment in the body is test.
  • The payment itself still goes through the production PG, so real charges occur. Refund them after QA.

Testing callbacks

  1. In the console, open Transaction details → Callbacks to see the delivery history (request headers and body, response code, duration).
  2. You can send a failed callback again with the Resend button. X-StagePay-Delivery stays the same on resend.
  3. Check your signature verification implementation against the test vectors first.

Checklist

  • Successful payment → callback received once, signature verification passes, item granted once
  • Resending the same callback does not grant the item again (idempotent)
  • If the callback server returns 5xx, retries arrive and the item is granted normally after recovery
  • On payment cancellation/failure, no item is granted and the client UI returns to normal
  • The WebView closes on receiving the /return message
  • payment.refunded callbacks are handled on refund (clawback policy)
  • Requests with a timestamp that differs by 5 minutes or more are rejected

On this page