Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simulating Errors on the Amazon FPS sandbox

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 :) Thanks guys!

like image 613
Henry Avatar asked Nov 13 '22 16:11

Henry


1 Answers

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.

like image 136
Doug Kavendek Avatar answered Dec 22 '22 10:12

Doug Kavendek