Bring Your Own Token
Through Bring Your Own Token (BYOT), merchants who tokenize cards with another Payment Service Provider (PSP) or who vault Network Tokens themselves can use their existing Network Tokens with Braintree.
Creating transactions
A BYOT transaction can be created using Transaction: Sale with the required network token parameters. The required parameters differ based on the type of BYOT transaction being created.
Required parameters
The following parameters are always required:
- amount
- creditCard.number (token)
- creditCard.expirationDate (token)
- creditCard.networkTokenizationAttributes.cryptogram
For more information on what should be passed in the cryptogram field, see the "Customer Initiated Transactions" and "Merchant Initiated Transactions" fields below.
Optional parameters
The following parameters are always optional:
- creditCard.networkTokenizationAttributes.ecommerceIndicator
- creditCard.networkTokenizationAttributes.tokenRequestorId
Refer to Transaction: Sale for detailed examples and a complete listing of transaction options.
Customer initiated transactions
When creating a customer initiated transaction (CIT) or the first in a recurring series, a network-issued cryptogram is required.
- PHP
$result = $gateway->transaction()->sale([ 'amount' => '10.00', 'creditCard' => [ 'number' => '4111111111111111', 'expirationDate' => '05/2027', 'networkTokenizationAttributes' => [ 'cryptogram' => '/wAAAAAAAcb8AlGUF/1JQEkAAAA=', 'tokenRequestorId' => '45310020105', 'ecommerceIndicator' => '05' ] ] ]); if ($result->success) { // See $result->transaction for details // $result->transaction->processedWithNetworkToken == true } else { // Handle errors }Merchant initiated transactions
When creating a merchant initiated transaction (MIT) or subsequent transaction, a network transaction identifier (NTI) and related parameters are required. The cryptogram must still be present, but a static cryptogram value of "STATIC_RECURRING" should be included in place of a network-issued cryptogram.
Required parameters
- transactionSource =
recurring,unscheduled, orinstallment - externalVault.status =
vaulted - externalVault.previousNetworkTransactionId
- creditCard.networkTokenizationAttributes.cryptogram
- PHP
$result = $gateway->transaction()->sale([ 'amount' => '10.00', 'transactionSource' => 'recurring', 'creditCard' => [ 'number' => '4111111111111111', 'expirationDate' => '05/2027', 'networkTokenizationAttributes' => [ 'tokenRequestorId' => '45310020105', 'ecommerceIndicator' => '05', 'cryptogram' => 'STATIC_RECURRING' ] ], 'externalVault' => [ 'status' => 'vaulted', 'previousNetworkTransactionId' => '123456789012345' ] ]); if ($result->success) { // See $result->transaction for details // $result->transaction->processedWithNetworkToken == true } else { // Handle errors }