Local Payment Methods
Testing and Go Live
You can test your Local Payment Methods integration in the Braintree sandbox environment in 2 ways:
- Mocked Local Payment Method testing (default)
- Behaves similarly to production but does not allow for end-to-end testing
- Uses Braintree sandbox test values to simulate PayPal responses in your Braintree sandbox
- Allows you to confirm that your client- and server-side configurations are correct and that you are receiving appropriate responses for your requests
- Does not return data to your PayPal sandbox account
- Does not work with the PayPal Checkout component of the JavaScript v3 SDK
- Local Payment Method testing with linked PayPal account
- Requires additional setup
- Directly connects your Braintree sandbox account to your PayPal sandbox account
- Returns data to both sandbox accounts
- Allows you to test the full functionality of your Local Payment Methods integration (e.g. transaction reporting, email receipts)
Mocked Local Payment Method testing
Use your Braintree sandbox API credentials and the test values on our Testing page to ensure your client and server integrations with Braintree are working as expected.
Any testing you do in the mocked Local Payment Method flow will only be reflected in your Braintree sandbox – no data will be sent to your PayPal sandbox. If you'd like to do complete end-to-end testing, see Local Payment Method testing with linked PayPal account.
Local Payment Method testing with linked PayPal account
In order to link a PayPal sandbox test account to your Braintree sandbox account, you will need the API credentials for that PayPal sandbox test account.
If you don't already have a PayPal sandbox test account for testing your Braintree integration, create a new one by following these steps:
- Create a PayPal business sandbox account:
- Log into the PayPal Developer Dashboard
- Navigate to Sandbox > Accounts
- Click Create Account
- Select the same Country as your Braintree sandbox account
- Select the account type as Business
- Go to the Create New App page
- Create an app to get sandbox API credentials
- Select the same sandbox developer account as the test account created in step 1
- Note the following Sandbox API Credentials for the new app you created:
- Email address associated with this app
- Client ID
- Secret
Once you have those PayPal sandbox API credentials, enter them in your Braintree sandbox:
- Log into your Braintree sandbox Control Panel
- Navigate to Settings > Account Settings > Payment Methods > PayPal
- Click Link Sandbox
- Enter the Email address, Client ID, and Client Secret for your PayPal sandbox test account
- Click Link PayPal Sandbox
Go live
Create an API user
Production API credentials, including your API keys, must be entered into your server-side code to connect API calls to the Braintree gateway. While each user in your gateway has their own unique set of API keys, only one set can be included in your integration.
We do not recommend including an individual user's API credentials. If you ever need to delete or suspend that user, this could break your connection to Braintree and result in failed transactions.
Instead, create a new user specifically designated as the API user, whose API keys can be used for your integration. This user should be set up with an email address that is not associated with a single employee and should have Account Admin permissions in order to avoid issues such as an authorization error.
Get production credentials
Log into your production account as the API user to obtain your API credentials. You'll need the:
- Production merchant ID
- Production public key
- Production private key
Keep in mind that public and private keys are both environment- and user-specific.
Update production account settings
Make sure your production account settings mirror the ones in your tested sandbox configuration. Be sure to recreate any recurring billing plans or settings if you plan to use recurring billing in production.
Update live server configuration
In your server code, update your configuration to production values:
- Ruby
gateway = Braintree::Gateway.new(
:environment => :production,
:merchant_id => "use_your_merchant_id",
:public_key => "use_your_public_key",
:private_key => "use_your_private_key",
)
Once you have updated these values and configured your preferred processing settings, the live production environment will function similarly to the sandbox environment you've been using for development. Learn more about the differences between production and the sandbox.
On the client side, no configuration updates are needed when you make the switch to production – your client obtains its client token from your server, which is all the configuration it needs.
Test transactions in production
It is important to test your production account by creating a couple of low-value sale transactions for each of the payment method types you plan to accept. Be sure to submit the transactions for settlement, and then confirm that the funds have deposited into your bank account. This typically happens a few days after they have settled.