Test making one-time purchase in sandbox mode
Sandbox mode is a stand-alone environment that supports all the features of a live environment, except real and declined payments. You can access sandbox mode by sending "mode":"sandbox"
when you get the token.
To open the payment UI, use this link and specify the obtained token there: https://sandbox-secure.xsolla.com/paystation3/?access_token={token}
.
In sandbox mode, you can test a one-time purchase with:
Test bank card payment
In sandbox mode, you can test the following payment UI interaction scenarios while making a payment with a bank card:
Making a test payment
- Open the payment UI in sandbox mode.
- Choose the Credit/Debit cards group of payment methods.
- Enter the bank card details. You can also specify incorrect details (card number or expiration date) to test if an error is generated.
- Click Pay now.
In addition to card details, you need to specify the ZIP code if at least one of the following conditions is true:
- The user’s country is the US or Canada.
- The Bank Identification Number (BIN) indicates that a card was issued in the US.
You can specify any valid ZIP code (e.g., 12345). This determines the sales tax rate and does not affect the progress of the test payment.
Sandbox bank card payments can be made in the following currencies: USD, EUR, RUB, GBP, AED, ALL, AMD, ARS, AUD, AZN, BGN, BRL, BYN, CAD, CHF, CLP, CNY, COP, CZK, DKK, DZD, EGP, GEL, HKD, HRK, HUF, IDR, ILS, INR, ISK, JPY, KES, KGS, KRW, KZT, MAD, MDL, MKD, MNT, MXN, MYR, NGN, PEN, PHP, PKR, PLN, RON, RSD, SAR, SEK, SGD, THB, TRY, TWD, UAH, UYU, UZS, VEF, VND, ZAR.
To see transactions made in sandbox mode:
- Open your Publisher Account.
- Go to Accounting > Transaction registry.
- Check the Show test transactions box.
Refund
- Configure the Refund webhook.
- Make a successful test payment.
- Call the Request refund API method.
A notification about the payment refund will be sent to the webhook URL.
Partial refund
- Configure the Partial refund webhook.
- Make a successful test payment.
- Call the Request partial refund API method.
A notification about the partial payment refund will be sent to the webhook URL.
Blocking fraud transaction
- Configure the AFS rejected transaction webhook.
- Make a test payment with this card:
Card | Country | 3-D Secure |
---|---|---|
Card number: 5159084825528450 Exp. date: 12/40 CVV2: Any 3 digits Card brand: Mastercard | US | No |
When making this payment, you will see an error in the payment UI. A notification about a declined transaction as the result of the AFS check will also be sent to the webhook URL.
Chargeback
A separate API call for sandbox mode was developed to test this scenario without any bank participation.
To test chargeback:
- Configure the Refund webhook.
- Make a successful test payment.
- Call the Request chargeback API method.
You will receive a Refund webhook with the following code:
Code | Reason | Description |
---|---|---|
2 | Chargeback | Transaction chargeback requested. |
Test PayPal payment
- Create an account for PayPal sandbox mode:
- Open the PayPal Developer website.
- Log in to your account or create a new one.
- Go to
Sandbox > Accounts . - In the
Sandbox Account section, clickCreate account . - In the modal window, select the
Personal account type and a country. - Click
Create . The created account will be shown in the list of sandbox accounts.
- Open the payment UI in sandbox mode.
- Choose the PayPal payment method.
- In the payment window, enter required information.
- Click
Pay Now . You will be redirected to a window to log in to your PayPal account.
- To complete the testing payment process, enter information about your sandbox account created in step 1:
Email ID as the email address andSystem Generated Password as the password. To find this information:- Log in to your account on the PayPal Developer website.
- Go to
Sandbox > Accounts . - In the
Sandbox Account section, choose the sandbox account. - Click ••• and select
View/edit account from the drop-down list.
- Click
Pay Now .
You can also use information from existing sandbox accounts:
sb-xmxij16980134@business.example.com | oi9_m_KW |
sb-p7pju16979920@business.example.com | 7%%p8ioS |
Was this article helpful?
Rate this page
Don’t want to answer
Thank you for your feedback!
Found a typo or other text error? Select the text and press Ctrl+Enter.