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:

AssetNetworkWhyFee
USDTTron (TRC-20)Fast (~3s finality), fees under $0.01 with enough energy, widely supported<$0.01
USDCSolanaLow fees, quick confirmations, strong wallet support~$0.01
USDTBSC (BEP-20)Low network fees, broad wallet support, familiar stablecoin flow~$0.02

Test plan

  1. Create a $0.10 invoice.
    Use the API or the cabinet form. Choose any method currently returned by GET /merchant/pay-in-assets, for example USDT on Tron or USDC on Solana. Set a webhook_url pointing to a service like webhook.site so you can inspect the payloads.
  2. Open the payment_url.
    Confirm the hosted checkout renders your merchant name, the exact amount, and the deposit address.
  3. 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.
  4. Watch the webhook arrive.
    You should receive invoice.confirming within seconds of broadcast, then invoice.confirmed / invoice.paid once the required confirmations are reached.
  5. Check your cabinet balance.
    The credited amount (invoice amount minus service fee) should appear in /cabinet/merchant/balance.
  6. Test cancellation.
    Create a second invoice, don’t pay it, then call POST /api/v1/merchant/invoices/:id/cancel. Confirm the status becomes cancelled and your webhook fires invoice.cancelled.
  7. Test expiry.
    Create an invoice, don’t pay it, wait for expires_at. The automation marks it expired and fires the webhook.
  8. Test a refund.
    On the paid invoice, call POST /api/v1/merchant/invoices/:id/refunds for the full amount. The refund is verified, then sent; subscribe to refund.* webhooks to be notified when it lands.

Edge cases worth testing

  • Wrong amount: Send a different amount than requested. The invoice should enter underpaid state and trigger invoice.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.