简体   繁体   English

Braintree不成功的信用卡验证不适用于我的代码

[英]Braintree Unsuccessful credit card verification is not working for my code

I am trying to test braintree single payment. 我正在尝试测试Braintree单笔付款。 All works fine and the code makes a transactions which I can see in the sandbox and also from response code. 一切正常,并且代码进行了交易,我可以在沙箱中看到,也可以从响应代码中看到。

But the problem is when I try to use one their 'Unsuccessful credit card numbers' it still process the transactions and gives me success as a response. 但是问题是,当我尝试使用他们的“不成功的信用卡号”时,它仍会处理交易并给我成功作为回应。

Here is the code I am using for making transaction. 这是我用于进行交易的代码。

$result = \Braintree\Transaction::sale([
        'amount' => $amount,
        'paymentMethodNonce' => $nonce,
        'options' => [
            'submitForSettlement' => true
         ]
      ]);

This code never gives error unsuccessful credit card verification number. 此代码绝不会提供错误的失败的信用卡验证码。 I tried to use verifyCard=true in the options array and gives me error. 我试图在options数组中使用verifyCard=true ,但给我错误。

Full disclosure: I work at Braintree. 全面披露:我在Braintree工作。 If you have any further questions, feel free to contact support . 如果您还有其他疑问,请随时与支持小组联系。

For you to have an unsuccessful credit card verification, it has to happen during a PaymentMethod::Create() call as :verify_card => true can't be passed in a Transaction.sale() call. 要使信用卡验证失败,它必须在PaymentMethod::Create()调用期间发生,因为:verify_card => true无法在Transaction.sale()调用中传递。 Therefore any testing cards in this section , will only fail during the attempt to make a payment method with the verify parameter used, not during a transaction. 因此,本节中的所有测试卡都只会在尝试使用验证参数进行付款的过程中失败,而不会在交易过程中失败。 If you want to only make a transaction and have it fail, try using a different amount that can trigger different failures as documented here: test amounts 如果您只想进行交易而失败,请尝试使用不同的金额来触发不同的失败,如此处所述: 测试金额

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM