简体   繁体   中英

How to set Currency Format in braintree transaction sale

I create a APP in which i use Braintree Payment Gateway. In my application i make options to set different currency, am just know that how to set currency when i set sale transaction param.

here is my code

$result = Braintree\Transaction::sale([
                    'amount' => '50.00',
                    'creditCard' => array(
                     'cardholderName' => 'Test Name',
                     'number' => '4000111111111511',
                     'expirationDate' => '12/2018',
                     'cvv' => '123',
                    ),
                    'options' => [ 'submitForSettlement' => true]
              ]);

All of my transaction made in US Dollar, but i want to make transaction in different currencies.

Please someone give me the solution. thanks

Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support .

You will need to set up a different merchant account for each currency you would like to process. Then, when processing a transaction for a specific currency, you can pass in the merchant account id to the transaction sale method .

In addition, to keep your PCI compliance burden low, you will want to pass a nonce to your server in place of the credit card details.

$merchantAccountId = someFunctionToLookupCorrectMerchantIdBasedOnCurrency();

$result = Braintree\Transaction::sale([
    'amount' => '100.00',
    'paymentMethodNonce' => nonceFromTheClient,
    'merchantAccountId' => $merchantAccountId,
    'options' => [
        'submitForSettlement' => True
    ]
]);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM