SagePayments / Direct-API

0 stars 0 forks source link

adding ach samples to Direct API repository #14

Closed thlinux1107 closed 6 years ago

thlinux1107 commented 6 years ago

adding ACH samples to Direct API repository

rflores76 commented 6 years ago

ACH samples for the Direct API were reviewed on 10/03/17. The Account Updater sample for the Direct API was reviewed on 10/30/17.

nishakul29 commented 6 years ago

Hi,

I have downloaded above sample code and run the application (C#). Every time I got the "Invalid HMAC" error as below,

image

Please suggest for the same.

Regards, Nishant.

thlinux1107 commented 6 years ago

Nishant,

I've replied through the email chain you began with us back on 11/15. I will summarize here as well.

I just downloaded the sample and ran it without any changes and successfully process a request (included below). The only item I can think of that can vary without any changes made to the code is the timestamp as that is created based on the system where the code is running. This is also the case for the API Sandbox. Our tolerance for the timestamp is fairly small. I would recommend making sure your system matches internet time within a few seconds. This is not an unusual requirement for secure requests within the payment industry.

Request: {"Ecommerce":{"OrderNumber":"Invoice 318","Amounts":{"Total":"7"},"CardData":{"Number":"5454545454545454","Expiration":"1220"}}}

Result: Server Status Code: Created Server Status: Created API Response: {"status":"Approved","reference":"FBGH9KnFO0","message":"APPROVED 000007","code":"000007","cvvResult":"P","avsResult":"Y","riskCode":"00","networkId":"10","isPurchaseCard":false,"orderNumber":"Invoice 318","timestamp":"2017-11-16T09:20:48.5251208-05:00"}

SDKSupport