Testing PayPal Commerce Payments

Would you like to test PayPal Commerce payments before accepting real payments on your site? Creating a PayPal Business sandbox account allows you to test your forms and ensure the payment process functions correctly.

In this tutorial, we’ll show you set up a sandbox account to test PayPal Commerce payments with your forms.

  1. Setting Up a Sandbox Account in PayPal
  2. Enabling PayPal Commerce Test Mode
  3. Creating a Form to Test PayPal Commerce Payments
  4. Enabling PayPal Commerce Payments in Your Form
  5. Publishing and Testing Your Form
  6. Viewing Test Transactions in Your PayPal Sandbox Account

Requirements: To use the PayPal Commerce addon for WPForms you’ll need


Before getting started, you’ll first need to make sure WPForms is installed and activated on your WordPress site and that you’ve verified your license. Then, be sure to activate and install the PayPal Commerce addon.

Note: This guide covers how to test payments with the PayPal Commerce addon. If you’re looking to test payments with the PayPal Standard addon instead, please see our tutorial on testing PayPal Standard payments.

1. Setting Up a Sandbox Account in PayPal

To get started, you’ll need to create a PayPal Business account if you don’t have one already.

Note: PayPal Commerce requires a PayPal Business account and won’t work with a PayPal Personal account. To learn how to open the correct account, check out PayPal’s guide to opening a Business account.

Once you have access to a PayPal Business account, head over to the PayPal Developer site and log in with your PayPal Business account credentials.

After logging in, locate the Sandbox section in the left sidebar menu and click Accounts.

Account-area-in-PayPal-Sandbox

On the next page, you’ll see that PayPal has created both a Personal and a Business sandbox account for you by default.

PayPal-Sandbox-account

From here, you’ll need to set up a password for your Business sandbox account, which will allow you to log in with this account later to make test payments. PayPal does generate a password for you by default, however, we recommend changing it to something you’ll remember easily.

To create your password, click on the 3 dots under the Manage Accounts column for the Business test email. Then, click on View/edit account.

Click-view-edit-account

Note: If you’d like to create additional test accounts, be sure to check out PayPal’s documentation on managing sandbox accounts.

Next, a modal window will appear with your sandbox account details. From here, click on the Change password link to change your password.

Click-to-change-password

Go ahead and enter your new password and click Save.

click-to-save-password

After changing your password, feel free to close the modal window. However, we recommend keeping the PayPal Developer site open as you’ll need to refer back to it while connecting PayPal Commerce to WPForms.

2. Enabling PayPal Commerce Test Mode

Now that you have your sandbox account set up, you’ll need to enable Test Mode to prevent PayPal Commerce from processing live transactions. To do this, go to WPForms » Settings in your WordPress dashboard and click on the Payments tab.

WPForms-payment-settings

After that, scroll to the PayPal Commerce section and check the box next to Test Mode.

enable-test-mode

Connecting With PayPal Commerce

Now that you’ve enabled Test Mode, you’ll need to connect with PayPal Commerce by clicking the Connect with PayPal Commerce button.

click-connect-with-paypal-commerce-button

Next, a modal window will appear where you’ll need to enter your sandbox account details.

connect-to-paypal-modal-window

Go ahead and switch back to your PayPal Developer dashboard and copy the sandbox Business account email address.

copy-business-email-address

Now, head back to your WPForms payment settings and paste the Business account email address into the Email field.

add-paypal-business-email-address

After that, select your country or region from the dropdown.

select-country-or-region

When you’re ready, click Next to proceed to the next step.

click-next-button-paypal-modal

In the next modal window, enter the password you created when you set up a sandbox account and click Log In.

enter-password-and-click-login-button

A new modal window will appear asking you to “Allow PayPal to connect your account with Test Store.” Go ahead and click the Agree and Connect button.

click-agree-and-connect-button

Once you’ve successfully connected your PayPal sandbox account, you’ll see the connection status change to Connected to PayPal in Sandbox mode.

PayPal-connection-status

In the next section, we’ll cover how to create a simple payment form to test your PayPal Commerce transactions.

3. Creating a Form to Test PayPal Commerce Payments

Now that you’ve set up your sandbox account for testing, you’ll need a form you can use to test PayPal Commerce transactions. To do this, create a new form or edit an existing one to open the form builder.

Feel free to customize the form however you’d like, but be sure to include a PayPal Commerce field. You can add this field by simply clicking on it on the left side of the form builder or by dragging and dropping it into the preview area.

select-paypal-commerce-field

The PayPal Commerce field will allow you to test both PayPal and credit card transactions to make sure they’re working as expected.

If you’d like to test credit card payments, you’ll need to log in to the PayPal Developer dashboard and use the test credit card generator.

paypal-credit-card-generator

Note: Want to learn more about accepting payments through your WordPress forms? Check out our guide to creating payment forms for all the details.

4. Enabling PayPal Commerce Payments in Your Form

Next, you’ll need to enable PayPal Commerce payments for the form you’ll be using to test transactions. In the form builder, go to Payments » PayPal Commerce and toggle on the Enable one-time payments option.

enable-one-time-payments-form-builder

After enabling this option, additional settings will appear that aren’t required for testing your PayPal Commerce transactions. However, we recommend adding a description to the Payment Description field to help you identify your test transactions in your sandbox account dashboard later on.

PayPal-Commerce-settings

Note: The rest of the settings are optional for testing payments, but you’ll want to configure them when you’re ready to accept live transactions. We’ve covered how to configure these settings in more detail in our full PayPal Commerce addon tutorial.

Now that you’ve enabled PayPal Commerce payments, go ahead and save your form.

5. Publishing and Testing Your Form

Once you’ve set up your form, you’re ready to test PayPal Commerce transactions on the frontend of your site. To test your form without publishing it to a live page on your site, you can use the WPForms form preview option or create a private page or post.

Then, go ahead and complete a test transaction by submitting a test entry for your form. Keep in mind that when you complete the test transaction, you’ll want to use the email address and password associated with the Personal sandbox account that PayPal has created for you.

You can find the credentials for your Personal sandbox account in the PayPal Developer dashboard under Sandbox » Accounts.

personal-sandbox-email

Note: You’ll need to use a different account than the Business sandbox account you’ve used to connect PayPal Commerce to WPForms. If you attempt to complete a test transaction with your Business sandbox account, PayPal will decline the transaction.

6. Viewing Test Transactions in Your PayPal Sandbox Account

After you submit a test payment, you can view the transaction in your PayPal Business sandbox account by clicking on the Transaction ID in your test entry.

Alternatively, you can log in to your PayPal Business sandbox account with the same sandbox business email and password you used to connect your account to WPForms.

Note: When you’re viewing test transactions, be sure not to use your personal PayPal Business account to log in to your sandbox account. You’ll need to use the same sandbox Business email address and password you used to connect with PayPal Commerce.

Once you’ve logged in to your PayPal Business sandbox account, click the Activity tab at the top of your account dashboard.

click-activity-tab

Then, click All Transactions to view your transactions.

click-all-transactions

You should now see your test transaction(s) listed in a table on the following screen.

all-transactions-table

Note: When you’re done testing PayPal Commerce payments, remember to disconnect your test account in WPForms » Settings » Payments, turn off Test Mode, and connect your live PayPal Business account so you can process users’ transactions.

That’s it! Now you know how to test PayPal Commerce payments in WPForms.

Next, would you like to perform a full form test before you publish it on your site? Our complete form testing checklist walks you through the process step by step.