
If you are looking for a payment platform that supports multiple payment methods for your Magento 2 store, you might want to consider Braintree. Braintree is a subsidiary of PayPal that allows you to accept payments from credit and debit cards, PayPal, Apple Pay, Google Pay, Venmo, and more. Braintree also provides features such as fraud protection, vault storage, and subscription management. In this blog post, we will guide you through the steps to setup Braintree in Magento 2.
Benefits of using Braintree Payment method in Magento 2
By setting up the Braintree payment method for Magento 2, you can enjoy many benefits for your online store and your customers. Some of the benefits are:
- You can accept multiple payment methods with one integration, such as credit and debit cards, PayPal, Apple Pay, Google Pay, Venmo, and more.
- You can offer a seamless and secure checkout experience for your customers, with features such as vault storage, 3D verification, and fraud protection.
- You can manage your transactions and subscriptions easily from your Braintree dashboard, with tools such as reporting, analytics, and webhooks.
- You can customize your payment options and settings according to your business needs and preferences, such as payment action, currency switcher, and country-specific settings.
- You can leverage the support and expertise of Braintree and PayPal, two of the leading payment service providers in the world.
Step 1: Sign up for a Braintree account.
The first thing you need to do to setup Braintree in Magento 2 is to sign up for a Braintree account on their official website. You can choose a free sandbox account for testing purposes or a production account for live transactions. You will need to provide some basic information about your business and verify your identity. Once you have signed up, you will be able to access your dashboard and get your credentials.
Step 2: Configure the Basic Settings of Braintree in Magento 2
To enable Braintree on your Magento 2 store, you need to log in to your admin panel and navigate to Admin>Stores>Configuration. Then, expand the Sales section and click on Payment Methods. If you have multiple stores on Magento, choose the one where you want to setup Braintree in Magento 2. You will see the Recommended Solutions section, where you can click on Configure under Braintree.

In the Basic Settings section, you need to enter the following information:
- Title: This is the name of the payment method that will appear on the checkout page. You can use the default value of “Credit Card (Braintree)” or change it to something else.
- Environment: This is the mode of operation for Braintree transactions. You can choose “Sandbox” for testing purposes or “Production” for live transactions.
- Payment Action: This is the action that will be taken when a customer places an order using Braintree. You can choose “Authorize Only” to approve the purchase and put a hold on the funds until you capture them manually or “Authorize and Capture” to approve the purchase and withdraw the funds immediately from the customer’s account.
- Sandbox Merchant ID: This is the ID of your Braintree account. You can find it in your Braintree dashboard under Settings > Business.

- Sandbox Public Key: This is the public key that identifies your Braintree account. You can find it in your Braintree dashboard under Settings > API.
- Sandbox Private Key: This is the private key that authenticates your Braintree account. You can find it in your Braintree dashboard under Settings > API.
- Enable Card Payments: Set this to “Yes” to activate Braintree Card Payments on your store.
- Enable Vault for Card Payments: Set this to “Yes” if you want to enable vault storage for customer card information. This will allow customers to save their card details for future purchases without having to re-enter them every time.
Step 3: Configure advanced settings
To customize some additional options for Braintree Payment method, you need to expand the Advanced Settings section and enter the following information:

- Vault Title: This is the name of the vault where customer card information is stored securely by Braintree. You can use the default value of “Stored Cards” or change it to something else.
- Merchant Account ID: This is the ID of the merchant account that you want to use for Braintree transactions. You can find it in your Braintree dashboard under Settings > Business.
- Skip Fraud Checks on Admin Orders: Set this to “Yes” if you want to use Braintree’s fraud protection features for all transactions. You need to enable Advanced Fraud Protection in your Braintree dashboard under Settings > Protection first.
- Bypass Fraud Protection Threshold: Enter the bypass fraud protection threshold. Advanced fraud protection checks will be bypassed if this threshold is met or exceeded. Leaving this field blank will disable this option.
- Debug: Set this to “Yes” if you want the system to save a log file of interaction between your store and Braintree. This can help you troubleshoot any issues or errors that may occur.
- CVV Verification: Set this to “Yes” if you want to require customers to enter their card verification value (CVV) before making a payment. This can help prevent fraud and chargebacks.
- Send Cart Line Items: Set this to “Yes” to send the cart line items for all the payment methods.
- Credit Card Types: Specify each credit card that you accept as payment through Braintree. Press and hold
Ctrl(orCommandon Mac) to select a combination of cards. Options:American Express/Visa/MasterCard/Discover/JCB/Diners/Maestro International
- Sort Order: Set the sort order which will determine the order that Braintree is listed with other payment methods during checkout.
Step 4: Configure country-specific settings
To specify which countries are allowed or restricted from using the Braintree Payment method on your store, you need to expand the Country Specific Settings section and enter the following information:

- Payment from Applicable Countries: Choose “All Allowed Countries” if you want to allow customers from all countries that are enabled in your store configuration or “Specific Countries” if you want to select specific countries from the list below.
- Payment from Specific Countries: If you chose “Specific Countries” in the previous option, select the countries that you want to allow from the list. Hold down the Ctrl key (PC) or Command key (Mac) to select multiple countries.
- Country Specific Credit Card Types: Identifies the credit cards that are accepted per country for payments processed by Braintree. A record is saved for each country.
Step 5: Configure 3D verification settings
If you want to use 3D verification for Braintree transactions, you need to enable it in your Braintree dashboard under Settings > Processing first. Then, you need to expand the 3D Verification Settings section and enter the following information:

