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
| Item | beta (test) | real (production) |
|---|---|---|
| Checkout | https://beta-pay.stagepay.io | https://pay.stagepay.io |
| PG credentials | PG sandbox/test keys | PG production keys |
| Callback URL | purchaseTestUrl | purchaseRealUrl |
| Real charges | No | Yes |
Test payments by PG
| PG | How to test |
|---|---|
STRIPE | Card 4242 4242 4242 4242, any future expiry date, any 3-digit CVC. For 3D Secure testing, use 4000 0027 6000 3184 |
KCP | Use KCP test cards/accounts in an app connected with a KCP test site code (no real charge after approval) |
TOSS | When Toss Payments test keys are connected, use the payment widget's test payment |
MYCARD | Test cards in the MyCard test (testb2b) environment |
EBANX / ENJOYPAY | Test payment methods in each PG's sandbox account |
USDT | Use 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.
- Start a payment on the beta checkout with
pg=USDT&method=TRC20(or another network) and note the receiving address and the exact amount. - 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 apayment.succeededcallback is sent. - Request a different amount to exercise
underpaid/overpaid, or request it after the payment window has expired to exerciselate→ 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, andenvironmentin the body istest. - The payment itself still goes through the production PG, so real charges occur. Refund them after QA.
Testing callbacks
- In the console, open Transaction details → Callbacks to see the delivery history (request headers and body, response code, duration).
- You can send a failed callback again with the Resend button.
X-StagePay-Deliverystays the same on resend. - 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
/returnmessage -
payment.refundedcallbacks are handled on refund (clawback policy) - Requests with a timestamp that differs by 5 minutes or more are rejected
Payment Methods and Country Support
The PGs, regions, payment methods, and currencies available in StagePay v2, and how to look up the payment methods actually available to your app.
How USDT Payments Work
The StagePay USDT payment architecture, which identifies orders by receiving address and unique amount without private keys, and confirms payments after on-chain confirmations.