Magento Open Source Braintree integration

How to enable and test the bundled Braintree extension in a self-hosted Magento Open Source store, which payment methods to switch on, and how hosted fields limit card data on your servers.

On this page

How the bundled Braintree extension connects Magento Open Source to Braintree

A self-hosted Magento Open Source store that needs cards, wallets and alternative methods in one checkout can connect to Braintree through the Braintree extension bundled with Magento Open Source, not through custom payment code. That choice keeps the payment logic inside a maintained module that Adobe ships with the platform. The extension handles the payment service work: authorization, capture, refunds, vaulting of saved payment methods and the wallet options your Braintree account enables, such as PayPal, Apple Pay, Google Pay and Venmo. The store keeps ownership of the order record, customer accounts, tax calculation, shipping and fulfillment, and it passes the payment result back into the order workflow.

Before you plan the build, confirm three things in your own environment, because no Braintree-specific extension version, connector behavior or account feature set has been verified for this page. First, check which Braintree extension version ships with the Magento Open Source release you plan to run, and whether that version is listed in the Adobe Commerce system requirements for your PHP, database and search stack. Second, ask Braintree which methods your merchant account, region and currency actually support, including ACH and local payment methods, since availability varies by account. Third, confirm with Braintree whether the sandbox account you test against mirrors the production features you plan to enable.

Write these answers into the project scope before configuration starts. Each open question changes the build: a wallet that is not enabled on the account will fail at checkout tests, and a version gap found late means a version pin or an upgrade task that the schedule must absorb. Record who owns the Braintree account, who can change its settings and who receives its dispute and settlement reports, because those responsibilities sit outside Magento and will still matter after launch.

What a Braintree build needs before configuration starts

Most Braintree problems in a Magento Open Source store trace back to decisions made before anyone opens the admin panel. The cards below cover the platform versions, the payment account, the HTTPS setup and the account ownership decisions that have to be settled first.

Supported Magento release line

Start by confirming which 2.4.x line the store runs, since the PHP, database, search, cache, queue, Composer and nginx versions are tied to it. As examples, Adobe's 2.4.9 requirements list PHP 8.5, MySQL 8.4 or MariaDB 12.3 (recommended) or 11.8, OpenSearch 3, Redis or Valkey 9, RabbitMQ 4.3, Composer 2.10 and nginx 1.30, while 2.4.8-p5 lists PHP 8.4 or 8.3 and Varnish 8. Match the exact line in use, because Adobe supports only the listed combinations.

System requirements

Extension compatibility confirmation

Before installing the Braintree extension, confirm in its documentation that it supports your exact Magento release and PHP version. Record the extension version that matches the release, and check whether a newer Magento patch changes what it requires. Treat this check as a gate, since a mismatched extension can block upgrades later.

Braintree merchant account

Open a Braintree merchant account and request separate sandbox and production credentials. Sandbox keys let your team test checkout, refunds and 3D Secure without moving real money, while production keys must stay in a secure secrets store. Ask Braintree which features, including PayPal, Venmo, Apple Pay, Google Pay, ACH and local methods, are enabled for your merchant ID before you plan the checkout design.

HTTPS on storefront and admin

Serve both the storefront and the admin over HTTPS with valid certificates before testing payments. Wallet payments such as Apple Pay and Google Pay and the hosted fields depend on secure origins, and mixed content will break checkout in ways that look like extension faults. Plan certificate renewal and confirm that the base URLs in the store configuration use the https scheme.

Account owner role decision

Decide who holds the Braintree account owner role and who holds administrative or limited user roles. The owner can change credentials, payment methods and settlement settings, so separating that role from the developers who build the integration limits the impact of a compromised account. Document the approval path for adding users and rotating keys, and confirm with Braintree how user roles are assigned within your merchant account.

Hosting and card data scope

Agree with your security and compliance team where card data will be handled and which PCI DSS scope the design creates. Hosted fields keep card numbers inside Braintree's frames, which reduces what your servers touch, but your team still owns the surrounding pages and configuration. Record this decision early, since it shapes the evidence you will need during an assessment.

How to configure Braintree in the right order

