0
您好,我嘗試在我的網站上設置braintree payement,但創建我的交易出售時出現錯誤:Unknown paymentMethodNonce。我生成客戶端令牌就像從布倫特裏支持的例子(他們沙子我用一個例子郵件):未知paymentMethodNonce on Braintree
<?php
require_once("../lib/Braintree.php");
$clientToken = Braintree_ClientToken::generate(); ?>
...
<script>
var clientToken = "<?php echo $clientToken; ?>";
braintree.setup(clientToken, "dropin", {
container: "payment-form"
});
</script>
和我結賬頁面上:
require_once("../lib/Braintree.php");
$nonce = $_POST["payment_method_nonce"];
$result = Braintree_Transaction::sale([
'amount' => "100",
'paymentMethodNonce' => $nonce,
'options' => [
'submitForSettlement' => True
]
]);
我嘗試刪除配置行,它的工作,但該帳戶商戶是不是我的,如果我設置的帳戶與銷售:
'merchantAccountId' => 'MyAccount',
或配置之前:
Braintree_Configuration::environment('sandbox');
Braintree_Configuration::merchantId('xxx');
Braintree_Configuration::publicKey('xxx');
Braintree_Configuration::privateKey('xxxxx');
但我有一個錯誤:例外需要趕上。
感謝您的幫助