简体   繁体   English

Braintree测试,无法让Braintree拒绝卡片

[英]Braintree testing, can't get braintree to reject card

It must be something simple but I'm pulling my hair out. 一定很简单,但我正在拔头发。 When I call this 当我打电话给这个

$data = [
        'amount' => '50.00',
        'paymentMethodNonce' => 'fake-processor-declined-mastercard-nonce',
        'options' => [
            'submitForSettlement' => true
        ]
    ];

    $result = Braintree_Transaction::sale($data);

I get back "success" from Braintree. 我从Braintree找回“成功”。 How do I get the card declined? 我如何获得拒绝的卡?

So it turns out that on the Braintree_Transaction::sale method using the fake-nonce isn't the way you do it. 事实证明,在Braintree_Transaction::sale方法上使用伪随机数并不是您的处理方式。 You do it with the amount. 您用金额来做。 You match the amount to the error code you want to produce. 您将金额与要生成的错误代码相匹配。 So an amount of 2001.00 will get a response of "Insufficient Funds" . 因此,金额2001.00将会收到"Insufficient Funds"的响应。 A list of error codes can be found here 错误代码列表可以在这里找到

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

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