fre*_*rks 3 php sandbox braintree
我正在测试Braintree沙箱(PHP),即使我使用的是伪随机数据,交易仍然显示有效
我有一个dropin前端和一个PHP后端
我的后端测试代码如下所示:
$amount = '12.00';
$nonce = 'fake-processor-declined-visa-nonce';
$result = Braintree_Transaction::sale(['amount' => $amount,
'paymentMethodNonce' => $nonce,
'options' => ['submitForSettlement' => true]
]);
$debug = get_object_vars($result);
print_r($debug);
Run Code Online (Sandbox Code Playgroud)
结果
Array
(
[success] => 1
[transaction] => Braintree\Transaction Object
(
[_attributes:protected] => Array
(
[id] => 9bnyb32r
[status] => submitted_for_settlement
[type] => sale
[currencyIsoCode] => EUR
[amount] => 12.00
[merchantAccountId] => somenamehere
[subMerchantAccountId] =>
[masterMerchantAccountId] =>
[orderId] =>
[createdAt] => DateTime Object
Run Code Online (Sandbox Code Playgroud)
我保证这些假的小菜在沙箱中测试错误结果...还是我错过了一些东西
https://developers.braintreepayments.com/reference/general/testing/php#test-amounts