【问题标题】:Braintree Drop-In UI v.zero how to retrieve the payment ID with PHP / to stay PCI QSA ABraintree Drop-In UI v.zero 如何使用 PHP 检索付款 ID / 以保持 PCI QSA A
【发布时间】:2016-07-14 03:10:25
【问题描述】:
【问题讨论】:
标签:
braintree
pci-compliance
【解决方案1】:
完全披露:我是 Braintree 的开发人员
本教程的那部分概述了客户端如何将信用卡信息发送到 Braintree 服务器,该服务器通过 post 参数返回付款方式随机数。
然后,您可以使用付款方式 nonce 创建和检查交易和付款方式,同时保持 PCI 合规性。例如,如果您有发布到 /checkout 的表单,您可以在结帐逻辑中执行以下操作:
$amount = '10.00'; /* replace with the amount you want */
$nonce = $_POST["payment_method_nonce"];
$result = Braintree\Transaction::sale([
'amount' => $amount,
'paymentMethodNonce' => $nonce
]);
if ($result->success){
$transaction = $result->transaction;
/* inspect the transaction here */
} else {
/* handle any errors */
}
所有这些都在教程的下一部分中详细介绍,可以找到here,如果您有任何问题,您可以随时联系Braintree support。