Sandbox
The sandbox environment is an isolated test space connected to AccruPay's QA infrastructure. No real charges occur — all payment operations are simulated by each provider's test system.
Enable sandbox mode
Node SDK
Pass environment: 'sandbox' to the constructor:
import AccruPay, { TRANSACTION_PROVIDER, CURRENCY, COUNTRY_ISO_2 } from '@accrupay/node';
const sdk = new AccruPay({
apiSecret: process.env.ACCRUPAY_API_SECRET_SANDBOX,
environment: 'sandbox',
});
When environment is 'sandbox', the SDK routes all requests to:
https://api.qa.pay.accru.co/graphql
React SDK
Pass environment="sandbox" to the AccruPay provider:
import { AccruPay, CardNumber, CardExpiry, CardCVC, CardholderName, SubmitButton } from '@accrupay/react';
export function Checkout({ sessionId }: { sessionId: string }) {
return (
<AccruPay
merchantPublicId={process.env.NEXT_PUBLIC_ACCRUPAY_MERCHANT_PUBLIC_ID_SANDBOX}
transactionSessionId={sessionId}
environment="sandbox"
>
<CardholderName />
<CardNumber />
<CardExpiry />
<CardCVC />
<SubmitButton>Pay now</SubmitButton>
</AccruPay>
);
}
Sandbox and production environments have separate API keys. Using a production apiSecret against the sandbox endpoint (or vice versa) will fail authentication. Keep both sets of credentials in your environment and switch them alongside the environment flag.
Test payment methods
Test card numbers are specific to each payment provider. Use any future expiry date and any 3-digit CVV unless noted otherwise.
| Card number | Brand | Behavior |
|---|---|---|
4111111111111111 | Visa | Approved |
5111111111111118 | Mastercard | Approved |
4444333322221111 | Visa | Approved |
4000000000000002 | Visa | Declined |
4000000000000077 | Visa | 3DS challenge |
See the Nuvei testing docs for the full list including specific decline codes.
| Card number | Brand | Behavior |
|---|---|---|
4242424242424242 | Visa | Succeeds |
5555555555554444 | Mastercard | Succeeds |
4000000000000002 | Visa | card_declined |
4000000000009995 | Visa | insufficient_funds |
4000000000000101 | Visa | CVC check fails |
4000002500003155 | Visa | 3DS authentication required |
See the Stripe testing docs for the full list.
Sandbox vs. production comparison
| Sandbox | Production | |
|---|---|---|
| API endpoint | api.qa.pay.accru.co | api.pay.accru.co |
| Charges | None — simulated | Real charges |
| API keys | Sandbox credentials | Production credentials |
environment value | 'sandbox' | 'production' (default) |
| Provider behavior | Provider test mode | Live provider |
Recommended local setup
Use environment variable prefixes to avoid accidentally mixing credentials:
# .env.local (never commit this file)
ACCRUPAY_API_SECRET=sk_sandbox_...
NEXT_PUBLIC_ACCRUPAY_MERCHANT_PUBLIC_ID=pub_sandbox_...
# .env.production
ACCRUPAY_API_SECRET=sk_live_...
NEXT_PUBLIC_ACCRUPAY_MERCHANT_PUBLIC_ID=pub_live_...
Then derive the environment flag from a single variable rather than duplicating it across every SDK call:
const sdk = new AccruPay({
apiSecret: process.env.ACCRUPAY_API_SECRET,
environment: process.env.ACCRUPAY_ENVIRONMENT === 'production' ? 'production' : 'sandbox',
});
Next steps
- Go Live — checklist before switching to production
- Provider Integrations (sidebar) — provider-specific test credentials and behavior