简体   繁体   English

braintree - 使用过期的信用卡创建订阅而不会导致错误

[英]braintree - creating subscription with expired credit card not resulting in error

I am trying to test out subscriptions using Braintree and PHP. 我正在尝试使用Braintree和PHP测试订阅。 I am able to post transactions successfully, but I am running into this issue with subscriptions. 我能够成功发布交易,但我遇到了订阅这个问题。

Here are my steps: 这是我的步骤:
1. Create customer with the credit card attached 1.使用附加的信用卡创建客户
2. Create subscription for the customer 2.为客户创建订阅

Problem: 问题:
Step 1 or 2 both result in success even though the credit card I provided has an expiration date of Jan 2013. 即使我提供的信用卡的有效期为2013年1月,步骤1或2也都会成功。

I have followed the tutorial given on Braintree, with no luck or documentation help. 我已经按照Braintree上给出的教程,没有运气或文档帮助。 Any ideas? 有任何想法吗?

Thanks. 谢谢。

I work at Braintree. 我在布伦特里工作。 Feel free to contact our support team if you need more detailed help. 如果您需要更详细的帮助,请随时联系我们的支持团队

We don't check expiration date in our Sandbox environment. 我们不会在Sandbox环境中检查到期日期。 If we did, and you hardcoded an expiration date in your tests, they could fail after that date had passed. 如果我们这样做了,并且您在测试中硬编码了过期日期,那么在该日期过后它们可能会失败。

Instead, you use an amount equal to the desired processor response code to simulate failures: 相反,您使用等于所需处理器响应代码的数量来模拟故障:

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 0.01美元到1999.99美元之间的金额将模拟成功的授权
  • Amounts between $2000.00 - $2060.99 and $3000.00 - $3000.99 will decline with the > - coordinating Processor Response 通过> - 协调处理器响应,$ 2000.00 - $ 2060.99和$ 3000.00 - $ 3000.99之间的金额将下降
  • Amounts between $2061.00 - $2999.99 will simulate the generic decline message “Processor Declined.” $ 2061.00 - $ 2999.99之间的金额将模拟通用拒绝消息“处理器拒绝”。
  • Amounts $3001.00 and greater will also simulate a successful authorization 300美元及以上的金额也将模拟成功的授权

An expired card is processor response code 2004 : 过期的卡是处理器响应代码2004

Code    Text
2000    Do Not Honor
2001    Insufficient Funds
2002    Limit Exceeded
2003    Cardholder's Activity Limit Exceeded
2004    Expired Card

So setting the amount of your subscription to $2004.00 will cause it to fail as if the card were expired, regardless of the expiration date you use. 因此,将订阅金额设置为$ 2004.00将导致其失败,就像卡已过期一样,无论您使用的是何时到期。

This way, you can write your tests once, and have them keep working even after any expiration dates have passed. 这样,您可以编写一次测试,并使它们在任何过期日期过后继续工作。

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

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