模拟 Amazon FPS 沙盒上的错误
我已经设置了我的亚马逊灵活支付沙箱帐户,并一直在使用 PHP 库来模拟接受付款等。
我只是想知道是否有人知道一种方法来模拟我预计会遇到的实际错误情况,例如当有人运行一张被拒绝的卡时会发生什么。
API 指南确实告诉您将返回哪些状态代码,并且告诉我我必须信任它们,但我总是喜欢尽可能多地进行测试。
I've set up my Amazon flexible payments sandbox account and have been using the PHP library to simulate accepting payments and what not.
I was just wondering if anyone knew of a way to simulate realistic error conditions I would expect to encounter, such as what happens when someone runs a card that gets declined.
The API guide does tell you what status codes will be returned, and something tells me I just have to trust them, but I always like to test as much as possible if possible.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
答案的链接位于此处的评论中,但获得带有摘要的实际答案也没什么坏处。 高级快速入门指南中提供了有关在测试沙箱中模拟错误条件的详细信息。
通过设置 SenderTokenId 的值可以模拟以下错误:
可以通过设置 RecipientTokenId 的值来模拟以下错误:
最后,设置金额值,使其包含以下值之间的十进制值,将模拟以下错误:
不幸的是,最后的详细信息可能已过时。 此页面似乎暗示小数点后有 7 或 8 将产生非常通用的“失败”。通过测试,我可以确认 0.6 确实会导致暂时失败(状态会停留在“待处理”一段时间,然后最终前进到“成功”),而 0.7 和 0.8 会导致相同的“TransactionDenied”错误。
A link to the answer is in the comments here, but it wouldn't hurt to have an actual answer with a summary. There's details about simulating error conditions in the testing sandbox in the advanced quick start guide.
The following errors can be simulated by setting the value for SenderTokenId:
The following errors can be simulated by setting the value for RecipientTokenId:
And finally, setting the amount value such that it includes a decimal value between the following values will simulate the following errors:
Unfortunately, that last detail may be out of date. This page seems to imply that having 7 or 8 after the decimal point will create the terribly generic "Failure". From testing, I can confirm that 0.6 does lead to a temporary failure (status is stuck in "Pending" for a while before eventually advancing to "Success"), and 0.7 and 0.8 result in the same "TransactionDenied" error.