Supported workflows
Before you begin
Complete these steps before you send your first PayPal payment through Braintree:- Set up a Braintree integration in your workspace. Follow the Braintree integration setup guide if you don’t have one yet.
- In the Braintree Control Panel, link your PayPal business account to your Braintree account.
- Add the Payrails domain
api.payrails.ioto the PayPal domain names in Braintree, so that PayPal can return the customer to Payrails. - In your Braintree integration in Payrails, set the Merchant Account ID to the Braintree merchant account in the currency of your PayPal payments. To accept PayPal in more than one currency, create one Braintree integration per merchant account.
- To save PayPal accounts for later payments, ask PayPal to enable billing agreements (reference transactions) on your PayPal account.
- In the Payrails Portal, go to Settings → Integrations, open your Braintree integration, select PayPal under Payment methods, and save.
- Add PayPal as a payment option in your workflow.
Request fields for Braintree
Send these fields in the authorize request, in addition to the standard authorize fields. Required fields must be present for the payment to succeed. Payrails sends Optional fields to the PSP when you include them.Authorize a PayPal payment
Call authorize a payment withpayPal as the paymentMethodCode.
Authorize request
How Braintree handles PayPal
- With instant capture, Payrails charges the payment when the customer returns. With manual capture, Payrails authorizes it, and you capture it later in full or in parts.
- You can refund the full amount or part of it, and cancel an authorized payment.
- When you save the PayPal account, Braintree stores it as a billing agreement and Payrails returns it as a payment instrument. Use it for later subscription or unscheduled payments.
- Braintree doesn’t send payment status webhooks for PayPal, so Payrails gets the result when the customer returns from PayPal.