Sandbox environment is for simulate payments to test your integration.
Authentication
The Payze API uses Sandbox API key and secret to authenticate test requests.
You can view your Sandbox API keys in the Payze Dashboard.
Warning
Your API keys carry privileges, so be sure to keep them secure!
Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.
Using sandbox API KEY and request
Pass sandbox apiKey
and apiSecret
to the request body to successfully authenticate request as test.
We don’t recommend using card numbers directly in API calls or server-side code, even in test mode. If you do use them, your code might not be PCI-compliant when you go live.
{
//Methods are the same as production environment only API Keys and API Secret parameters are different
"apiKey": "API_KEY",
"apiSecret": "API_SECRET",
...
}
Note that any other payment parameters are the same as production environment
You can test any payments method you wants, There aren't any additional parameters for sandbox transactions only difference are apiKeys
and apiSecret
parameters anything else are the same as real one.
Remember You can’t process live payments under the sandbox
apiKeys
andapiSecret
Test environment let you simulate several scenarios
- Test payments without waiting for verification.
- Test redirect after Successful/Declined transactions.
- Test non-redirect payments.
- Test webhooks, Perform actions in test mode that send legitimate events to your endpoint.
How to use test cards
After sandbox payment link generated, use a card number, such as 4111 1111 1111 1111 for successful payments and anything other for test declined payments.
Any other fields aren't important just use some numbers like real one
- Use a valid numbers, such as 12/34 for date.
- Use any three-digit CVC
- Use any value you like for other fields.
When you’re ready to take your integration live, replace your test
apiKeys
andapiSecret
with live ones. You can’t process live payments if your integration is still using your test API keys.