This sequence brings the bundled Braintree extension live in a predictable order, so each payment method is proven in sandbox before the next one is added. Each step ends with a check you can record, and the production switch happens only after the full flow has reconciled.

  1. Confirm the Magento release and install state

    Your platform engineer confirms the installed Magento Open Source release and its PHP, database, search, cache and queue versions against Adobe's system requirements for that exact release, because Adobe supports only the listed combinations. They then confirm the Braintree module is enabled, caches are flushed, and the storefront and admin both load over HTTPS. Done when the Braintree section appears in the payment configuration without errors and a test product page loads on the storefront.

  2. Create sandbox credentials in Braintree

    A Braintree account administrator creates or opens the sandbox account and generates the API credentials the extension needs, including the merchant ID and the public and private keys. Limit who can view the private key, and store it in your secrets manager rather than in a configuration file, ticket or chat thread. Done when the credentials are stored in your approved vault and the administrator has confirmed which Braintree user holds access.

  3. Enter sandbox credentials and place a test order

    The Magento administrator sets the Braintree environment to sandbox and enters the sandbox credentials at the scope that matches the store view being tested. Keep production credentials out of this scope entirely. Place a test order with a Braintree test card and confirm the order appears in Magento and the matching transaction appears in the Braintree sandbox control panel. Done when both records match on amount, currency and transaction reference.

  4. Enable card payments with hosted fields

    Enable the card method first, so the card fields are rendered by Braintree's hosted fields. Card numbers are entered into fields that Braintree serves, and Magento receives a payment token rather than the card number, which keeps card data off your web servers and narrows your PCI DSS scope. Test an authorization and an invoice, then issue a refund from Magento. Done when the refund appears in the Braintree sandbox control panel with the expected status.

  5. Add vaulting and 3D Secure in sandbox

    Turn on vaulting so returning customers can reuse saved cards, then enable 3D Secure using the options your Braintree account supports. Confirm with Braintree which 3D Secure settings apply to your merchant account and which regions require them. Check vaulting by completing a purchase as a customer, then placing a second order as the same customer and confirming the saved card appears. Check 3D Secure by using a sandbox test card that triggers a challenge. Done when both checks pass and the challenge completes.

  6. Enable PayPal and digital wallets

    Enable PayPal, Apple Pay, Google Pay and Venmo only for the wallets your Braintree account has been approved to accept. Each wallet can carry its own onboarding, domain or eligibility requirements, so confirm them with Braintree before you go live. Run a sandbox order through each enabled wallet on a supported browser or device, and confirm that each transaction appears in the Braintree control panel with the correct wallet type. Done when every enabled wallet has one completed test order and one tested refund.

  7. Enable ACH and local methods where supported

    Enable ACH and local payment methods only where your Braintree account confirms eligibility for the countries and currencies you sell in. These methods often have different authorization, settlement, refund and dispute flows from cards, so ask Braintree to document each one for your account. Test each method in sandbox, then test a refund and confirm that the status in Magento and Braintree agree. Done when each method has a documented test result and the Braintree account owner has signed off on the flow.

  8. Switch to production credentials

    Replace the sandbox environment with production credentials in the Braintree configuration, and remove any sandbox values left in the store. Place one low-value live order using a card you control, confirm that it reconciles in Magento and the production Braintree control panel, then refund it and confirm the refund reconciles too. Restrict administrator access to the payment configuration and record the final settings in your change log. Done when the live test order and refund match in both systems.

Which Braintree payment methods to enable, and what each one changes

Card acceptance is the baseline method for most Magento Open Source stores. With hosted fields, the card number and security code are entered into fields served by Braintree rather than into your page markup, which is the main reason card data stays off your servers and keeps your cardholder data environment smaller. Vaulting stores a token so returning shoppers and saved cards can be charged without re-entering details, and 3D Secure adds a shopper authentication step that can shift liability for some fraudulent transactions, depending on the card network and region.

  • Braintree account: Confirm that card processing, vault and 3D Secure are enabled for your merchant account and that your card brands and currencies match what you plan to sell.
  • Store configuration: Set vaulting and 3D Secure options in the Braintree section of the admin, and decide when a challenge is triggered, since rules you set can add friction for shoppers.
  • Shopper experience: A challenge may appear as a bank or issuer prompt inside the checkout, so review the flow on mobile and in the stored-card path.
  • Test cases: Run successful, declined and challenged cards from Braintree's sandbox test data, plus a saved-card purchase and a card removal from the account page.
  • Operations: Check that vault tokens are not written to logs and that refunds and voids from the admin behave as your finance team expects.

Confirm card brands, 3D Secure support and liability rules with Braintree for each country and currency you plan to sell in, because they are not determined by the Magento configuration screen.

Why hosted fields keep card data off your servers, and what PCI DSS still requires

Hosted fields keep the card number out of your store's request path. With Braintree hosted fields, the card inputs are rendered from Braintree's domain inside your checkout page, so the card number is sent directly to Braintree rather than posted through your Magento Open Source server. That shrinks the cardholder data environment (CDE) because your web tier, application logs and database never receive the primary account number in the normal flow. The payment token returned by Braintree is what your store stores or passes on, and vaulting in the Braintree extension works from that token. Confirm in your own build that no custom checkout template, observer or logging extension reads the card fields before they reach Braintree, because one such change puts card data back into your scope.

