gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-01 22:26:23 26 4
gpt4 key购买 nike

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

这是我的代码

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

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

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

最佳答案

完全披露:我在 Braintree 工作。如果您还有任何问题,欢迎随时contact support .

您需要 set up a different merchant account对于您要处理的每种货币。然后,在处理特定货币的交易时,可以传入 merchant account id to the transaction sale method .

此外,为了降低您的 PCI 合规性负担,您需要 pass a nonce to your server代替信用卡详细信息。

$merchantAccountId = someFunctionToLookupCorrectMerchantIdBasedOnCurrency();

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

关于php - 如何在 braintree 交易销售中设置货币格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33909595/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com