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, a mock KYC (opens in a new tab) form will be shown. This will not require a valid SSN or credit card, however the user will have to provide a valid email and phone number to get past security checks. See test credit card details that can be provided, depending on the service.
The sandbox testing mode can be enabled in the application by setting useSandbox
to true and using an account's 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, a sandbox-only API key must be passed.
// Separate sandbox keys can be created in the Halliday dashboard.
useSandbox: true
);
Stripe Onramp KYC Mock Values
For testing Stripe onramp, use the following mock values for KYC:
KYC Requirement | Mock Value |
---|---|
SSN | 000-00-0000 |
Credit Card Number | 4242 4242 4242 4242 |
Credit Card Expiration | 08/30 (any future date) |
Email Verification Code | 000000 (all zeros) |
CVC | 123 |
Moonpay Onramp KYC Mock Values
For testing Moonpay onramp, see the guidelines for testing (opens in a new tab). The following mock values will work for testing in the United States:
KYC Requirement | Mock Value |
---|---|
SSN | 123-12-3123 |
Credit Card Number | 5385 3083 6013 5181 |
Credit Card Expiration | 12/2030 |
Email Verification Code | receive from email |
Checkout Confirmation Code | Checkout1! |
CVC | 123 |
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, it is recommended to follow these best practices to test an integration:
- Do not use test credit cards in real world environments or the account will automatically be blocked.
- Do not use the same MoonPay account across sandbox and real world environments or the account will automatically be 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. Creation of multiple accounts with new fictitious KYC data is permitted when testing in sandbox.
Considerations when using the Exchange Service
The exchange service only supports tokens that selected exchanges support, which typically does not include tokens on testnets. Using this service in the sandbox environment will provide a flow through the commerce widget for mainnet tokens, but the actual transfer is mocked and will not initiate any transactions onchain.