vaimo / module-braintree-magento2
vaimo/module-braintree-magento2
Fork from the Magento Braintree 2.2.0 module by Gene Commerce for PayPal.
Braintree Payments
Module Magento\Braintree implements integration with the Braintree payment system.
Overview
This module overwrites the original Magento Braintree module, to provide additional features and bug fixes.
Available Payment Methods
- Credit Card
- Visa
- Mastercard
- Amex
- Discover
- JCB
- Diners
- Maestro
- Restrictions apply.
- PayPal
- PayPal Credit
- US and UK only. Restrictions apply.
- Google Pay
- Apple Pay
- Venmo (US only)
- ACH Direct Debit (US only)
Additional Features
M1 to M2 Stored Card migration tool
If you are looking to migrate to M2 and want to offer the best experience for existing customers by migrating their stored
credit cards, this is now possible with the new console command.
To use the new command, ensure that
- Your M1 database is online and accessible
- Your M2 store is in Braintree Production mode
- You have already migrated the customers from M1 to M2
Run the following command on your M2 server
bin/magento braintree:migrate --host=<HOSTNAME_OR_IP> --dbname=<DB_NAME>
You will be prompted for the DB Username and Password and after that, the tool will query your M1 DB, find any stored cards
and locate them in your Braintree account (this is why you must run it with Braintree in Production mode).
Any matching records that are found are then queried in your M2 database, and the card details* are stored for that customer.
Kount ENS Webhook
If your Kount and Braintree accounts have been linked, you can now configure Braintree with your Kount Merchant ID to
enable the ENS webhook. Add the ENS URL to your Kount portal (more info in the configuration options) and any orders
that get flagged as "Review" or "Escalate" can be accepted or declined through Kount. The ENS webhook in Magento will
pick up this status change and handle the Magento Order accordingly.
More information available here.
Custom Fields
If you would like to add Custom Fields to your
Braintree transactions, we provide an example module here
that can be used to create a custom module for your store to add these fields.
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.
[4.0.3] - 2020-02-20
Fixed
- Feedback to end-user when using vaulted payment methods
[4.0.2] - 2019-12-09
Fixed
- Replaced
getPricewithgetBasePricein Level 2/3 data builder in order to correctly get a float - Issue when trying to use a UK Maestro card to checkout
[4.0.1] - 2019-11-27
Fixed
- LPM allowed payment methods config value saved incorrectly as
null
4.0.0 - 2019-11-20
Added
- Local Payment Methods
- Merchants can now offer up to 8 new payment methods for EU based customers
- Bancontact, EPS, girpoay, iDEAL, Klarna Pay Now/SOFORT, MyBank, P24 and SEPA/ELV Direct Debit are now supported
- Minimum requirements have been updated to Magento 2.3, and PHP 7.2
3.4.1 - 2019-11-20
Fixed
- Hotfix for bug that stopped stored cards being used when CVV Re-verification is disabled
3.4.0 - 2019-11-15
Added
- M1 to M2 Stored Card migration tool
- New
bin/magento braintree:migrateconsole command to connect to your remote M1 database and potentially copy across customers
stored cards. This should be run whilst Braintree is in Production mode.
- New
- Kount ENS webhook
- Allow "suspected fraud" orders in Magento to be accepted or decline by changing status in your Kount portal
- CVV Re-verification for Stored Cards
- This option can be enabled so that registered Customers need to provide the CVV in order to use a Stored Card
- Information about Apple Pay on-boarding
- Information about Custom Fields
Fixed
- Level 2/3 Processing data now only used for Credit/Debit card transactions and now includes shipping tax
- Correct state now set on the PayPal Onclick review page
- Bug where PayPal was not using updated shipping address if the customer changed it during checkout
- Bug that stopped Admins creating orders in the backend when Braintree was the only payment method
- API validation check now uses correct Store IDs when a multi-store is being used
Removed
- Removed old PayPal
payee emailconfiguration option as it has been deprecated by Braintree
3.3.3
Fixed
- Updated PayPal Credit APR percentages
3.3.2 - 2019-09-26
Fixed
- Level 2 / 3 Processing data should now only send shipping data if a shipping address is present.
3.3.1 - 2019-09-25
Fixed
- Level 2 / 3 Processing data should now return strings for the float values as per the documentation
3.3.0 - 2019-09-18
Added
- New payment methods; Venmo and ACH Direct Debit
- Both new payment methods are for merchants based in the US and will require you to speak with your Braintree Account
Manager to enable the services on your account - Level 2 /3 Processing information. For more details, see here
- Braintree PHP SDK (3.40.0) is now included as part of the module in order to maintain BC with Magento 2.2
Fixed
- PayPal not working with virtual products
- CVV validation bug (https://github.com/nicholasscottfish)
- Google Pay library now correctly excluded from JS minification
Removed
- Unused Guzzle PSR7 library
3.2.1 - 2019-07-31
Fixed
- Bug in backend create order
3.2.0 - 2019-07-31
Added
- 3DS 2 now supported
- Basic validation to Dynamic Descriptor configuration options to alleviate errors in checkout
Fixed
- PayPal breaking Grouped Product pages
- Return type stopping Swagger from compiling (https://github.com/Thundar)
- Handling of exceptions in GatewayCommand class that would show "blank" errors on checkout
- Broken CSS selector
- Giftcards not working with PayPal
- Reverted a change introduced in 3.1.2 where card details were only stored in the database if
the Vault config option was enabled. This is because partial invoicing, refunds etc need the stored card data. However,
a bug in core Magento 2.3.1 means that if the Vault is turned off, cards are always shown in customer accounts
Removed
- Layout options for PayPal buttons, due to the buttons now being rendered separately
3.1.3
Fixed
- Issue with Configurable Product prices
- Return type issue for Google Pay configuration
3.1.2
Added
- Callback to delete stored card in Braintree when Customer deletes card in account
Fixed
- Vaulted cards now work with 3DS
- Order button "unstuck" after invalid card details/failed payment
- Stop cards always being stored after successful order
- No cart session exception handled correctly (https://github.com/shilpambb)
- PayPal
- Credit instalments now sorted on Product page
- Billing address now updated correctly
- Quote updater no longer throws an error if store uses DB table prefix
- Shipping address now used for Virtual Products
- Voucher redirect loop fixed
- 2nd address line now included (https://github.com/igor-imaginemage)
- Credit calculator now uses correct total values (https://github.com/diazwatson)
- Region now added to shipping address correctly on PayPal OneClick/Review screen
- Apple Pay
- Shipping cost is no longer added multiple times
- Apple Pay dialog now shows correct total on initial popup
3.1.1 - 2019-03-05
Fixed
- Fix bug that stopped PayPal working on mini-cart
3.1.0 - 2019-02-27
Added
- Functionality to add PayPal button to Product page
3.0.7 - 2019-01-30
Fixed
- Vaulted cards now work correctly
| Version | Stability | QA Status | Compatibility | Released |
|---|---|---|---|---|
| 4.0.8 | stable | Fail | Not compatible Details | 2021-09-14 10:21:34 |
| 4.0.7 | stable | Not tested | Not yet tested Details | 2021-04-29 13:48:50 |
| 4.0.6 | stable | Not tested | Not yet tested Details | 2021-01-29 09:17:58 |
| 4.0.5 | stable | Not tested | Not yet tested Details | 2020-11-10 14:47:06 |
| 3.5.0 | stable | Not tested | Not yet tested Details | 2020-11-09 16:24:16 |
| 3.4.4 | stable | Not tested | Not yet tested Details | 2020-09-02 13:41:39 |
| 3.4.3 | stable | Not tested | Not yet tested Details | 2020-05-19 09:52:43 |
| 4.0.4 | stable | Not tested | Not yet tested Details | 2020-05-19 09:51:53 |
| 4.0.3 | stable | Not tested | Not yet tested Details | 2020-02-20 10:44:25 |
| 4.0.2 | stable | Not tested | Not yet tested Details | 2019-12-13 10:25:19 |
| 3.4.2 | stable | Not tested | Not yet tested Details | 2019-12-09 16:09:56 |
| 4.0.1 | stable | Not tested | Not yet tested Details | 2019-11-27 14:58:01 |
| 4.0.0 | stable | Not tested | Not yet tested Details | 2019-11-20 16:34:10 |
| 3.4.1 | stable | Not tested | Not yet tested Details | 2019-11-20 12:07:19 |
| 3.4.0 | stable | Not tested | Not yet tested Details | 2019-11-18 10:57:23 |
| 3.3.3 | stable | Not tested | Not yet tested Details | 2019-10-18 21:51:45 |
| 3.2.2 | stable | Not tested | Not yet tested Details | 2019-10-18 21:50:21 |
| 3.1.4 | stable | Not tested | Not yet tested Details | 2019-10-18 21:48:26 |
| 3.0.9 | stable | Not tested | Not yet tested Details | 2019-10-18 21:46:13 |
| 3.3.2 | stable | Not tested | Not yet tested Details | 2019-09-26 09:15:40 |
| 3.3.1 | stable | Not tested | Not yet tested Details | 2019-09-25 09:14:16 |
| 3.3.0 | stable | Not tested | Not yet tested Details | 2019-09-18 09:48:50 |
| 3.2.1 | stable | Not tested | Not yet tested Details | 2019-07-31 15:31:41 |
| 3.2.0 | stable | Not tested | Not yet tested Details | 2019-07-31 15:19:52 |
| 3.1.3 | stable | Not tested | Not yet tested Details | 2019-06-12 09:21:05 |
| 3.1.2 | stable | Not tested | Not yet tested Details | 2019-06-05 11:05:42 |
| 3.1.1 | stable | Not tested | Not yet tested Details | 2019-03-05 10:35:58 |
| 3.1.0 | stable | Not tested | Not yet tested Details | 2019-02-27 09:36:02 |
| 3.0.8 | stable | Not tested | Not yet tested Details | 2019-02-15 10:50:47 |
| 3.0.7 | stable | Not tested | Not yet tested Details | 2019-01-30 11:30:56 |
| 3.0.6 | stable | Not tested | Not yet tested Details | 2019-01-21 09:45:36 |
| 3.0.5 | stable | Not tested | Not yet tested Details | 2018-08-03 14:46:12 |
| 3.0.4 | stable | Not tested | Not yet tested Details | 2018-07-11 11:40:46 |
| 3.0.3 | stable | Not tested | Not yet tested Details | 2018-05-21 13:59:30 |
| 3.0.2 | stable | Not tested | Not yet tested Details | 2018-02-27 10:53:03 |
| 3.0.1 | stable | Not tested | Not yet tested Details | 2018-02-09 11:55:52 |
Requires 19
| Package | Constraint |
|---|---|
| magento/module-customer | 101.0.*||102.0.* |
| magento/module-config | 101.0.*||101.1.* |
| magento/module-sales | 101.0.*||102.0.* |
| magento/module-directory | 100.2.*||100.3.* |
| magento/module-payment | 100.2.*||100.3.* |
| magento/module-checkout | 100.2.*||100.3.* |
| magento/module-backend | 100.2.*||101.0.* |
| magento/module-vault | 101.0.*||101.1.* |
| magento/module-catalog | 102.0.*||103.0.* |
| magento/module-quote | 101.0.*||101.1.* |
| magento/module-paypal | 100.2.*||100.3.* |
| magento/module-theme | 100.2.*||101.0.* |
| magento/module-ui | 101.0.*||101.1.* |
| magento/module-multishipping | 100.2.*||100.3.* |
| ext-json | * |
| ext-simplexml | * |
| php | >=7.2.0 |
| league/iso3166 | ^2.1 |
| msp/recaptcha | ^2.2.3 |
Replaces 2
| Package | Constraint |
|---|---|
| magento/module-braintree | 100.*.* |
| braintree/braintree_php | 3.* |
Compatibility
Each Magento release line is installed on its supported PHP versions, then the module is built (DI compilation + static-content deploy) and its unit and integration suites are run. The matrix shows the lines and PHP versions the module is confirmed to install and run on. Code-quality results further down (phpstan, phpcs, …) are reported separately and never affect compatibility.
Code Quality
Advisory checks against the module's source. Static analysis runs once across the whole module; PHPStan re-runs per Magento + PHP version because resolvable symbols differ between releases. These NEVER affect the Compatibility badge — a phpcs finding can't make a module incompatible.
Static analysis
Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.
| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Fail | 3516 | 8 errors, 3508 warnings (ruleset: Magento2) — 1677 auto-fixable with phpcbf |
| PHPMD | Warning | 157 | 157 rule violations (MissingImport:25, UndefinedVariable:23, TooManyPublicMethods:18, UnusedPrivateMethod:14, UnusedPrivateField:14) |
| Cpd | Warning | 12 | 12 duplicated chunks spanning 655 total lines (min-lines=5, min-tokens=70) |
| Composer validate | Info | 1 | valid; 1 advisory note (composer validate --strict) |
PHPStan
Type-checks the module's PHP against a real Magento install at the configured gate level. Re-runs per Magento and PHP version because resolvable symbols differ between releases. Cell → details modal.
Tests
Unit and integration suites, run for each applicable Magento and PHP version. A test failure speaks to the module's behaviour, not its compatibility with a Magento line, so it is reported here separately and never reddens the compatibility matrix.
Unit tests
Integration tests
| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | ||
| 2.4.8 | N/A | N/A | ||
| 2.4.9 | N/A | N/A |
Security
Security checks run directly against the module: an audit of its declared dependencies for known vulnerabilities (composer audit) and a scan of its source for malware and web-shell signatures. Each runs once. A malware detection fails the version outright.
More from Vaimo
View vendorTurn an existing module into recurring revenue.
If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.