如何在braintree交易销售中设置货币格式

Sah*_*ill 2 php transactions braintree

我创建了一个应用程序,在其中使用 Braintree 支付网关。在我的应用程序中,我选择设置不同的货币,我只知道在设置销售交易参数时如何设置货币。

这是我的代码

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

我所有的交易都是以美元进行的,但我想以不同的货币进行交易。

请有人给我解决方案。谢谢

Bla*_*ger 7

完全披露:我在布伦特里工作。如果您有任何其他问题,请随时联系支持

您需要为要处理的每种货币设置不同的商家帐户。然后,在处理特定货币的交易时,您可以将商家帐户 ID 传递给交易 sale 方法

此外,为了降低 PCI 合规性负担,您需要将随机数传递到您的服务器以代替信用卡详细信息。

$merchantAccountId = someFunctionToLookupCorrectMerchantIdBasedOnCurrency();

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