Hosted fields do not remove your PCI DSS obligations. Your store still serves the payment page, loads its JavaScript, runs the admin where the payment settings live, and hosts the server that handles tokens and order data. PCI DSS v4.0.1 is the only active version of the standard, so assessments should be planned against it. The PCI Security Standards Council owns the standard but does not enforce compliance or impose penalties; the individual payment brands decide which entities must validate and run any enforcement. Assessments are documented either as a Report on Compliance completed by a Qualified Security Assessor or as a Self-Assessment Questionnaire, each backed by an Attestation of Compliance. A certificate alone is not accepted as validation.

The payment page is where scope pressure is highest. From Magento Open Source 2.4.7, Content Security Policy runs in restrict mode by default on storefront and admin payment pages, so your Braintree script sources, frame sources and any custom scripts must be declared before go-live or checkout will fail. Ask your qualified assessor which SAQ type fits your payment flows, whether the Braintree setup places you in a scope that matches it, and how the admin and the payment-page scripts are covered. Their answer, not this page, sets your scope and SAQ type.

Which Magento and Braintree records must match

This table pairs each Magento record with its counterpart in Braintree and shows which identifier links the two. Read it as a reconciliation checklist: if a link breaks, the store and the payment processor will disagree about what was paid, refunded or stored. Ownership is split, so agree on it before go-live.

RecordBraintree counterpartLinking identifierData owner
Order and invoiceThe transaction created when the store authorizes or captures paymentThe transaction identifier saved on the Magento order payment recordMagento owns the order; Braintree owns the transaction state
Capture or refundThe settlement or refund recorded against that transactionThe transaction identifier plus the credit memo or invoice referenceMagento records the action; Braintree records funds movement
Customer accountA Braintree customer record holding vaulted payment methodsThe customer identifier the extension sends to Braintree (confirm the field in the extension documentation)Magento owns the customer; Braintree stores the vaulted instrument
Saved card or walletA vaulted payment method token tied to the Braintree customerThe payment method token saved against the Magento customerBraintree holds card data; Magento holds only the token reference
Order statusThe transaction state such as authorized, submitted for settlement or settledStatus mapping configured in the extension, checked against the transaction IDShared: the store sets display status, Braintree sets the true state
3D Secure outcomeAuthentication result attached to the transactionThe transaction identifier and the authentication result on the orderBraintree owns the result; Magento should only store the outcome
Test and live recordsSandbox and production merchant accounts kept fully separateEnvironment setting and separate credentials per store environmentYour team owns the credentials and environment mapping

Security settings to lock down for this integration

The Braintree extension moves card capture to hosted fields, but the store still holds the credentials, admin roles and page policies that decide who can move money and what a compromised admin account can do. The cards below cover the settings to lock down before go-live and what to confirm in your environment.

Separate sandbox and production credentials

Keep sandbox and production Braintree API credentials in separate sets and never let a test credential reach the live store. Create restricted Braintree user roles so that the people and services that configure the store can only do what their job needs, for example without rights to issue refunds or export vault data. Confirm which Braintree users hold full account access, who can generate new keys, and whether production keys have been used in any non-production environment. Losing a live key exposes the merchant account directly, so one shared administrator login is the first thing to remove.

CSP documentation

Store API keys outside the database

Braintree private keys and merchant identifiers should live in environment configuration rather than in the core config table, where they are readable by anyone with database access and appear in backups and exports. Confirm with your Magento deployment method which environment file or secret store your team uses, that file permissions restrict reads to the web and deploy users, and that database dumps used for staging do not carry live values. Check that key rotation is documented and that the team knows where each key is referenced, including the CI pipeline and any integration jobs.

Admin access and two-factor authentication

Anyone who can change payment settings can redirect funds, switch to a test gateway, or enable a payment method that bypasses your intended controls. Restrict the Magento admin role for payment configuration to a small named group, require two-factor authentication for every account in that group, and review that list on a fixed schedule. Confirm that the admin URL is not publicly guessable, that sessions time out, and that former staff accounts are disabled. The Braintree dashboard login should use the same protections as the store admin.

Content Security Policy on payment pages

Payment pages load scripts from the payment provider, so a Content Security Policy limits which script sources a browser will run on checkout. Magento Open Source supports CSP headers from 2.3.5, and from 2.4.7 the policy runs in restrict mode by default on storefront and admin payment pages. Confirm that your policy allows the Braintree and PayPal script domains you actually use, that no inline or third-party script was added to checkout by another extension, and that the policy is tested in report mode before enforcement. A policy that is too loose defeats the purpose of hosted fields.

