PayPal

Testing and go live

Test integration in Braintree sandboxAnchorIcon

Before deploying to production, test the integration in sandbox to ensure it works as expected. You can test using one of the following:

  • Mocked PayPal responses: Recommended testing mechanism
  • Linked PayPal account: Used for end-to-end testing

Mocked PayPal testingAnchorIcon

Use the Braintree sandbox API credentials and the test values mentioned in the Testing page to simulate PayPal responses within your Braintree sandbox. You can use the mock responses to verify if your client and server-side code work appropriately.

LimitationAnchorIcon

Mocked PayPal testing does not send data to your PayPal sandbox account and is not compatible with the PayPal Checkout component of the JavaScript v3 SDK. As a result, end-to-end testing is not possible. For information on complete end-to-end testing, see Linked PayPal testing.

Linked PayPal testingAnchorIcon

Link PayPal sandbox to Braintree sandbox and use the Braintree sandbox API credentials to run comprehensive end-to-end tests that include testing transaction reporting and email receipts.

Test integration in Braintree productionAnchorIcon

Set up production environmentAnchorIcon

Important
The Braintree production and sandbox accounts are not linked. You should manually reconfigure all your sandbox configurations, such as processing options and recurring billing settings in the production account. Also, ensure to use the production credentials, such as production merchant ID and API keys, when moving your app to production – these credentials are environment and user-specific.

Create a userAnchorIcon

To ensure business continuity, create a user specifically for your integration. Assign this user a generic email address and the Account Admin role. See Creating users for instructions. 

Retrieve production credentialsAnchorIcon

  1. Log in to the Braintree Production account with the user credentials created for the integration. 
  2. Retrieve your production credentials - specifically production merchant ID, public, and private keys. Read Important Gateway Credentials for more information. 

Synchronize production settings with sandboxAnchorIcon

Your production account is not linked to the sandbox account. Manually configure your production account to ensure that the settings in your production account match those in the sandbox account. 

Update server-side code with live-server configurationAnchorIcon

Update your server-side code with the production credentials to use the production Braintree APIs.

gateway = Braintree::Gateway.new(
:environment => :production,
:merchant_id => "<Enter your merchant_id>",
:public_key => "<Enter your public_key>",
:private_key => "<Enter your private_key>",
)

After you update these values and configure your preferred processing settings, your production environment functions similarly to your sandbox environment. For more information, read Sandbox versus production

Note
When moving your app to production, additional client-side configuration is not required. The client token from your server is sufficient for the client-side code to function.

Test transactions in production environmentAnchorIcon

  1. Create a limited number of low-value sale transactions to test the integration in production. Read Transaction: Sale for more information.
  2. Submit the transactions for settlement and verify that the funds are deposited into your bank account. Deposits are reflected within a few days of settlement.

Note
• Sandbox test values do not work in production. Use real payment methods in production.

• Test with reasonable values and limit the number of transactions, as each test transaction that you settle in the production account debits money from the associated payment method along with applicable fees.