Braintree
Braintree offers a fully customizable checkout experience with fraud detection and PayPal integration. It supports Apple Pay, Google Pay, ACH, Venmo, and local payment methods. Braintree reduces the PCI compliance burden for merchants because the transaction takes place on the Braintree system. The Braintree Payments integration is developed by .
Step 1: Get your Braintree credentials
Go to and sign up for an account.
Step 2: Complete the basic settings
-
On the Admin sidebar, go to Stores > Settings > Configuration.
-
In the left panel, expand Sales and choose Payment Methods.
-
If your Commerce installation has multiple websites, stores or views, in the upper-left corner, choose the Store View where the configuration applies.
-
In the Merchant Location section, verify that Merchant Country is set to the location of your business.
-
-
Under Recommended Solutions, in the Braintree Payments (by v4.6.1 - section, click Configure.
{width="600" modal="regular"}
-
For Title, enter a title that identifies Braintree as a payment option during checkout.
-
Set the current operating Environment for Braintree transactions to
Sandbox
orProduction
When testing the configuration in a sandbox, use only that are recommended by Braintree. When you are ready to go to production with Braintree, set Environment to
Production
.{width="600" modal="regular"}
-
Set Payment Action to one of the following:
Authorize Only
- Approves the purchase and puts a hold on the funds. The amount is not withdrawn from the customer’s bank account until the sale is captured by the merchant.|Intent Sale
- The amount of the purchase is authorized and immediately withdrawn from the customer’s account. Note: This value was Authorize and Capture in 2.3.x and earlier releases.|
-
Enter the Sandbox Merchant ID / Merchant ID from your Braintree account.
-
Enter the following credentials from your Braintree account:
- Sandbox Public Key / Public Key
- Sandbox Private Key / Private Key
note note NOTE There are separate fields for both (Sandbox and Production) environments, and the other fields render based on which environment is selected. -
Before saving the configuration, click Validate Credentials to validate your credentials.
-
Set Enable Card Payments to
Yes
.{width="600" modal="regular"}
If you want the ability to store customer information securely, so customers don’t have to re-enter it each time they make a purchase, set Enable Vault for Card Payments to
Yes
.
Step 3: Complete the advanced settings
-
Expand the Advanced Braintree Settings section.
{width="550" modal="regular"}
-
For Vault Title, enter a descriptive title for your reference that identifies the vault where your customer card information is stored.
-
Enter the Merchant Account ID from your Braintree account.
If you don’t specify the merchant account to be used, Braintree processes the transaction using your default merchant account.
-
To provide a faster checkout experience with Express Payment options at the beginning of the checkout process, including PayPal, PayLater, Apple Pay, and Google Pay, set Enable Checkout Express Payments to
Yes
. -
If you want to prevent the transaction from being sent for evaluation as part of Advanced Fraud Tools checks, on orders placed through the Admin, set Skip Fraud Checks on Admin Orders to
Yes
. -
Set the Bypass Fraud Protection Threshold so that the
Advanced Fraud Protection
checks are bypassed when the threshold is met or exceeded.Leaving this field blank disables this option.
-
If you want the system to save a log file of interactions between your store and Braintree, set Debug to
Yes
. -
To require customers to provide the three-digit security code from the back of a credit card, set CVV Verification to
Yes
.If using CVVÂ verification, make sure to enable AVS and/or CVV in the Settings/Processing section of your Braintree account.
-
To send the cart line items for all the payment methods, set Send Card Line Items to
Yes
. -
For Credit Card Types, select each credit card that is accepted by your store as payment through Braintree.
To select multiple card types, hold down the Ctrl key (PC) or the Command key (Mac) and click each option.
-
For Sort Order, enter a number to determine the sequence in which Braintree appears when listed with other payment methods during checkout.
Step 4: Complete the Braintree webhook settings
{width="600" modal="regular"}
-
Set Enable Webhook to
Yes
to enable the webhook functionality for fraud protection, ACH payments, and local payment methods. -
Copy the URL in the Fraud Protection URL field and add it to your Braintree account as the Webhook Destination URL.
note important IMPORTANT This URL must be secure and publicly accessible. -
Set the Fraud Protection Approve Order Status field to determine when fraud protection is approved by Braintree.
The selected order status is assigned to the Commerce order.
-
Set the Fraud Protection Reject Order Status field to determine when fraud protection is rejected by Braintree.
The selected order status is assigned to the Commerce order.
Step 5: Complete the country-specific settings
-
Set Payment from Applicable Countries to one of the following:
All Allowed Countries
- Customers from all countries specified in your store configuration can use this payment method.Specific Countries
- After choosing this option, the Payment from Specific Countries list appears. Hold down the Ctrl key (PC) or the Command key (Mac) and select each country in the list where customers can make purchases from your store.
{width="600" modal="regular"}
-
To set up Country Specific Credit Card Types:
-
Click Add.
-
Set the Country and choose each Allowed Credit Card Type.
-
Repeat to identify the credit cards that are accepted from each country.
-
Step 6: Complete the ACH through Braintree settings
{width="600" modal="regular"}
-
To include ACH as a payment option with Braintree, set Enable ACH Direct Debit to
Yes
. -
Customers can vault their single-use ACH Direct Debit payment method and store it for future use. Once vaulted, customers can reuse ACH Direct Debit without needing to re-enter or authenticate their payment information if set Enable Vault for ACH Direct Debit to
Yes
. -
For Sort Order, enter a number to determine the sequence in which the Braintree ACH payment option appears when listed with other payment options during the checkout.
Step 7: Complete the Apple Pay through Braintree settings
{width="600" modal="regular"}
-
To include Apple Pay as a payment option with Braintree, set Enable ApplePay through Braintree to
Yes
.Make sure to in your Braintree account first.
-
If you want the ability to store customer information securely, so customers don’t have to re-enter it each time they make a purchase with Apple Pay, set Enable Vault for ApplePay to
Yes
. -
Set Payment Action to one of the following:
Authorize Only
- Approves the purchase and puts a hold on the funds. The amount is not withdrawn from the customer’s bank account until the sale is captured by the merchant.Intent Sale
- The amount of the purchase is authorized and immediately withdrawn from the customer’s account.
-
For Merchant Name, enter text that specifies the label that is displayed to customers in the Apple Pay dialog.
-
For Sort Order, enter a number to determine the sequence in which Apple Pay payment option appears when listed with other payment options during the checkout.
Step 8: Complete the settings for local payment methods
-
To include local payment methods as a payment option with Braintree, set Enable Local Payment Methods to
Yes
. -
For Title, enter the text to use for the label that appears on the checkout payment method section (default value:
Local Payments
). -
For Fallback Button Text, enter the text to use for the button that appears on the fallback Braintree page to take the customer back to the website (for example,
Complete Checkout
). -
For Redirect on Fail, enter the URL where customers should be redirected when local payment method transactions are cancelled, fail, or encounter errors. It should be the checkout payment page (for example,
https://www.domain.com/checkout#payment
). -
For Allowed Payment Methods, select the local payment method to be enabled.
Options:
Bancontact
/EPS
/giropay
/iDeal
/Klarna Pay Now
/SOFORT
/MyBank
/P24
/SEPA/ELV Direct Debit
(not yet supported){width="600" modal="regular"}
note note NOTE The bundled Braintree extension does not support all the local payment methods listed in the . Other local payment methods are under development to be supported in future releases. -
For Sort Order, enter a number to determine the sequence in which local payment method appears when listed with other payment options during the checkout.
Step 9: Complete the Google Pay through Braintree settings
{width="600" modal="regular"}
-
To include Google Pay as a payment option with Braintree, set Enable GooglePay Through Braintree to
Yes
. -
If you want the ability to store customer information securely, so customers don’t have to re-enter it each time they make a purchase with Google Pay, set Enable Vault for GooglePay to
Yes
. -
Set Payment Action to one of the following:
Authorize Only
- Approves the purchase and puts a hold on the funds. The amount is not withdrawn from the customer’s bank account until the sale is captured by the merchant.Intent Sale
- The amount of the purchase is authorized and immediately withdrawn from the customer’s account.
-
Set Button Color to determine the color of the Google Pay button:
White
orBlack
-
For Merchant ID, enter your MerchantID (provided by Google).
-
For Accepted Cards, select the type of cards that a customer can use to place an order using Google Pay.
Options:
Visa
/MasterCard
/AMEX
/Discover
/JCB
-
For Sort Order, enter a number to determine the sequence in which Google Pay appears when listed with other payment options during the checkout.
Step 10: Complete the Venmo through Braintree settings
-
To include Venmo as a payment option with Braintree, set Enable Venmo through Braintree to
Yes
. -
Set Enable Vault for Venmo to
Yes
to enable use of a secure vault to store customers’ Venmo account so customer don’t need to log in to their Venmo account again for future transactions.{width="600" modal="regular"}
-
Set Payment Action to one of the following:
Authorize Only
- Approves the purchase and puts a hold on the funds. The amount is not withdrawn from the customer’s bank account until the sale is captured by the merchant.Intent Sale
- The amount of the purchase is authorized and immediately withdrawn from the customer’s account.
-
For Sort Order, enter a number to determine the sequence in which Venmo appears when listed with other payment options during the checkout.
Step 11: Complete the PayPal through Braintree settings
{width="550" modal="regular"}
-
To include PayPal as a payment option with Braintree, set Enable PayPal through Braintree to
Yes
. -
Specify your PayPal through Braintree payment method:
note note NOTE Either PayPal Credit or PayPal PayLater can be enabled. Both methods cannot be enabled at the same. -
To include PayPal Credit as a payment option with Braintree, set Enable PayPal Credit through Braintree to
Yes
.When Enable PayPal through Braintree is set to
Yes
, only this field appears.note note NOTE PayPal Credit is only available in the United States and United Kingdom. PayPal Credit is disabled if the selected value for the Merchant Country field is not US
orUK
. -
To include PayPal PayLater as a payment option with Braintree, set Enable PayPal PayLater through Braintree to
Yes
.When Enable PayPal PayLater through Braintree is set to
Yes
, only this field appears.You can display PayLater messaging on your site for offers, such as Pay in 3, which lets customers pay with three interest-free monthly payments. The Braintree integration can display messages on your site to promote this feature. You cannot promote PayLater offers with any other content, marketing, or materials.
-
-
For Title, enter a title that identifies the Braintree payment by PayPal option during checkout.
-
Set Vault Enabled to
Yes
to enable use of a secure vault to store customers’ PayPal account. Vaulted PayPal account can be used for future transactions, which reduces the number of steps for customers. -
Set Send Cart Line Items for PayPal to
Yes
to send the line items (order items) to PayPal along with Gift Cards, Gift Wrapping for items, Gift Wrapping for order, Store Credit, Shipping, and Tax as line items. -
For Sort Order, enter a number to determine the sequence in which the Braintree PayPal payment option appears when listed with other payment options during checkout.
-
To display your merchant name differently than what is defined in your store configuration, enter the name in the Override Merchant Name field as you want it to appear.
-
Set Payment Action to one of the following:
Authorize Only
- Approves the purchase and puts a hold on the funds. The amount is not withdrawn from the customer’s bank account until the sale is captured by the merchant.Authorize and Capture
- The amount of the purchase is authorized and immediately withdrawn from the customer’s account.
-
Set Payment from Applicable Countries to one of the following for Braintree transactions processed by PayPal:
All Allowed Countries
- Customers from all countries specified in your store configuration can use this payment method.Specific Countries
- After choosing this option, the Payment from Specific Countries list appears. Hold down the Ctrl key (PC) or the Command key (Mac) and select each country in the list where customers can make purchases from your store.
-
To require customers to provide a billing address, set Require Customer’s Billing Address to
Yes
.note note NOTE This feature must be enabled for your account by PayPal Technical Support. -
To save a log file of interactions between your store and PayPal through Braintree, set Debug to
Yes
. -
To display the PayPal button on both the mini cart and shopping cart page, set Display on Shopping Cart to
Yes
.
Step 12: Set the styling settings
-
For Location, choose where PayPal buttons and messages are rendered:
Mini-Cart and Cart Page
,Checkout Page
, orProduct Page
{width="600" modal="regular"}
Mini-Cart and Cart Page
The options and settings in this section vary according to the setting in the Location field.
- Set PayPal Button Type to one of three types of buttons:
PayPal Button
/PayPal Pay Later Button
/PayPal Credit Button
PayPal Button
The options and settings in this section vary according to the button type selected in the PayPal Button Type field.
-
To show the PayPal button on the storefront at the selected location, set Show PayPal Button to
Yes
. -
For Button Label, select the PayPal button label:
Paypal
,Checkout
,Buynow
, orPay
-
For Color, select the PayPal button color:
Blue
,Black
,Gold
, orSilver
-
For Shape, select the PayPal button shape:
Pill
orRectangle
-
For Size (Deprecated), select the PayPal button size:
Medium
,Large
, orResponsive
PayLater Messaging
-
To show PayLater messaging on the storefront at the selected location, set Show PayLater Messaging to
Yes
.This messaging includes the display of PayLater messaging for available offers ().
-
For Message Layout, select the PayLater message layout:
Text
orFlex
-
For Logo, select the PayPal logo type:
Inline
,Primary
,Alternative
, orNone
-
For Logo Position, select the PayPal logo position:
Left
,Right
, orTop
-
For Text Color, select the PayLater message text color:
Black
,White
,Monochrome
, orGrayscale
When these options are set, you can see the preview of the PayPal buttons and PayLater messages. There are controls that you can use to apply the settings or reset the values:
-
To store the selected styling settings for buttons and PayLater messaging and apply them to the current location and current button type, click Apply.
-
to store the selected styling settings for buttons and PayLater messaging values and apply them to all button types and locations, click Apply to All Buttons.
-
To return styling settings to the recommended default values for buttons and PayLater messaging and apply them to all button types and locations, click Reset to Recommended Defaults.
Step 13: Complete the 3D verification settings
-
If you want to add a verification step for customers using credit cards that are enrolled in a verification program (such as Verified by VISA), set 3D Secure Verification to
Yes
.During the process, the transaction amount that is submitted for verification is checked against the amount that is sent for authorization.
-
To always challenge the 3D Secure request for all transactions, set Always request 3DS to
Yes
. -
For Threshold Amount, enter the minimum order amount that is required to trigger 3D verification.
-
Set Verify for Applicable Countries to one of the following:
All Allowed Countries
- Customers from all countries specified in your store configuration can use this payment method.Specific Countries
- After choosing this option, the Verify for Specific Countries list appears. Hold down the Ctrl key (PC) or the Command key (Mac) and select each country in the list where customers can make purchases from your store.
{width="600" modal="regular"}
Step 14: Set up the Braintree dynamic descriptors
The following descriptors are used to identify purchases on customer credit card statements. You can reduce the number of charge-backs by clearly identifying the company that is associated with each purchase. If dynamic descriptors are not enabled for your account, contact Braintree support.
{width="600" modal="regular"}
-
Enter the dynamic descriptor for the Name, Phone, and URL according to these guidelines:
-
Name - There are two parts to the name descriptor, which are separated by an asterisk (*). For example:
company*myproduct
The first part of the descriptor identifies the company or DBA, and the second part identifies the product. The length of the
company
andproduct
parts of the descriptor can be allocated in the following ways, for a combined length of up to 22 characters.Characters in name descriptor
Option 1:
Company
must be three characters,Product
may be up to 18 charactersOption 2:
Company
must be seven characters,Product
may be up to 14 charactersOption 3:
Company
must be 12 characters,Product
may be up to nine characters -
Phone - The phone descriptor must be 10 – 14 characters in length, and can include only numbers, dashes, parentheses, and periods. For example:
9999999999
(999) 999-9999
999.999.9999
-
URL - The URL descriptor represents your domain name, and can be up to 13 characters long. For example:
company.com
-
-
When your Braintree configuration is complete, click Save Config.
2.4 upgrade notes
Beginning with ÃÛ¶¹ÊÓƵ Commerce and Magento Open Source 2.4.0, the Braintree extension is included in the release. If you are migrating to Commerce 2.4.x from a pre-2.4.0 version that has the Marketplace Braintree extension installed, you must uninstall that extension (paypal/module-braintree
or gene/module-braintree
) and update any code customizations to use the PayPal_Braintree
namespace instead of Magento_Braintree
. Configuration settings from the core Commerce Braintree Payments bundled extension and the extension distributed on Commerce Marketplace persist and payments placed with those previous versions can still be captured, voided, or refunded as normal.