CSP documentation

Logging and review of refunds

Refunds, voids, manual transactions and changes to vault records are the actions a fraudster or careless user is most likely to take after gaining admin access. Decide who may issue each action in Braintree, record which admin user performed it, and review a sample against order history and customer requests on a set schedule. Confirm that Braintree event and user activity logs are retained for your required period, that alerts exist for large or off-hours refunds, and that the store's own admin action logs are forwarded to a system outside the web server.

Remove test credentials before go-live

Sandbox merchant IDs, test keys, test card numbers and developer accounts left in the store after launch create a path into a system that is easy to forget. Before go-live, clear sandbox values from every configuration scope, including store view and website overrides, which are easy to miss. Confirm that the payment method is set to live mode at every scope, that any test Braintree users are deactivated, and that a pre-launch checklist signed by the release owner covers the change. Record the removal as evidence for your compliance assessment.

How a card payment moves between the shopper, Magento and Braintree

The flow starts in the shopper's browser, where hosted fields from Braintree collect card details so they never pass through the merchant's Magento server. Braintree returns a payment method nonce to the storefront, and Magento submits it to Braintree to request authorization. If the issuer requires a 3D Secure challenge, the shopper completes it before the sale proceeds. Check that Magento records the final status from Braintree's response or webhook before marking the order paid.

Card data goes from the shopper's browser to Braintree, and only a token reaches Magento.

Why Braintree payments fail in a Magento store and how to fix them

This table lists the failure points we see most often when the bundled Braintree extension runs on Magento Open Source, with the likely cause, the fix and the first place to check. Read it top to bottom during go-live testing or when a payment problem appears in production. The main takeaway is that most failures trace to configuration drift between sandbox and production, or to a browser or cache layer that is not showing the current settings.

Failure pointLikely causeFixCheck first
Live payments fail right after launchSandbox merchant ID, public key or private key still entered in the production payment configurationRe-enter production credentials from the live Braintree account, confirm the environment setting is Production, and run a small test orderPayment methods configuration in the Magento admin, then the Braintree control panel transaction list
PayPal, Apple Pay, Google Pay or Venmo buttons missingWallet not enabled in the Braintree account, or the storefront domain not registered for that walletEnable each wallet in the Braintree account, register the live storefront domain where the wallet requires it, then clear the cacheBraintree control panel wallet settings, then the browser console for wallet script errors
3D Secure challenge fails on some cards or currenciesCard issuer or currency is outside what the configured 3D Secure rules cover, or the challenge is blocked by a frame or script policyReview the 3D Secure rule settings with the Braintree account team, test the affected card type in sandbox, and confirm the challenge frame is allowed by the site's content policyBrowser console for blocked frame messages, then the Braintree control panel for the declined or challenged transaction
Braintree scripts blocked on checkout pagesContent Security Policy directives do not allow the Braintree script, frame or connection domains, which matters more on restrict-mode payment pagesAdd the Braintree domains that the browser reports as blocked to the policy, using the Magento content security policy configuration, and test checkout in a private windowBrowser console Content Security Policy violation messages, then the Magento content security policy settings
Orders stay in pending after the customer paysPayment status update did not reach the store, often because the webhook or notification endpoint is unreachable or blockedConfirm the store's public URL and notification path are reachable from outside, check that the webhook is registered for the environment in use, and reconcile pending orders against Braintree transactionsBraintree control panel webhook delivery history, then the Magento logs for the payment and order entries
Refund fails in the Magento adminTransaction was already settled or voided, so it cannot be refunded in the same way as an authorizationRefund settled transactions through a credit, void only authorizations that have not settled, and align the refund step with your finance team's processBraintree control panel transaction status, then the order's transaction history in the Magento admin
Changes to payment settings do not appear on the storefrontConfiguration or full-page cache still serves old settings, or indexers and caches were not refreshed after the changeFlush the configuration and page caches, reindex if the change affects catalog or checkout data, and test again in a new browser sessionCache management page in the Magento admin, then the Magento logs after a cache flush

What buyers ask before they hire help with a Braintree integration

How much effort does a Braintree setup take, and what drives it?

Effort depends mainly on how many payment methods you enable, how many currencies and countries you sell in, how your 3D Secure rules are written, how much checkout code you change, and how much testing the scope requires. Cards with vaulting on one storefront is a much smaller job than cards, PayPal, Apple Pay, Google Pay, Venmo and ACH across several currencies with custom checkout steps. Each wallet and local method adds its own account settings, sandbox checks and edge cases, so count them individually when you scope. No duration is supplied for this work, so ask the partner to tie the estimate to your method list and test plan.

