Level 2 data

To qualify for Level 2 processing on a given transaction, you should include the following fields in the Transaction::sale() call:

Creating a transaction

Below is a full example using the required fields for Level 2:

PHP
Copy
Copied
$result = $gateway->transaction()->sale([
    'amount' => '100.00',
    'paymentMethodNonce' => nonceFromTheClient,
    'purchaseOrderNumber' => '12345',
    'taxAmount' => '5.00',
    'shipping' => [
        'countryCodeAlpha3' => 'USA'
    ]
]);
This code snippet now uses gateway instance methods instead of class-level methods. Learn more.

Level 3 data

To qualify for Level 3 processing on a given transaction, you must pass Level 2 data, along with specific additional Level 3 data and line items. Line items are similar to the details you would find on an itemized invoice.

Each time you create a transaction, include the following fields in the Transaction::sale() call:

Supported characters

To ensure all line items appear as expected on the cardholder's statement, use only a-z, A-Z, 0-9, ', ., -, and spaces in the following fields:

Line items that contain other characters may still qualify for Level 3 processing, but unsupported characters will be converted to a space on the cardholder's statement.

Creating a transaction

Below is a full example using the minimum required fields for Level 3:

PHP
Copy
Copied
$result = $gateway->transaction()->sale([
    'amount' => '100.00',
    'paymentMethodNonce' => nonceFromTheClient,
    'purchaseOrderNumber' => '12345',
    'taxAmount' => '5.00',
    'shippingAmount' => '1.00',
    'discountAmount' => '0.00',
    'shipsFromPostalCode' => '60654',
    'shipping' => [
        'postalCode' => '60654',
        'countryCodeAlpha3' => 'USA'
    ],
    'lineItems' => [
        [
            'name' => 'Product',
            'kind' => Braintree_TransactionLineItem::DEBIT,
            'quantity' => '10.0000',
            'unitAmount' => '9.5000',
            'unitOfMeasure' => 'unit',
            'totalAmount' => '95.00',
            'taxAmount' => '5.00',
            'discountAmount' => '0.00',
            'productCode' => '54321',
            'commodityCode' => '98765'
        ]
    ]
]);
This code snippet now uses gateway instance methods instead of class-level methods. Learn more.

Validation errors

A transaction result may contain validation errors specifically for Level 3 fields or transaction line items, but only if the format or length of the value is outside expected bounds. This is to ensure the additional fields minimally interfere with the successful submission of transactions.

For a list of errors, see the Validation Errors reference page.

Still have questions?

If you can’t find an answer, contact our Support team