Search code examples
javascriptreactjspayment-gatewaypayeezy

How to get transaction results from payeezy payment gateway to my website - firstdata Payeezy?


I am trying to implement the FirstData - Payeezy payment gateway for card transactions in my website, once the user clicks pay button, the Hosted Checkout page (Payeezy payment gateway is opened).

Sample code how I opened the payeezy gateway page:

<form action="https://checkout.globalgatewaye4.firstdata.com/payment" method="post"> 

  <input name="x_login" value="WSP­EXA­001­01" type="hidden"> 

  <input name="x_amount" value="1.23" type="hidden"> 

  <input name="x_fp_sequence" value="123456" type="hidden"> 

  <input name="x_fp_timestamp" value="1191600622" type="hidden"> 

  <input name="x_fp_hash" value="4b04d15ccd9007658c2dadc679899ec4" type="hidden"> 

  <input name="x_show_form" value="PAYMENT_FORM" type="hidden"> 

  <input value="Checkout" type="submit"> 

</form>

And in here, I am able to make the card transaction successfully also I can see the receipt printed in the gateway.

But, I want the transaction result details back to my website . So How do I retrieve them ?

I am following this official manual, https://support.payeezy.com/hc/en-us/articles/203992129-Hosted-Checkout-Payment-Pages-Integration-Manual

And also I have gone through the manual, there are few things called as silent post and relay response using which I have to receive the transaction details but I couldn't figure how to implement those two techniques?

Note: I am using react js as front end and node js as backend. And I am using sandbox account


Solution

  • Disclaimer: I don't use that API, so this is based on docs only:


    In the link you posted, they explain the differences in How do I choose between Receipt Link, Silent Post, and Relay Response

    The "Link" options require user action (clicking a link) with the exception of the automatic REDIrect.

    Note: As stated in the docs (emphasis mine):

    This method is most ideal for merchants doing a small number of transactions per day that don't mind using the First Data Payeezy Gateway Real-time Payment Manager (RPM) to reconcile data later.

    That's likely a security warning because browser based GET/POST payloads can easily be inspected (and likely spoofed). Hence, the "source of truth" for transaction data is in their RPM

    Relay Response and Silent Post aren't link/redirect/browser based, they are server to server request/response flows and give you more flexibility. Essentially, these options require you to have a "listener" on your server that processes data from Payeezy - where the former (Relay Response) requires a "handshake" - re: your server must respond to Payeezy with HTML that they'll display to end user. IINM, Silent Post doesn't need a handshake, and only an HTTP 200.

    Details for implementation/choosing are in the links provided. I'd suggest looking for information on retries etc. (if not in docs). This is so you know what to do if/when your server (the "listener") cannot respond to Payeezy, for whatever reason, at the time of the transaction.

    Hth.