Can our own team set up Braintree without a partner?

Yes, if your team has an engineer who has configured Magento Open Source payment modules, can run changes through staging, and can read the logs when a transaction fails. The bundled extension is configured in the admin panel, so the first setup is mostly settings work, while the hard parts are wallet domain checks, 3D Secure rules, webhook handling and proving the flow in a sandbox. A partner makes sense when you need these verified against your own checkout, or when your team lacks time for the testing and documentation your payments and compliance reviewers will ask for.

What does the work need from our side?

You will need administrator access to your Magento Open Source store and staging environment, plus a Braintree account with sandbox and production access granted to the people who will operate it. Decision makers must set the payment rules in writing, including which methods to offer, when 3D Secure challenges apply, how refunds and partial captures are handled, and which currencies are accepted. Your team should also supply test cards, sandbox credentials and a named owner for sign-off. Missing decisions are the most common cause of delay, so confirm them before the build starts.

How does PCI DSS scope change when we use hosted fields?

Hosted fields keep card numbers inside Braintree's frames rather than your store pages, which normally reduces the cardholder data your systems store, process or transmit. That does not remove your obligations. You still need to review how your store loads scripts, how the Content Security Policy is configured, how admin access is controlled and how your environment is patched, because these can affect the security of the payment page. The PCI DSS v4.0.1 standard is the active version, and your acquirer or payment brand determines which validation questionnaire applies. Ask your QSA or acquirer to confirm the scope in writing.

What changes when the store upgrades Magento Open Source?

Upgrades can affect the Braintree module, its dependencies and your custom checkout changes, so the payment flow needs retesting after every patch and minor upgrade. Adobe recommends upgrading every patch cycle to stay secure and PCI compliant, and it names customizations and third-party integrations as drivers of effort. Check the Braintree extension version against your Magento release, rerun wallet and 3D Secure tests in sandbox, and confirm the Content Security Policy still allows the payment scripts. Plan this as recurring work, not a one-time project.

What should we ask for in a written quote?

Ask for a scope list that names each payment method, currency, country and checkout change included, plus the test plan and the sandbox cases it covers. The quote should state what is one-time work, such as configuration and testing, and what recurs, such as upgrade retesting or support. Request the assumptions about your Braintree account, your staging environment and who signs off decisions, and ask what happens if scope changes. Also ask who handles production cutover, rollback and documentation for your compliance file. DeployOpen provides a written scope before work starts and quotes from that scope.

How do we confirm that card data stays off our servers?

Check the payment page in a browser and in your staging environment: card fields should load from Braintree, and your store should receive only a payment token. Review the network traffic during a sandbox test, confirm that your logs do not record card data, and verify that your Content Security Policy and script configuration match the design. Document the test results and keep them with your compliance evidence. A qualified assessor will still decide what your validation requires, so treat this check as input to that review rather than a replacement for it.

How DeployOpen scopes, builds and supports a Braintree integration

DeployOpen plans and implements self-hosted open-source platforms inside your own cloud accounts, data centers or air-gapped networks, and that includes the Braintree extension bundled with Magento Open Source. Engagements are fixed-scope, with the scope, deliverables and timeline agreed in writing before work starts, and ongoing support is available as a retainer.

How we scope

  • Review which payment methods you need, such as cards with vaulting, PayPal, Apple Pay, Google Pay, Venmo or ACH, by market and currency.
  • Map where card data would touch your servers and confirm the hosted fields design that keeps it with the processor.
  • Record the written scope, deliverables, sandbox and production cutover steps, and the items your team must provide.

How we build

  • Configure the bundled Braintree extension in a staging copy, including vaulting, 3D Secure settings and wallet availability per storefront.
  • Test checkout end to end in the Braintree sandbox with test cards, declines, refunds, partial captures and failed 3D Secure challenges.
  • Run payment, order and admin-permission tests against the Magento Open Source release line you operate, and document each result.

How we hand over

  • Deliver configuration records, credential storage notes and a runbook for switching between sandbox and live merchant accounts.
  • Provide the evidence your compliance team needs for PCI DSS scoping, including the data flow diagram and the documented hosted fields design.
  • Walk your engineers and operations staff through refunds, disputes, webhook monitoring and the troubleshooting steps they will own.

How we support

  • Retest the Braintree integration after each Magento Open Source patch and after Braintree extension updates, before they reach production.
  • Review the configuration when you add a payment method, a new market or a new storefront, and update the scope and evidence.
  • Offer ongoing support, upgrades and continuous testing under a retainer, with the coverage agreed in writing.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.