Sandbox Testing

Sandbox Testing

The sandbox mode is similar to that of real world usage in most regards, however there are some differences depending on the service being used.

Prices

The prices used in sandbox are generally based on real world asset prices, for assets which exist (conceptually) on both mainnet and testnet. However the DEXes used on testnets are generally not arbitraged to be the same price. This can lead to the application reporting unexpectedly large (or possibly negative) fees.

KYC

If the user does not have an existing MoonPay or Stripe account, they will have to complete the mocked KYC (opens in a new tab) process. This will not require a valid SSN or credit card, however they will have to provide a valid email and phone number to get past security checks. See below for details to on the test credit card details to provide, depending on the service.

You can enable the sandbox testing mode in your application by setting useSandbox to true and using your sandbox apiKey. API keys can be obtained from the dashboard (opens in a new tab).

Below is an example using the Commerce Widget, however the Headless Client takes the same options:

import { openHalliday } from "@halliday-sdk/commerce";
 
openHalliday({
    apiKey: HALLIDAY_SANDBOX_PUBLIC_API_KEY,
    ...
 
    // If set to true, will use service sandboxes and testnet chains.
    // To use the sandbox, you must provide a sandbox API key above.
    useSandbox: true
);

Stripe onramp KYC mock values

For testing Stripe onramp, please use these mock values for KYC:

KYC RequirementMock Value
SSN000-00-0000
Credit Card Number4242 4242 4242 4242
Credit Card Expiration08/30 (any future date)
Email Verification Code000000 (all zeros)
CVC123

Moonpay onramp KYC mock values

For testing Moonpay onramp, please follow these guidelines for testing (opens in a new tab). The following values work for testing in the United States:

KYC RequirementMock Value
SSN123-12-3123
Credit Card Number5385 3083 6013 5181
Credit Card Expiration12/2030
Email Verification Codereceive from email
Checkout Confirmation CodeCheckout1!
CVC123

Considerations when testing MoonPay

MoonPay has several security features in place to detect and prevent fraud; given the nature of testing, it is possible some activities may be incorrectly tagged as fraudulent. To that end, we recommend you follow these best practices as you test your integration:

  • Do not use test credit cards in real world environments or your account will get automatically blocked.
  • Do not use the same MoonPay account across sandbox and real world environments or your account will get automatically blocked.
  • Fraud alerts / issues may occur if MoonPay suspects a user has multiple MoonPay accounts. Ensure that each tester uses a unique identifier (email, phone number, etc.) that has not been previously associated with MoonPay.
  • Sandbox testing may have outdated code, so it is possible there are unexpected bugs. When testing in sandbox, you’re allowed to create multiple accounts with completely made up KYC data.

Considerations when using the exchange service

The exchange service only supports tokens that the major exchanges support, which typically does not include tokens on testnets. If you use this service in the sandbox environment, you will still be able to walk through the commerce widget flow for mainnet tokens, but the actual transfer is mocked and will not initiate anything onchain.