Payment GatewaysBraintree

Braintree

Connect Braintree to PayLexer to accept cards, PayPal, digital wallets, and subscriptions on your website.

Overview

Braintree is a global payment platform owned by PayPal that enables businesses to accept payments online and in mobile apps. It operates across 40+ countries and supports a wide range of currencies, making it a strong choice for businesses targeting customers in North America, Europe, Australia, and beyond. Braintree is known for its developer-friendly API, built-in fraud protection tools, and native support for recurring billing and digital wallets.


Supported Features

  • Credit and debit cards (Visa, Mastercard, American Express, Discover, JCB, UnionPay)

  • PayPal and Venmo (US only)

  • Apple Pay and Google Pay

  • ACH Direct Debit (US only)

  • Recurring billing and subscription management

  • Advanced fraud protection (Kount integration)

  • Multi-currency and international payments

  • Webhook notifications for real-time payment events


Before You Start

Before connecting Braintree to PayLexer, make sure you have:

Looking for a different payment processor? View all supported gateways →


Configuring Braintree

Getting API Credentials

You need three credentials from your Braintree dashboard: your Merchant ID, Public Key, and Private Key. Braintree provides separate sets for Live (Production) and Sandbox (Test) environments.

Log in to your Braintree dashboard

Open API Keys

  • Click the gear icon (Settings) in the top-right corner.

  • Select API from the dropdown menu.

Generate and copy your credentials

On the API Keys page, click Generate New API Key to create a new key pair.

Once generated, click View below the Private Key row to reveal it. All three credentials will now be visible:

  • Merchant ID - Copy this value.

  • Public Key - Copy this value.

  • Private Key - Copy this value. Treat this like a password - do not share it.

Copy all three values before navigating away. You can click View again in a future session to re-reveal the Private Key, but you must click it each time - it is not shown by default.


Adding Credentials to PayLexer

Open Gateway Settings in PayLexer

Enter your Live credentials

In the Live / Production section, paste:

  • Merchant ID - Your Live Merchant ID from Braintree.

  • Public Key - Your Live Public Key from Braintree.

  • Private Key - Your Live Private Key from Braintree.

Understanding Live/Production and Sandbox Settings:

EnvironmentPurpose
Live / Production (Mandatory)Used for real transactions. Cannot be empty, even when testing.
Test / Sandbox (Optional)Used for testing only. No real money is processed.

How PayLexer selects credentials:

  • Debug/Test mode ON → Test credentials are used

  • Debug/Test mode OFF → Live credentials are used

Enter your Sandbox credentials (optional)

In the Test / Sandbox section, paste the equivalent credentials from your Braintree Sandbox dashboard:

  • Sandbox Merchant ID

  • Sandbox Public Key

  • Sandbox Private Key

Save your settings

Click Save to store your credentials.

Braintree is now connected to PayLexer. You can verify the connection by running a test transaction with Sandbox mode enabled.


Configuring Webhooks

Webhooks allow Braintree to notify PayLexer in real time when payment events occur - such as successful charges, failed payments, and subscription updates. Enabling webhooks is strongly recommended.

Copy your PayLexer Webhook URL

  • In PayLexer, go to Payment Gateways -> Braintree.

  • Copy the Webhook URL shown on the page.

Create a webhook in your Braintree dashboard

  • In the Braintree dashboard, go to Settings -> API -> Webhooks.

  • Click Create New Webhook.

  • Paste your PayLexer Webhook URL into the Destination URL field.

  • Select the events you want to send. Recommended events:

    • subscription_charged_successfully

    • subscription_charged_unsuccessfully

    • subscription_canceled

    • dispute_opened

    • dispute_won

    • dispute_lost

    • payment_method_revoked_by_customer

  • Click Create Webhook.


Integrate Braintree to Your Website

Once your credentials are saved, enable Braintree as an active gateway on your website.

Open your website settings

  • In PayLexer, navigate to Websites.

  • Find your website and click Edit.

Enable Braintree

  • Scroll to the Payment Gateways section.

  • Toggle Braintree to enabled.

  • Click Save Changes.

Braintree is now active on your website and ready to process payments.


Troubleshooting


Best Practices

  • Always test with Sandbox credentials and Test/Debug mode enabled before switching to live credentials.

  • Enable webhooks for reliable, real-time payment status updates - do not rely solely on redirect-based confirmation.

  • Keep your Private Key confidential. Rotate it immediately via the Braintree dashboard if you suspect it has been exposed.

  • Enable Braintree's Advanced Fraud Protection tools in your merchant account to reduce chargebacks.

  • Use Braintree's built-in 3D Secure to reduce fraud liability for card-not-present transactions where supported.

  • Periodically review your Braintree webhook logs to ensure events are being delivered and processed correctly.


FAQs


Still Have Questions?

For API details and advanced configuration, see the Braintree developer documentation.