php – braintree – 使用过期的信用卡创建订阅而不会导致错误
作者:互联网
我正在尝试使用Braintree和PHP测试订阅.我能够成功发布交易,但我遇到了订阅这个问题.
这是我的步骤:
1.使用附加的信用卡创建客户
2.为客户创建订阅
问题:
即使我提供的信用卡的有效期为2013年1月,步骤1或2也都会成功.
我已经按照Braintree上给出的教程,没有运气或文档帮助.有任何想法吗?
谢谢.
解决方法:
我在布伦特里工作.如果您需要更详细的帮助,请随意使用contact our support team.
我们不会在Sandbox环境中检查到期日期.如果我们这样做了,并且您在测试中硬编码了过期日期,那么在该日期过后它们可能会失败.
相反,你use an amount equal to the desired processor response code模拟失败:
Test Amounts for Unsuccessful Transactions
When working with transactions, you can pass specific amounts to simulate different responses from the gateway.
- Amounts between $0.01 – $1999.99 will simulate a successful authorization
- Amounts between $2000.00 – $2060.99 and $3000.00 – $3000.99 will decline with the > – coordinating Processor Response
- Amounts between $2061.00 – $2999.99 will simulate the generic decline message “Processor Declined.”
- Amounts $3001.00 and greater will also simulate a successful authorization
过期的卡是processor response code 2004:
Code Text 2000 Do Not Honor 2001 Insufficient Funds 2002 Limit Exceeded 2003 Cardholder's Activity Limit Exceeded 2004 Expired Card
因此,将订阅金额设置为$2004.00将导致其失败,就像卡已过期一样,无论您使用的是何时到期.
这样,您可以编写一次测试,并使它们在任何过期日期过后继续工作.
标签:php,credit-card,braintree 来源: https://codeday.me/bug/20190718/1493343.html