- Enable 3D Secure Verification: Set this to “Yes” if you want to enable 3D verification for Braintree transactions. This will require customers to verify their identity with their card issuer before making a payment.
- Always request 3DS: Set this to “Yes” if you want to Challenge the 3D Secure request always for all the transactions.
- Threshold Amount: Enter the minimum amount of order total that will trigger 3D verification. For example, if you enter 100, any order below 100 will not require 3D verification, while any order above 100 will require it.
- Verify for Applicable Countries: Choose “All Countries” if you want to apply 3D verification to all countries or “Specific Countries” if you want to select specific countries from the list below.
- Verify for Specific Countries: If you chose “Specific Countries” in the previous option, select the countries that you want to apply 3D verification to from the list. Hold down the Ctrl key (PC) or Command key (Mac) to select multiple countries.
Note:- You need to enable specific payment methods in Braintree to do their setup. Go to the Braintree sandbox site and from the top right corner click on the settings dropdown and go to processing.

Setup PayPal through Braintree in Magento 2
If you want to offer PayPal as a payment option with Braintree in Magento 2, you need to enable it in the basic settings mentioned above. Then, you need to configure some additional options for PayPal in PayPal through the Braintree Settings section. You need to enter the following information:
Note:- Enabling Paypal through Braintree requires linking both Braintree and sandbox Paypal accounts which can be done by going to the Braintree configuration as explained above.

- Enable PayPal through Braintree: Set “Yes” to Enable Paypal through Braintree.
- Enable PayPal Credit through Braintree: Set “Yes” to include Paypal Credit as a payment method through Braintree.
- Enable PayPal Pay Later through Braintree: Set “Yes” to Enable Paypal Pay Later through Braintree.
- Title: This is the name of the payment method that will appear on the checkout page for PayPal. You can use the default value of “PayPal (Braintree)” or change it to something else.
- Vault Enabled: Set “Yes” to provide secure storage for customer payment information, so customers don’t have to re-enter their PayPal information for each purchase
- Sort Order: Enter the sort order which will determine the order in which PayPal through Braintree is listed with other payment methods during checkout.
- Override Merchant Name: Enter an alternate name that can be used to identify the merchant for each store view.
- Payment Action: This is the action that will be taken when a customer places an order using PayPal through Braintree. You can choose “Authorize Only” to approve the purchase and put a hold on the funds until you capture them manually or “Authorize and Capture” to approve the purchase and withdraw the funds immediately from the customer’s account.
- Payment from Applicable Countries: Determines if you accept payments processed by PayPal through Braintree from all countries, or only specific countries.
- Payment from Specific Countries: Select specific countries from which you accept payments processed by Braintree.
- Require Customer’s Billing Address: Set this to “Yes” if you want to require customers to enter their billing address when they check out with PayPal through Braintree.
- Debug: Set this to “Yes” if you want the system to save a log file of interaction between your store and PayPal through Braintree. This can help you troubleshoot any issues or errors that may occur.
- Display on Shopping Cart: Set this to “Yes” if you want to display a PayPal button on the shopping cart page that allows customers to check out with PayPal without going through the checkout process
- Additionally, you can configure the “Styling” section as per requirement.
Setup Google Pay through Braintree in Magento 2
If you want to offer Google Pay as a payment option with Braintree in Magento 2, you need to enable it in the basic settings as mentioned above. Then, you need to configure some additional options for Google Pay in the Google Pay through Braintree Settings section. You need to enter the following information:

- Enable GooglePay through Braintree: Set this to “Yes” if you want to enable Google Pay as a payment option with Braintree.
- Payment Action: This is the action that will be taken when a customer places an order using Google Pay through Braintree. You can choose “Authorize Only” to approve the purchase and put a hold on the funds until you capture them manually or “Authorize and Capture” to approve the purchase and withdraw the funds immediately from the customer’s account.
- Button Color: This is the color of the Google Pay button that will appear on the checkout page. You can choose “Black” or “White”.
- Merchant ID: This is the ID of your Google Pay merchant account. You can find it in your Google Pay dashboard under Settings > Business Profile.
- Accepted Cards: This is the list of card types that you want to accept with Google Pay through Braintree. You can select one or more of the following options: Visa, Mastercard, American Express, Discover, JCB, Diners Club.
- Sort Order: Determines the order that Google Pay is listed with other payment methods during checkout.
Setup Apple Pay through Braintree in Magento 2
If you want to offer Apple Pay as a payment option with Braintree in Magento 2, you need to enable it in the basic settings as mentioned above. Then, you need to configure some additional options for Apple Pay in the Apple Pay through Braintree Settings section. You need to enter the following information:

• Enable ApplePay through Braintree: Set this to “Yes” if you want to enable Apple Pay as a payment option with Braintree.
• Payment Action: This is the action that will be taken when a customer places an order using Apple Pay through Braintree. You can choose “Authorize Only” to approve the purchase and put a hold on the funds until you capture them manually or “Authorize and Capture” to approve the purchase and withdraw the funds immediately from the customer’s account.
• Merchant Name: Enter the label that is displayed to customers in the ApplePay popup.
• Sort Order: Determines the order that Apple Pay is listed with other payment methods during checkout.
Conclusion
That’s all! You have successfully setup Braintree in Magento 2. Now, you can offer your customers a secure and convenient way to pay for their orders using various payment methods. We hope this blog post was helpful and informative. If you have any questions or feedback, please feel free to contact us.






