Test Apple Pay in sandbox mode
Sandbox mode is a stand-alone environment that includes all features of the production environment (live mode) except for user authorization and the ability to make real payments. You can access sandbox mode by sending “sandbox”: true
when getting a token.
To open the payment UI, use this link and specify the obtained token as a query parameter: https://sandbox-secure.xsolla.com/paystation4/?token={token}
.
In sandbox mode, you can test the following payment UI interaction scenarios for Apple Pay:
Apple Pay test account
Prerequisites
Before creating a test account, you need to configure an Apple developer account. To do this:
- Register your Merchant ID.
- Create your Payment Processing Certificate or obtain a certificate signing request (CSR) from your payment service provider (PSP).
- To accept payments in a browser:
a. Create a Merchant Identity Certificate.
b. Register and verify your domain.
c. Verify that all web pages hosting an Apple Pay button use the HTTPS protocol and that your web server supports the TLS 1.2 encryption protocol.
Create test account
To test the payment process, you need to create an Apple Pay sandbox account:
- Log in to your account in Apple Store Connect.
- Go to the
Users and Access section. - On the
Sandbox tab, add a test account:- If you already have a test account, click the + icon and fill in the information about a test user.
- If you don’t have a test account, click
Create Test Accounts and fill in the information about a test user.
- Click
Create .
The account you created appears in the test account list. For testing, log in to it on your test Apple devices (mobile or desktop) and add test cards.
Testing scenarios
Test payment in Safari browser
To test payment via Apple Pay in the Safari browser:
- Open the payment UI in sandbox mode.
- Click the Apple Pay button.
- Go to Apple Pay on your mobile or desktop device and complete the payment with a test card.
The transaction ID is shown on the page after completing the payment.
To see detailed information, including fees, about transactions made in sandbox mode:
- In your Publisher Account, go to the Accounting > Transaction registry section.
- Set the Show test transactions toggle to active.
Additionally, you can see the transactions’ details and request refunds in Publisher Account in the Support > Transaction search section.
Test payment in browser via QR code
If you test a payment via Apple Pay in a browser other than Safari:
- Open the payment UI in sandbox mode.
- Click the Apple Pay button.
- Use your iPhone to scan the QR code that appears.
- Go to Apple Pay on your iPhone and complete the payment with a test card.
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.
Found a typo or other text error? Select the text and press Ctrl+Enter.