Appendix B
Sample data of the sale request:
action | SALE |
async | N |
client_key | ZPR2ZH2J2U |
order_id | ORDER-12345 |
order_amount | 1.99 |
order_currency | USD |
order_description | Product |
card_number | 4111111111111111 |
card_exp_month | 01 |
card_exp_year | 2020 |
card_cvv2 | 000 |
payer_first_name | John |
payer_last_name | Doe |
payer_address | Big street |
payer_country | US |
payer_state | CA |
payer_city | City |
payer_zip | 123456 |
payer_email | [email protected] |
payer_phone | 199999999 |
payer_ip | 123.123.123.123 |
term_url_3ds 1 | http://client.site.com/return.php |
recurring_init | Y |
hash | 02cdb60b5c923e06c1b1d71da94b2a39 |
The hash above was calculated for CLIENT_PASS equal to qH0AHYFkgTURksztWZxUZUydwFOmiBHZ
Sample curl request:
curl -d "action=SALE&client_key=ZPR2ZH2J2U&order_id=ORDER- 12345&order_amount=1.99&order_currency=USD&order_description=Product&card_number
=4111111111111111&card_exp_month=01&card_exp_year=2020&card_cvv2=000&payer_first
_name=John&payer_last_name=Doe&payer_address=Big Street&payer_country=US&payer_state=CA&payer_city=City&payer_zip=123456&payer_em [email protected]&payer_phone=199999999&payer_ip=123.123.123.123&term_url_3ds= http://client.site.com/return.php&recurring_init=Y&hash=02cdb60b5c923e06c1b1d71d a94b2a39" https://test.apiurl.com -k
Sample response (synchronous mode)
The response if the sale is successful:
{"action":"SALE","result":"SUCCESS","status":"SETTLED","trans_id":"03346-89217-70541","order_id":"ORDER-12345","descriptor":"test","trans_date":"2012-04-03 16:02:01","recurring_token":"a1a6de416405ada72bb47a49176471dc"}
The response if the sale is unsuccessful:
{"action":"SALE","result":"DECLINED","status":"DECLINED","trans_id":"03346-89214-54141","order_id":"ORDER-12345","trans_date":"2012-04-03 16:02:01","decline_reason":"Declined by processing"}
The response if the transaction supports 3D-Secure:
{"action":"SALE","result":"REDIRECT","status":"3DS","trans_id":"03346-89225- 87891","order_id":"ORDER-12345","trans_date":"2012-04-03 16:02:02","redirect_url":"https:\/\/server_3ds.com/3ds.php","redirect_params":{" PaReq":"bc5865698ae46de4eba4c51f0359a714","MD":"111111111111111111111","TermUrl"
:"https:\/\/term_url.com/3ds\/67c14e5?trans_id=03346-89225- 87891&hash=8b98db60fb3c24c14a6d7075241da38b"},"redirect_method":"POST"}
In case error:
{"result":"ERROR","error_message":"Error description"}
Sample response (asynchronous mode)
{"action":"SALE","result":"ACCEPTED","trans_id":"03346-89211- 86461","order_id":"ORDER-12345","trans_date":"2012-04-03 16:02:01"}
In case error:
{"result":"ERROR","error_message":"Error description"}
Sample recurring sale request:
curl -d "action=RECURRING_SALE&client_key=ZPR2ZH2J2U&order_id=ORDER-12345 &order_amount=1.99&order_description=Product&recurring_first_trans_id=03346- 89217-70541&recurring_token=a1a6de416405ada72bb47a49176471dc&hash= 02cdb60b5c923e06c1b1d71da94b2a39" https://test.apiurl.com -k
Sample response
{"action":"RECURRING_SALE","result":"SUCCESS","status":"SETTLED","trans_id":"033 46-89220-33511","order_id":"ORDER-12345","descriptor":"test","trans_date":"2012- 04-03 16:02:02"}
Sample schedule request:
curl -d "action=SCHEDULE&client_key=ZPR2ZH2J2U&order_id=ORDER-12345 &order_amount=1.99&order_description=Product&recurring_first_trans_id=03346- 89217-70541&recurring_token=a1a6de416405ada72bb47a49176471dc&period=30 &init_period=5×=10&hash=02cdb60b5c923e06c1b1d71da94b2a39" https://test.apiurl.com -k
Sample response
{"action":"SCHEDULE","result":"SUCCESS","status":"ENABLED","trans_id":"03346- 89220-33511","order_id":"ORDER-12345"}
Sample deschedule request:
curl-d "action=DESCHEDULE&client_key=ZPR2ZH2J2U&recurring_first_trans_id=03346- 89217-70541 &recurring_token=a1a6de416405ada72bb47a49176471dc &hash=02cdb60b5c923e06c1b1d71da94b2a39" https://test.apiurl.com -k
Sample response
{"action":"DESCHEDULE","result":"SUCCESS","status":"DISABLED","trans_id":"03346- 89220-33511","order_id":"ORDER-12345"}
Sample creditvoid request:
curl -d "action=CREDITVOID&client_key=ZPR2ZH2J2U&trans_id=03346-89211-86461 &amount=10.00&hash=6b957fca41c353ac344fcad47f0cbf97" https://test.apiurl.com -k
Sample response
{"action":"CREDITVOID","result":"ACCEPTED","trans_id":"03346-89211- 86461","order_id":"ORDER-12345"}