Xsolla Documentation - Test PayPal in sandbox mode (2024)

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/paystation4/?token={token}.

In sandbox mode, you can test the following payment UI interaction scenarios for PayPal:

  • making test payment
  • refund
  • partial refund
  • chargeback
  • saving account
  • deleting saved account
  • charging with saved account
  • getting the list of saved accounts

Note

For each scenario, you can also test generating errors.

Create test PayPal account

To test the payment process, you need to create an account for PayPal sandbox mode:

  1. Open the PayPal Developer website.
  2. Log in to your account or create a new one.
  3. Go to the Sandbox accounts tab.
  4. On the Sandbox test accounts page, click Create account.
  5. Select the Personal (Buyer Account) account type and choose the country.
  6. Click Create.

The created account is shown in the list of sandbox accounts.

You can also use information from existing sandbox accounts:

Email IDSystem Generated Password
sb-xmxij16980134@business.example.comoi9_m_KW
sb-p7pju16979920@business.example.com7%%p8ioS

Test one-time purchase

Make test payment

  1. Open the payment UI in sandbox mode.
  2. Choose the PayPal payment method.
  3. In the Mock Response Code field, enter 0 or leave the field empty.
  4. In the ZIP Code field, enter any 5 digits.
Xsolla Documentation - Test PayPal in sandbox mode (1)
  1. Click Pay. You will be redirected to a window to log in to your PayPal account.
  2. Enter information about your sandbox account: Email ID as the email address and System Generated Password as the password. To find this information:
    1. Log in to your account on the PayPal Developer website.
    2. Go to the Sandbox accounts tab.
    3. On the Sandbox test accounts page, choose a sandbox account.
    4. Click ••• and select View/Edit account from the drop-down list. You will see the data in the modal window that opens.
  3. Complete the test payment.

The transaction ID is shown on the page after completing the payment:

Xsolla Documentation - Test PayPal in sandbox mode (2)

After completing a successful test payment, your PayPal account is saved in the list of payment methods.

To see detailed information, including fees, about transactions made in sandbox mode:

  1. Open your Publisher Account.
  2. Go to Accounting > Transaction registry.
  3. Check the Show test transactions box.

Additionally, you can see the transactions’ details and request refunds in Publisher Account in the Support > Transaction search section.

Refund

  1. Configure the Refund webhook.
  2. Make a successful test payment.
  3. Call the Request refund API method.

A notification about the payment refund will be sent to the webhook URL.

Partial refund

  1. Configure the Partial refund webhook.
  2. Make a successful test payment.
  3. Call the Request partial refund API method.

A notification about the partial payment refund will 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:

  1. Configure the Refund webhook.
  2. Make a successful test payment.
  3. Call the Request chargeback API method.

You will receive a Refund webhook with the following code:

CodeReasonDescription
2ChargebackTransaction chargeback requested.

Test saved account

Save account

You can test saving an account in the payment UI:

  • while making a test payment
  • from a user account

Save account while making test payment

  1. Configure the Add payment account webhook.
  2. Open the payment UI in sandbox mode.
  3. Choose PayPal as a payment method.
  4. In the Mock Response Code field, enter 0 or leave the field empty.
  5. In the ZIP Code field, enter any 5 digits.
  6. Check the Never ask again box.
  7. Click Pay. You will be redirected to a window to log in to your PayPal account.
  8. Enter information about your sandbox account.
  9. Complete the test payment.
Xsolla Documentation - Test PayPal in sandbox mode (3)

A notification about adding a new account is sent to the webhook URL.

The saved account is displayed in the Saved methods section.

Save account in payment UI

  1. Configure the Add payment account webhook.
  2. Open the payment UI in sandbox mode.
  3. Go to Saved.
  4. Click the pencil icon and choose Add new method.
  5. Choose PayPal.
  6. In the Mock Response Code field, enter 0 or leave the field empty.
  7. In the ZIP Code field, enter any 5 digits.
  8. Click Save. You will be redirected to a window to log in to your PayPal account.
  9. To complete settings, enter information about your sandbox account.
  10. Click Save and Continue.
Xsolla Documentation - Test PayPal in sandbox mode (4)

A notification about adding a new account is sent to the webhook URL.

The saved account is displayed in the Saved methods section.

Delete saved account

You can test deleting a saved account:

  • via API
  • in the payment UI

Delete saved account via API

  1. Configure the Remove payment account webhook.
  2. Call the Delete saved accounts API method.

A notification about deleting an account is sent to the webhook URL.

Delete saved account in payment UI

  1. Configure the Remove payment account webhook.
  2. Open the payment UI in sandbox mode.
  3. Go to Saved.
  4. Click the pencil icon.
  5. Click Edit methods.
  6. Choose an account and click the bin icon.
