← Back to Blog
Engineering18.01.2026·4 min read

Testing Crypto Payments in Sandbox: A Developer's Checklist

Never test payments with real money. Blockchain testnets and sandbox environments let you validate every step of the payment flow — from wallet connection to webhook delivery — using worthless test tokens. Teams that test thoroughly see 73% fewer production issues.

Quick Answer

A sandbox environment is a testing mode provided by a payment processor that connects to blockchain testnets instead of mainnets. Transactions use worthless test tokens obtained from faucets, so developers can test the full payment flow including wallet connection, transaction confirmation, and w...

Crypto payment integration is fundamentally different from traditional payment testing. You cannot simply use a test card number like “4242 4242 4242 4242.” Instead, you interact with real blockchain test networks where actual (but worthless) transactions are broadcast, confirmed by validators, and settled on-chain. This means your tests exercise the same code paths as production, including wallet signing, block confirmation delays, and webhook delivery. SpacePay's integration data shows that teams with thorough sandbox testing experience 73% fewer production payment issues in their first 90 days. The investment in proper testing pays for itself many times over.

Testnets: Your Free Testing Infrastructure

A testnet is a separate blockchain network that mirrors the behaviour of its mainnet counterpart but uses tokens with no monetary value. Testnets have their own validators, their own block explorers, and their own consensus mechanics. A transaction on Sepolia behaves identically to a transaction on Ethereum mainnet — same gas model, same confirmation process, same EVM execution — except the ETH has no value.

MainnetTestnetFaucetBlock Explorer
EthereumSepoliaAlchemy, Infura, Googlesepolia.etherscan.io
SolanaDevnetCLI airdrop, solfaucet.comexplorer.solana.com (devnet)
PolygonAmoyPolygon faucetamoy.polygonscan.com
BitcoinTestnet3coinfaucet.eu, testnet-faucet.comblockstream.info/testnet
ArbitrumArbitrum SepoliaBridge from Sepolia ETHsepolia.arbiscan.io
BaseBase SepoliaBridge from Sepolia ETHsepolia.basescan.org

Getting Test Tokens from Faucets

Faucets are web services that distribute free testnet tokens. Most require only a wallet address and impose rate limits to prevent abuse. For Ethereum testnets, Alchemy's faucet provides 0.5 Sepolia ETH per day. For Solana, the CLI command solana airdrop 2 delivers 2 SOL to your devnet wallet instantly. For L2 testnets, you typically bridge Sepolia ETH through the official bridge contracts. Keep a dedicated test wallet with multiple testnets configured to streamline your development workflow.

The Complete Testing Checklist

The following checklist covers every critical path in a crypto payment integration. Each item should be tested independently and as part of an end-to-end flow.

1. Payment Creation

  • Create a payment session via the API with valid parameters.
  • Verify the response includes a payment ID, supported tokens, amounts, and expiration.
  • Test with different currencies, amounts, and metadata.
  • Confirm that idempotency keys prevent duplicate payment creation.
  • Verify error responses for invalid amounts, missing fields, and authentication failures.

2. Wallet Connection & Token Selection

  • Connect a wallet on each supported chain (MetaMask for EVM, Phantom for Solana).
  • Verify the widget correctly displays available tokens and balances.
  • Test chain switching and network mismatch handling.
  • Verify behaviour when the wallet has insufficient balance.
  • Test wallet disconnection during the payment flow.

3. Transaction Confirmation

  • Submit a payment and verify the transaction appears on the testnet block explorer.
  • Confirm the confirmation counter increments correctly in the widget.
  • Verify the payment status transitions: pending, confirmed, completed.
  • Test on multiple chains to validate chain-specific confirmation logic.

4. Webhook Delivery & Processing

  • Verify webhooks are delivered for each event type (pending, confirmed, completed, failed).
  • Validate HMAC signature verification with the test signing secret.
  • Test webhook retry by returning non-2xx responses and verifying redelivery.
  • Verify idempotent processing — replay a webhook and confirm no duplicate action.
  • Test webhook delivery when your endpoint is temporarily unreachable.

5. Refund Processing

  • Initiate a refund for a completed payment and verify the refund transaction on-chain.
  • Confirm the refund webhook is delivered with correct amounts.
  • Test partial refunds if supported.
  • Verify your order management system correctly updates the order status.

