VibeFox Braintree for PrestaShop — Help
Requirements
PrestaShop: 8.0 to 9.x.
PHP: 8.0 or later. The module refuses to install on older PHP versions.
Braintree account: you need the Merchant ID, Public Key and Private Key of your Braintree account. They are in the Braintree Control Panel (sandbox: sandbox.braintreegateway.com, live: www.braintreegateway.com) under the gear icon, API, API Keys. Sandbox and live accounts have different keys. 3-D Secure must be enabled for your Braintree merchant account, unless you set 3-D Secure to Disabled. No webhook is needed: card payments are confirmed immediately.
VibeFox license key: bought on vibefox.net. One key works on one domain.
Installation
1. In the back office go to Modules > Module Manager and click Upload a module. Choose the module ZIP file.
2. When the upload finishes, click Configure, or find VibeFox Braintree Gateway in the module list later and click Configure.
3. Paste your VibeFox license key into License key in the license block at the top of the Configure page and click Activate (see License key).
4. Copy the Merchant ID, Public Key and Private Key from the Braintree Control Panel into the sandbox or live fields.
5. Turn on Enable/Disable and click Save. Keep Sandbox mode on and place a test order with a Braintree sandbox test card. Then turn off Sandbox mode to take real payments with the live credentials.
On install the module creates two order statuses, Braintree payment authorized and Braintree payment on hold. PrestaShop offers a new payment module for all currencies, countries and customer groups. You can limit them in Payment > Preferences.
Configuration
All settings are on the module page: Modules > Module Manager > VibeFox Braintree Gateway > Configure. Each section has its own Save button, which saves the whole page. When the payment method is enabled but the Merchant ID, Public Key or Private Key of the selected environment is missing, the page warns you that the payment method is hidden at checkout until they are filled in. While sandbox mode is on, the page shows Sandbox mode is on: test payments, no real money.
Braintree
Enable/Disable: Enable Braintree card payments turns the payment method on or off. Default: off.
Title: the payment method name customers see at checkout. It is also the payment method name stored in the order. Default: Credit / debit card. Required.
Description: the text shown under the payment method at checkout. Default: Pay securely with your credit or debit card via Braintree.
API credentials
Log in to the Braintree Control Panel (sandbox or live), click the gear icon, then API and API Keys. The public and private keys are listed there, and the Merchant ID is shown on the same page. The page shows only the credential fields of the selected environment; both sets stay saved.
Sandbox mode: uses the Braintree sandbox (test payments, no real money). Default: on. Turn it off to take real payments with the live credentials. Refunds, captures and voids always use the environment the order was paid in. While it is on, customers see SANDBOX / TEST MODE — no real money is charged. under the payment method.
Sandbox Merchant ID and Live Merchant ID: the Merchant ID of the sandbox or live account.
Sandbox Public Key and Live Public Key: the public key of that account.
Sandbox Private Key and Live Private Key: the private key of that account. Saved private keys are never shown again. The field stays empty and shows Saved — leave empty to keep it. Type a new value only to change it.
Sandbox merchant account ID(s) and Live merchant account ID(s): optional. Braintree charges in the currency of the merchant account. Leave empty to use your default merchant account, enter one ID (for example mystore_EUR) or one per currency: EUR=mystore_EUR, USD=mystore_USD. If the charged currency does not match the order currency, the transaction is voided automatically and the customer is not charged.
Clear saved private keys: tick Sandbox Private Key or Live Private Key and click Save to remove it. An empty field keeps the saved value.
Payment
Transaction type: how the card is charged.
3-D Secure: 3-D Secure 2 (Strong Customer Authentication) is mandatory for most card payments in the EEA and UK. It must also be enabled for your Braintree account (contact Braintree support if payments fail with a 3-D Secure configuration error).
The 3-D Secure result is checked on the server, not only in the browser, before the card is charged.
Advanced
Debug log: also logs API calls and payment steps to logs/wc_btg_debug.log.php in the module folder. The file cannot be opened from the web. Errors are always logged, even when this is off. The log never contains API keys, card or customer data. Default: off.
Log: shows the size and the latest entries of the log. Click Clear log to empty it.
Delete data on uninstall: when on, uninstalling the module removes the gateway settings and the log. Braintree transactions, refunds and order statuses always stay, so orders paid before can still be refunded, captured or voided after a re-install. Default: off.
Checkout
At the payment step the customer chooses the payment method (by default Credit / debit card) and enters the card in the Braintree form inside the payment option. The form is loaded from Braintree only on the checkout page and uses the language of the shop. With 3-D Secure on, the customer completes the bank's verification when placing the order; the cart total, e-mail and billing address are passed to it.
The module then charges the one-time token through the Braintree API for the cart total in the cart currency, with the cart number as the order ID in Braintree. No order exists before this point. The charged amount and currency are checked against the cart. The order is created only after Braintree accepts the payment, and the customer sees the standard PrestaShop order confirmation page.
If the payment fails, no order is created, the reason is written to the module log, and the customer stays at the payment step with a message, for example Your card was declined. Please use another card or contact your bank., 3-D Secure authentication failed. Please try again or use another card. or The card security code or billing address could not be verified. Please check your details and try again. The customer can try again at once. If the charged currency or amount does not match the cart, the transaction is voided and the customer sees This payment could not be processed in the currency of your order. Your card has not been charged. Please choose another payment method or contact us.
A cart is never charged twice. A second submit while the payment is running shows This order is already being paid. Please wait a moment and check your e-mail before trying again. If the card was charged but PrestaShop could not create the order, the customer sees Your payment was received, but the order could not be completed automatically. Please contact us — do not pay again. The next attempt for the same cart creates the order from the saved transaction without charging again.
The module takes card payments only. It has no saved cards, no subscriptions or recurring payments, no PayPal, Venmo, Apple Pay, Google Pay or local payment methods, and no Braintree webhooks.
Orders and refunds
Order statuses
No order yet: the payment has not been made or was declined. Only the cart exists.
Payment accepted: the card was charged (Sale), or an authorization was captured. The payment is recorded with the Braintree transaction ID, and a private note in the messages of the order shows the amount, the transaction ID and the 3-D Secure result.
Braintree payment authorized: the funds are only authorized (Authorize only). No payment is recorded until you capture it.
Braintree payment on hold: Braintree returned an unexpected transaction status, or a charge in the wrong currency or amount could not be voided automatically. The note explains what to check in the Braintree Control Panel.
Canceled: an authorization was voided.
Refunded: the payment was fully refunded through the module.
If another transaction arrives for an order that is already placed, the order is not changed. A note asks you to check it in the Braintree Control Panel and void or refund it.
Braintree payment block
The order page shows a Braintree payment block with the transaction ID (linked to the transaction in the Braintree Control Panel of its environment), the transaction status, the amount and merchant account, the 3-D Secure result, the amount charged and refunded, a Sandbox badge for sandbox payments and the refund history. The buttons of the block need the right to edit orders; access to the Modules pages is not needed.
Capture and void
For an order with the status Braintree payment authorized, click Capture Braintree payment to charge the order total, or Void Braintree authorization to release the held amount. Capture sets the order to Payment accepted and records the payment; void sets it to Canceled. If the action fails, the error is shown in the block and added to the order notes.
Refunds
In the Braintree payment block enter the amount (the amount not refunded yet is filled in), optionally a reason, and click Refund via Braintree. Confirm the question Refund this amount through Braintree? This cannot be undone. Full and partial refunds are supported. Refunds are made in the amount and currency Braintree charged, so after an amount or currency mismatch you can refund up to what the customer actually paid. Braintree refunds only settled transactions, usually within 24 hours. Before settlement a full refund is done as a void; a partial refund then fails with a message to wait for settlement. The refund is sent to the environment (sandbox or live) of the payment, so the credentials of that environment must be set. If Braintree does not accept the refund, the block shows the error and no refund is recorded. A successful refund is added to the refund history and the notes. A full refund sets the order to Refunded; a partial refund does not change the status.
The module does not create credit slips. The standard PrestaShop refund buttons of the order page do not send money back through Braintree. Disputes (chargebacks), settlement declines and refunds made in the Braintree Control Panel are not synced to PrestaShop.
License key
The module works with a VibeFox license key from vibefox.net. The license block License — VibeFox Braintree Gateway is the first block on Modules > Module Manager > VibeFox Braintree Gateway > Configure, above the settings. Paste the key into License key and click Activate. After that the block shows the key masked, the status (for example the date the license is active until and your domain) and the buttons Check now to check the status again, Change key to enter another key and Remove key to remove the key from this shop. Below them are the line Product: presta-payment-braintree and the link Manage licenses and domains in your account, which opens your vibefox.net account. Only employees with the Configure permission for the module can change the key. The texts of the block follow the back office language (English and Russian are included).
If the key is not accepted, the block says why, for example Key not found, This key belongs to another product, Domain limit reached or License expired on a date. After the shop address changes, or after you free a domain slot in your account, click Check now. If the license server cannot be reached, the module keeps working on the last known status.
One key works on one domain: the domain of the main shop, also in a multistore setup. Removing the key from the shop does not free its domain slot. Free the slot in your vibefox.net account.
Without an active key, Braintree is not shown to customers at checkout. If a payment is started anyway, the customer sees This payment method is not available. Please choose another one. The PrestaShop storefront does not know that you are logged in to the back office, so the payment method is hidden for you too: you can set up the module before you buy a key, but not test it at checkout. A reminder appears in Modules > Module Manager on the Alerts tab. Existing orders are not affected: payments already started are still confirmed, and captures, voids and refunds work.
When a license expires, the module keeps working, but updates and support need a renewal. The status is checked again automatically while you work in the back office: once a day for the first 14 days after the key is entered, then once a week. No cron job is needed. Uninstalling or resetting the module always removes the license key and license status.
Troubleshooting
Braintree does not appear at checkout: check that the license is active, Enable/Disable is on and the selected environment has a Merchant ID, Public Key and Private Key. The settings page shows a warning when a key is missing. In Payment > Preferences check that the module is allowed for the cart currency, the customer's country and the customer's group.
The card was charged, but no order was created: card payments are confirmed immediately, without a webhook. Look at the Log field on the module page. If the log says that the answer from Braintree was lost, check the Braintree Control Panel for a transaction with the cart number as the order ID before accepting another payment. If the order could not be created after the charge, the next payment attempt for the same cart creates it without charging again.
The card form shows Could not initialize payment form: the keys of the selected environment are wrong, or the merchant account ID does not exist in that account. Check the keys and the merchant account ID(s), then reload the page.
3-D Secure fails for every payment: 3-D Secure must be enabled for your Braintree merchant account. Contact Braintree support, or set 3-D Secure to Disabled (not recommended in the EEA and UK, where SCA is mandatory).
The customer is told the payment could not be processed in the currency of the order: Braintree charged in the currency of the merchant account. Enter the merchant account ID for the cart currency in the merchant account field of the current environment.
The customer sees The order total must be greater than zero to pay by card: the cart total is zero, for example after a voucher. Such orders cannot be paid by card.
A partial refund fails right after the payment: Braintree can only refund settled transactions, usually within 24 hours. Refund the full amount to void the transaction now, or make the partial refund after settlement.
Refund, capture or void fails with a message about the environment: the payment was made in the sandbox or live environment, and the credentials of that environment are not set. Enter them and try again.
Uninstall
Go to Modules > Module Manager, open the menu next to VibeFox Braintree Gateway and choose Uninstall. The license key and license status of this module are always removed. If Delete data on uninstall is on, the gateway settings and the log are removed. If it is off, all settings are kept for a later re-install. The Braintree transactions and refunds and the order statuses Braintree payment authorized and Braintree payment on hold are always kept, so orders paid before can still be refunded, captured or voided after a re-install. Existing orders keep their payment notes and transaction IDs.
Braintree is a trademark of its respective owner. This module is not affiliated with or endorsed by Braintree.