Xsolla Documentation - Test PayPal in sandbox mode (5)

A notification about deleting an account is sent to the webhook URL.

Charge with balance of saved account

You can test a payment with a saved account:

  • via API
  • in the payment UI

Note

You can test both:

  • a one-time charge (e.g., purchase with a saved card)
  • regular charges (e.g., subscription payment)

Charge balance of saved account via API

  1. Configure the Payment webhook.
  2. Save account in the sandbox mode.
  3. Call the Charge with saved account API method.

A notification about a successful payment is sent to the webhook URL.

Charge balance of saved account in payment UI

  1. Configure the Payment webhook.
  2. Save the account in sandbox mode.
  3. Open the payment UI in sandbox mode.
  4. Click the account from the list of saved payment accounts.
  5. Click Pay.
Xsolla Documentation - Test PayPal in sandbox mode (6)

A notification about a successful payment is sent to the webhook URL.

Get list of saved accounts

  1. Save accounts in the sandbox mode.
  2. Call the Get saved accounts API method.

You will get masked data in the response.

Generate errors

  1. Open payment UI in sandbox mode.
  2. Choose the PayPal payment method.
  3. In the Mock Response Code field, enter an error code from the list that you want to test, or leave the field empty.
  4. In the ZIP Code field, enter any 5 digits.
  5. Click Pay. You will be redirected to your PayPal account to complete the payment.

The error message will appear on the payment UI.

Xsolla Documentation - Test PayPal in sandbox mode (7)

Error codes:

Error codesTest scenario
1501, 1057, 1015, 3006, 1801, 1803, 1039Any test scenarios.
3031, 1203, 1039, 3006, 1201, 1002, 1089, 2031, 1046, 5004Payment without saving an account.
1084, 1089, 1071, 1501, 1207, 1021, 1022, 1002, 5020, 5022, 3031, 1091, 1203, 1039, 3006, 1201, 1002, 1089, 2031, 1046, 5004, 2030, 1059, 3022, 1803, 1090, 2001, 1000, 1050, 1044Payment with saving an account.
3031, 1203, 1039, 3006, 1201, 1002, 1089, 2031, 1046, 5004Payment with a saved account.
Was this article helpful?

Thank you for your feedback!

We’ll review your message and use it to help us improve your experience.

Rate this page

Rate this page

Don’t want to answer

Thank you for your feedback!

Last updated:September 12, 2024

Found a typo or other text error? Select the text and press Ctrl+Enter.

Xsolla Documentation - Test PayPal in sandbox mode (2024)
Top Articles
Landlord Insurance vs. Homeowners Insurance: What’s the Difference? – Policygenius
Traveling? Here’s How Much Cash To Bring
English Bulldog Puppies For Sale Under 1000 In Florida
Katie Pavlich Bikini Photos
Gamevault Agent
Pieology Nutrition Calculator Mobile
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Compare the Samsung Galaxy S24 - 256GB - Cobalt Violet vs Apple iPhone 16 Pro - 128GB - Desert Titanium | AT&T
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Craigslist Dog Kennels For Sale
Things To Do In Atlanta Tomorrow Night
Non Sequitur
Crossword Nexus Solver
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Energy Healing Conference Utah
Geometry Review Quiz 5 Answer Key
Hobby Stores Near Me Now
Icivics The Electoral Process Answer Key
Allybearloves
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Marquette Gas Prices
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Vera Bradley Factory Outlet Sunbury Products
Pixel Combat Unblocked
Movies - EPIC Theatres
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Mia Malkova Bio, Net Worth, Age & More - Magzica
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Where Can I Cash A Huntington National Bank Check
Topos De Bolos Engraçados
Sand Castle Parents Guide
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Holzer Athena Portal
Hello – Cornerstone Chapel
Stoughton Commuter Rail Schedule
Nfsd Web Portal
Selly Medaline
Latest Posts
Article information

Author: Dean Jakubowski Ret

Last Updated:

Views: 6019

Rating: 5 / 5 (70 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Dean Jakubowski Ret

Birthday: 1996-05-10

Address: Apt. 425 4346 Santiago Islands, Shariside, AK 38830-1874

Phone: +96313309894162

Job: Legacy Sales Designer

Hobby: Baseball, Wood carving, Candle making, Jigsaw puzzles, Lacemaking, Parkour, Drawing

Introduction: My name is Dean Jakubowski Ret, I am a enthusiastic, friendly, homely, handsome, zealous, brainy, elegant person who loves writing and wants to share my knowledge and understanding with you.