Skip to content

Testing Setup

Jorge A. Torres edited this page Sep 16, 2021 · 4 revisions

Before being able to test purchases with the PayPal Payments gateway, you’ll need a sandbox business and customer/buyer account as well as a sandbox REST API app.

If you have signed up for a PayPal Developer account, it should already include a sandbox business account and a default REST API app which you can use for testing purposes as long as the REST API app is correctly configured. If you want to use those for testing WooCommerce PayPal Payments, skip to How to obtain my Sandbox API Credentials?.

How to Create a Sandbox Business Account?

Here’s how to create a Sandbox Business Account for PayPal Payments

  1. Create or log into a https://developer.paypal.com account
  2. After you have logged in to the developer dashboard, go to Sandbox > Accounts: (screenshot)
  3. You’ll see a list of sandbox accounts. Click on the “Create Account” button
  4. A new “Create Sandbox Account” modal should appear. Select the “Business (Merchant Account)” option and choose United States as the Country/Region
  5. To have more options when you create an account (like choosing the name, email, password, balance amount etc), you can click the Create Custom Account link at the bottom of the form: (screenshot)
  6. Click “Create” to finish creating your Sandbox Business Account
  7. You can find your new Sandbox Business Account in your list of sandbox accounts

How to Create a Sandbox Customer Account?

Here’s how to create Sandbox Customer/Buyer Account for PayPal Payments:

  1. Log into https://developer.paypal.com
  2. After you have logged in to the developer dashboard, go to Sandbox > Accounts: (screenshot)
  3. You’ll see a list of sandbox accounts. Click on the “Create Account” button
  4. A new “Create Sandbox Account” modal should appear. Select the “Personal (Buyer Account)” option and choose United States as the Country/Region: (screenshot)
  5. Click “Create” to finish creating your Sandbox Customer Account
  6. You can find your new Sandbox Customer Account in your list of sandbox accounts

How to create a REST API app?

Here’s how to create a REST API app:

  1. Log into https://developer.paypal.com
  2. After you have logged in to the developer dashboard, go to "My Apps & Credentials" (screenshot)
  3. You'll see a list of REST API apps, including a default one named "Default Application" which can't be removed
  4. Click "Create App"
  5. Enter the details and make sure "App Type" is "Merchant" and the sandbox business account you created above is the one selected inside the "Sandbox Business Account" dropdown. (screenshot)
  6. Click "Create App" to finish creating your REST API app
  7. You'll be taken to a page with details on your new REST API app
  8. Scroll down to "App feature options" and make sure "Accept payments" is checked off
  9. Click "Advanced options" and make sure both "Vault" and "Billing agreements" are checked off (screenshot)

How to obtain my Sandbox API Credentials?

In order to process the checkout and test purchases, you will need a valid set of PayPal Sandbox API Credentials. Specifically, you will need:

  • A sandbox business e-mail address and merchant ID (from your sandbox business account)
  • A Client ID and Secret Key (from your REST API app)

To fetch these you will need a PayPal sandbox business account and a REST API app, which you should've created following the steps above. Assuming you already have a Sandbox Business Account and a REST API app (associated to that same sandbox business account) on your PayPal Developer account, here’s how to find the required credentials:

  1. Log into your PayPal account at https://developer.paypal.com and navigate to Sandbox > Accounts:
  2. You’ll see a list of sandbox accounts. Find the business account you want the API credentials for and click “...” (more options) button under the Manage Accounts column
  3. Once the modal loads, click View/Edit Account, and make sure you're on the Profile tab
  4. Take note of the "Email ID" and "Account ID". Those will be your "Sandbox E-mail address" and "Merchant ID" as required by the extension
  5. Click "My Apps & Credentials" on the left menu
  6. Choose the REST API app you created before
  7. Double check that the "Sandbox account" on this app is the same e-mail address from step 3
  8. Click "Show" under "Secret" to see the secret key
  9. Take note of "Client ID" and "Secret" as those will be required by the extension
  10. If necessary, fill in these details into the WooCommerce settings screen for the PayPal Payments extension