PayPal

Overview

You can use the Braintree-GraphQL APIs alone and integrate PayPal as a payment method to accept payments from your customer's PayPal account. The integration uses APIs to gather payment information and process the payments.

Gather payment informationAnchorIcon

Render a checkout page that helps buyers to complete either of the following:

  • Log into their PayPal account and complete the transaction
  • Continue the checkout from your website

On payment approval, Braintree generates and sends a single-use payment token to the merchant server. The token represents the payment information, and the server can use the payment token to process payments.

Process paymentsAnchorIcon

Using the APIs-only integration pattern in this guide, you can implement the following payment flows:

  1. One-time Payments: To process an immediate payment without saving the payment method for future use. 
  2. Checkout with Vault: To process an immediate payment and save the payment method securely for future transactions. 
  3. Vaulted Payments: To save the payment method securely without processing an immediate payment. 

Set up sandbox environmentsAnchorIcon

You can configure sandbox environments to test integrations securely. For information on Mocked and Linked PayPal tests, see Testing and Go Live.

Create Braintree sandbox accountAnchorIcon

Use the instructions in Create a sandbox account to set up your Braintree sandbox environment. 

Create PayPal sandbox accountAnchorIcon

Set up a PayPal sandbox account that enables linking Braintree and PayPal for thorough end-to-end testing. 

To create a PayPal sandbox account, 

  1. Log in to your PayPal Developer Dashboard
  2. Navigate to Testing Tools > Sandbox Accounts.
  3. Select Create account.
  4. Select Business as the account type. 
  5. Use the dropdown menu to select the same country as your Braintree sandbox account. 
  6. Select Create Account.

Retrieve PayPal sandbox API credentialsAnchorIcon

  1. From the API Credentials page, select Create app.
  2. Enter a name for the application in the App Name field. 
  3. Select a type. 
  4. Select the sandbox developer account you created earlier from the dropdown menu.
  5. Select Create App.
  6. After successful app creation, go to API credentials and retrieve the
    • Client ID
    • Secret key 1
  7. Go to Sandbox account info and retrieve the email address.
  1. Log in to the Braintree Sandbox account
  2. Select the gear icon > Account Settings Payment Methods PayPal.
  3. Select Link Sandbox.
  4. On the PayPal Sandbox Credentials page, enter the PayPal sandbox API credentials. 
  5. Select Link PayPal Sandbox.

Test and go liveAnchorIcon

For information on how to test your integration and move your app to production, see Testing and Go Live.