> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paynext.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Braintree

> Accept payments via Braintree with PayNext.

Braintree, a PayPal service, provides payment processing with native support for PayPal and Venmo wallets.

## Processor Details

|                          |                                                                                                                                                                               |
| :----------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Payment Methods**      | <Badge>Cards</Badge> <Badge>Apple Pay</Badge> <Badge>Google Pay</Badge> <Badge>Venmo</Badge>                                                                                  |
| **Supported Currencies** | [Currency list](https://developer.paypal.com/braintree/docs/reference/general/currencies) — one currency per merchant account, set on the account (see [Currency](#currency)) |
| **Metadata Mapping**     | ✓ (Limited)                                                                                                                                                                   |
| **Network Tokens**       | ✓ (Contact your Braintree representative to enable)                                                                                                                           |
| **Fraud Support**        | ✓ (Premium Fraud Management Tools)                                                                                                                                            |
| **3DS Support**          | ✓                                                                                                                                                                             |
| **3RI Support**          | ✓ (Mastercard only)                                                                                                                                                           |
| **ARN**                  | ✓                                                                                                                                                                             |
| **Fraud Signals**        | ✗                                                                                                                                                                             |

## Currency

Braintree sets the transaction currency from the **merchant account**, not the payment request — each account supports one currency, and there is no currency field on transaction create. This is a Braintree limitation.

<Warning>
  Currency cannot be passed or overridden at payment creation. The `amount` is charged in the account's configured currency regardless of the order currency — with no conversion. Route only matching-currency payments to a given Braintree account.
</Warning>

## Integration Guide

<Steps>
  <Step title="Open Braintree Control Panel">
    Log in to the [Braintree Control Panel](https://www.braintreegateway.com/) and navigate to **Settings → API**
  </Step>

  <Step title="Copy credentials">
    Under **API Keys**, select a Private Key and click **View**. Copy the **Public Key**, **Private Key**, and **Merchant ID**
  </Step>

  <Step title="Add integration in PayNext">
    In **Dashboard → Integrations**, click **Add new integration → Braintree → Connect**
  </Step>

  <Step title="Enter credentials">
    * **Name**: Label for this connection (e.g., "Braintree US")
    * **Public Key**, **Private Key**, **Merchant ID**: Values from Braintree
    * **Network Tokens**: Enable if activated by your Braintree account manager
  </Step>

  <Step title="Configure webhooks">
    In the Braintree Control Panel, navigate to **Settings → API → Webhooks** tab and click **Create New Webhook**.

    Add the PayNext webhook URL and subscribe to:

    * `Refund Failed`
    * `Payment Method Revoked By Customer`

    <Note>
      `Payment Method Revoked By Customer` reports when a customer revokes a vaulted payment method,
      such as a Venmo account, from their wallet. PayNext marks the payment method as revoked so it is
      no longer used for renewals. Without this event, PayNext keeps attempting renewals on an
      instrument the customer has already disconnected.
    </Note>
  </Step>

  <Step title="Save">
    Click **Connect** to complete the integration
  </Step>
</Steps>

## Metadata Mapping

Braintree supports limited metadata fields:

| Braintree field    | Purpose                                   |
| :----------------- | :---------------------------------------- |
| `device-data`      | Required to enable Fraud Management Tools |
| `descriptor.name`  | Statement descriptor                      |
| `descriptor.phone` | Phone on statements                       |
| `descriptor.url`   | URL on statements                         |

See [Metadata Mapping](/guides/advanced/metadata-mapping) for configuration instructions.

## Premium Fraud Management Tools

To use Braintree's [Premium Fraud Management Tools](https://developer.paypal.com/braintree/docs/guides/premium-fraud-management-tools/client-side/javascript/v3/):

1. Create a **Tokenization Key** in Braintree Control Panel under **Settings → API**
2. Collect device data using Braintree's `data-collector` library
3. Store the `deviceData` string in payment metadata
4. Map your metadata key to Braintree's `device-data` field

**Verify device data is captured:**

Check the authorized payment payload in PayNext dashboard. The request should include:

```xml theme={"system"}
<device-data>{"correlation_id":"00accdc7-f2e8-4f30-be2c-9733deb8"}</device-data>
```

The response should contain:

```xml theme={"system"}
<device-data-captured type="boolean">true</device-data-captured>
```

You can also verify in the Braintree dashboard by clicking on the transaction details.

## Testing

[Braintree testing guide](https://developer.paypal.com/braintree/docs/guides/credit-cards/testing-go-live) — Test cards and payment scenarios.