6. Error Handling & Edge Cases

  • Underpayment. Send less than the required amount and verify the system handles the shortfall (request top-up or auto-refund).
  • Overpayment. Send more than required and verify the excess is handled correctly.
  • Expired payment. Let a payment session expire and verify the failure webhook fires and the UI shows an appropriate error.
  • Reverted transaction. If possible on the testnet, simulate a reverted transaction and verify the failure path.
  • User rejection. Reject the transaction in the wallet and verify the widget shows a recoverable error state.
  • Network congestion. Test with low gas prices to simulate delayed inclusion.

Automated Testing and Mocking

Manual testing is essential for initial validation, but automated tests are what prevent regressions. Structure your test suite into three layers.

  • Unit tests with mocks. Mock the payment API and blockchain interactions entirely. Test your webhook handler's signature verification, your order fulfilment logic, and your UI state transitions. These tests run in milliseconds with no network dependencies.
  • Integration tests with sandbox. Use the payment processor's sandbox API to create real test payments. Trigger the testnet transaction programmatically and verify the full flow from payment creation through webhook delivery. These tests are slower (10–60 seconds) but validate the real integration.
  • End-to-end tests with browser automation. Use Playwright or Cypress with a test wallet extension to simulate the complete customer journey: page load, widget interaction, wallet signing, confirmation, and success page. These are the slowest but most comprehensive.

CI/CD Integration

Automated payment tests should run in your CI/CD pipeline on every pull request. Unit tests with mocks run fast and should be mandatory for merge. Integration tests with the sandbox API can run on merge to the staging branch, with the sandbox API keys stored as CI secrets. End-to-end tests can run on a nightly schedule or before production deploys. The goal is to catch payment regressions before they reach production, where a broken payment flow means lost revenue and eroded customer trust.

SpacePay's sandbox supports programmatic test triggering via API, which means your CI pipeline can create a payment, simulate the customer's testnet transaction, wait for webhook delivery, and assert the results — all without manual intervention.

Frequently Asked Questions

What is a crypto payment sandbox?

A testing mode that connects to blockchain testnets instead of mainnets. Transactions use valueless test tokens, so you can validate the full payment flow — wallet connection, confirmation, webhooks — without risking real funds.

Which testnets should I use?

Sepolia for Ethereum and EVM chains, Solana Devnet for Solana, Amoy for Polygon, Bitcoin Testnet3 for Bitcoin, and the respective Sepolia variants for Arbitrum and Base. Each mirrors its mainnet's behaviour with valueless tokens.

How do I get test tokens?

From faucets — web services that distribute free testnet tokens. Alchemy and Infura offer Sepolia faucets. Solana provides a CLI airdrop command. For L2 testnets, bridge Sepolia ETH through the official bridge. SpacePay's sandbox includes a built-in faucet.

How much does sandbox testing reduce production issues?

SpacePay's data shows a 73% reduction in production payment issues for teams with thorough sandbox testing. The most commonly prevented issues are webhook handling errors, incorrect confirmation logic, and missing error states in the UI.

Can I automate payment tests in CI/CD?

Yes. Use mocked unit tests for fast PR checks, sandbox API integration tests for staging, and browser-automated end-to-end tests for pre-production validation. SpacePay's sandbox supports programmatic test triggering via API for full automation.

Should I test webhook signatures in sandbox?

Absolutely. The sandbox uses the same HMAC signing mechanism as production with a separate test secret. Testing signature verification in sandbox prevents one of the most common causes of webhook-related production failures.

What is the difference between sandbox and testnet testing?

Testnet testing uses actual blockchain test networks with real but valueless transactions. Sandbox testing is broader: it includes testnet transactions plus the processor's test mode, which can simulate conditions like instant confirmations or specific error states that are hard to reproduce on a live testnet.

What edge cases should I prioritise in testing?

Underpayment (customer sends less than required), overpayment (customer sends more), expired payment sessions, reverted transactions, wallet disconnection during payment, and webhook delivery failures. These edge cases account for the majority of production support tickets.

Conclusion

Testing crypto payments is more involved than traditional payment testing, but the infrastructure is equally mature. Testnets mirror mainnet behaviour. Faucets provide free tokens. Sandbox environments deliver real webhooks. Mocking frameworks enable fast, deterministic CI tests. The 73% reduction in production issues is not aspirational — it is the measured outcome of following a structured testing checklist. Treat sandbox testing as a non-negotiable part of your integration timeline, not an afterthought. Every hour spent testing in sandbox saves days of debugging in production.