Testing & sandbox
SwapSS Pay v1 doesn’t have a separate sandbox with fake money. Building a fake-chain simulator that accurately reflects confirmation timing, edge cases, and memo handling is a significant engineering effort. In practice, testing on a real cheap network is faster and more representative.
Recommended: small real-network invoices
The best test strategy is to create real invoices on a network where transaction fees are tiny and confirmation is fast:
| Asset | Network | Why | Fee |
|---|---|---|---|
| USDT | Tron (TRC-20) | Fast (~3s finality), fees under $0.01 with enough energy, widely supported | <$0.01 |
| USDC | Solana | Low fees, quick confirmations, strong wallet support | ~$0.01 |
| USDT | BSC (BEP-20) | Low network fees, broad wallet support, familiar stablecoin flow | ~$0.02 |
Test plan
- Create a $0.10 invoice.
Use the API or the cabinet form. Choose any method currently returned byGET /merchant/pay-in-assets, for example USDT on Tron or USDC on Solana. Set awebhook_urlpointing to a service like webhook.site so you can inspect the payloads. - Open the
payment_url.
Confirm the hosted checkout renders your merchant name, the exact amount, and the deposit address. - Send the exact amount from your test wallet.
Send the exact amount the API returns, copied to the last digit. The hosted checkout shows the precise amount with a copy button so your customer gets it right. - Watch the webhook arrive.
You should receiveinvoice.confirmingwithin seconds of broadcast, theninvoice.confirmed/invoice.paidonce the required confirmations are reached. - Check your cabinet balance.
The credited amount (invoice amount minus service fee) should appear in /cabinet/merchant/balance. - Test cancellation.
Create a second invoice, don’t pay it, then callPOST /api/v1/merchant/invoices/:id/cancel. Confirm the status becomescancelledand your webhook firesinvoice.cancelled. - Test expiry.
Create an invoice, don’t pay it, wait forexpires_at. The automation marks itexpiredand fires the webhook. - Test a refund.
On the paid invoice, callPOST /api/v1/merchant/invoices/:id/refundsfor the full amount. The refund is verified, then sent; subscribe torefund.*webhooks to be notified when it lands.
Edge cases worth testing
- Wrong amount: Send a different amount than requested. The invoice should enter
underpaidstate and triggerinvoice.review_required. - Idempotency: Submit the same invoice creation request twice with the same
Idempotency-Key. Confirm only one invoice exists. - Invalid webhook signature: Alter one byte of the payload and confirm your verification code rejects it.
Future plans
A dedicated staging environment with test-network support is planned for a future release. Watch the changelog for updates.