broadleaf:
cartoperation:
service:
checkout:
checkout-payment-method-options:
- payment-method-type: PAYPAL
payment-method-gateway-type: BRAINTREE
Braintree supports the ability to use PayPal as a digital wallet, while processing transactions via Braintree.
In short, via the Braintree Drop-in UI, we’re able to gather a nonce representing one of the customer’s payment methods that is stored via PayPal. Once we’ve obtained this nonce, all transaction interactions mimic what’s done for any other nonce that we might obtain from the Drop-in UI.
To enable PayPal with Braintree’s Drop-in UI, you must first enable it via the Braintree dashboard.
To test this integration, you will need to link you PayPal sandbox account to your Braintree sandbox account.
Log into your Braintree sandbox Control Panel
Navigate to Settings > Processing > 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
Add the following properties to declare PayPal processed via BRAINTREE
as an available payment method option in checkout.
broadleaf:
cartoperation:
service:
checkout:
checkout-payment-method-options:
- payment-method-type: PAYPAL
payment-method-gateway-type: BRAINTREE
If you have PayPal configured in your dashboard, include the PayPal configuration object in your Drop-in create call to render PayPal as an available payment option.
Drop-in UI supports several styles of PayPal interactions. The following example uses the checkout
flow:
braintree.dropin.create({
...
paypal: {
flow: 'checkout',
amount: '10.00',
currency: 'USD'
}
});
Call requestPaymentMethod to get a PayPal payment method payload, which includes a payment method nonce to send to your server at payload.nonce.