PayPal
Testing and go live
Test integration in Braintree sandbox
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 testing
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.
Limitation
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 testing
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 production
Set up production environment
Create a user
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 credentials
- Log in to the Braintree Production account with the user credentials created for the integration.
- Retrieve your production credentials - specifically production merchant ID, public, and private keys. Read Important Gateway Credentials for more information.
Synchronize production settings with sandbox
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 configuration
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.
Test transactions in production environment
- Create a limited number of low-value sale transactions to test the integration in production. Read Transaction: Sale for more information.
- 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.
• 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.