5

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.

starball
  • 20,030
  • 7
  • 43
  • 238
Henry
  • 3,447
  • 1
  • 15
  • 12
  • 2
    OK, well further review of the documentation revealed the error testing you can do so I figured I would put it up here if anyone else was wondering: http://docs.amazonwebservices.com/AmazonFPS/latest/FPSAccountManagementGuide/CHAP_Sandbox.html – Henry Sep 29 '11 at 17:47
  • Thats indeed the correct solution. – floriank Mar 13 '12 at 21:31
  • It's a nice idea, shame it's so limited. There's a lot of scenarios with other services I'd like to simulate too such as with subscriptions. – DanH May 29 '13 at 08:30

1 Answers1

1

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:

Closed account: Z1LGRXR4HMDZBSFKXELA32KZASGWD8IHMHZCK4DETR784LDLD1GMFW4P3WT8VTGX

Email address not verified: E3FR7BARJV3PB631PMKV74PGKCJLBHI1Q1KMQN7BJ2JJICPDKN3N1CJIKFZ8D7NN

Suspended account: H216UECZ8ZM1G8G4QA3V7RKF8JDFZ9SI3SJAFSGUKBBNDHX1NVM8GUQRZNRNAHER

The following errors can be simulated by setting the value for RecipientTokenId:

Closed account: P1LL7A1LHK935DBGI5NAYCXOCLVEBHBNIU7PBXBAMRKKNLDEPI8M3MUSLZT2VANZ

Email address not verified: C4LGSEMXN11FTUXZ2X2C7QVFHN5DVBGQJNF17AIQXXXQSX4DRG4KJFCN2KRFUUZI

Suspended account: R3VK49XVGCAZTJSXKN7ZSBHPMFGKM5VEEQTXGMVE8CFUZ2G5RLLMAB4J6TQRL6BU

And finally, setting the amount value such that it includes a decimal value between the following values will simulate the following errors:

Temporary Decline: .60 to .69

Payment Error: .70 to .89

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.

Community
  • 1
  • 1
Doug Kavendek
  • 3,624
  • 4
  • 31
  • 43