Express Checkout offers a streamlined checkout flow that keeps customers on your website throughout the payment authorization process and minimizes the number of steps your customers must complete when they check out. It's designed for merchants who don't have a merchant account for processing credit card payments directly.
Customers can select a shipping address and funding instrument when using Express Checkout. Once they authorize the transaction to be processed by PayPal, the checkout window overlay will disappear, and your site will be brought back up to finalize the order.
The Braintree SDKs allow you to accept payments and provide an optimal checkout experience for your customers with one simple developer integration:
- The client SDKs enable you to collect payment method details
- The server SDKs manage all requests to PayPal
Before we get started, there are two key concepts to introduce: the client token and the payment method nonce.
A client token is a signed data blob that includes configuration and authorization information required by the Braintree client SDK. These should not be reused; a new client token should be generated for each request that's sent to Braintree. For security, we will revoke client tokens if they are reused excessively within a short time period.
Your server is responsible for generating the client token, which contains all of the necessary configuration information to set up the client SDKs. When your server provides a client token to your client, it authenticates the application to communicate directly to Braintree.
Your client is responsible for obtaining the client token from your server and initializing the client SDK. If this succeeds, the client will generate a payment method nonce.
Payment method nonce
The payment method nonce is a string returned by the client SDK to represent a payment method. This string is a reference to the customer payment method details that were provided in your payment form and should be sent to your server where it can be used with the server SDKs to create a new transaction request.
How it works
- Your app or web front-end requests a client token from your server in order to initialize the client SDK
- Your server generates and sends a client token back to your client with the server SDK
- Once the client SDK is initialized and the customer has submitted payment information, the SDK communicates that information to Braintree, which returns a payment method nonce
- You then send the payment nonce to your server
- Your server code receives the payment method nonce from your client and then uses the server SDK to create a transaction or perform other Braintree functions.
Your sandbox credentials can be found on your My Apps & Credentials page in your PayPal Developer Dashboard.
To obtain your Braintree sandbox credentials:
- Go to Sandbox Accounts and create a sandbox business test account.
- Go to My Apps & Credentials and generate a Braintree sandbox credential and link it to your PayPal sandbox test account.
- Repeat these steps for each country you want to test in.
Once you're ready to go live, be sure to switch from your sandbox credentials to production.