69
Views
11
Comments
Response from Payment Gateway
Question
Application Type
Reactive

Hello,

I am using the eGHL Payment Gateway, which returns me response like messages, status updates, and other data.

All this Data, eGHL gives me through response URL, but all the data is Hidden inside that URL 

Can anyone tell me how I can read the hidden data from that URL in JSON and store it in the database?

2024-05-08 06-29-37
Prince Aadil Khan Panwar

Hi @Nihil Gujar 

can you please share the screenshot of the response so would be able to have more understanding.

Regards,

Prince

2022-12-05 07-28-20
Nihil Gujar

Hello,

this is just a sample 

and the response URL is our Outsystems Screen URL, where I want to show all the responses.

eGHL gives response data through "Form Post" that's why data is hidden in URL 

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Nihil,

If the payment gateway calls the screen, how do want to show it to the user? If the gateway does a GET or POST, the output of that call will be sent to the gateway, not to the user.

2019-09-30 07-35-56
Aurelio Junior

Hi Kilian,

Considering that this is a payment gateway, I assume that a request is sent with the payment details, and the gateway then sends a response with a "Location" header, which in this case is the OS screen with all the parameters.

2019-09-30 07-35-56
Aurelio Junior

Hello,

From what I can understand, the payment gateway is calling your application's screen passing a set of values via the URL, correct? If that is the case, can't you simply add all those values as input parameters to your screen?

To decode the URL values, you can use the "URLDecode" action:

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

I don't think there's any URL decoding needed, as the Platform handles that itself (for input parameters).

UserImage.jpg
Taimour Ahmed

You're dealing with the eGHL Payment Gateway, which sends you important stuff like messages and updates through a response URL. But here's the twist – the data you need is hidden in that URL.


To get this hidden data and save it in your database, you'll need to do a few things:


Catch the URL: First off, you need to grab that response URL where eGHL sends the data. This usually happens when a payment process finishes, and eGHL redirects to a URL you've given them.


Read the Data: The hidden data is likely sent as query parameters in the URL or through a method known as POST. If it's in the URL, it'll look something like www.yoursite.com/response?data1=something&data2=somethingElse. If it's POST, the data is tucked away and not visible in the URL.


Convert to JSON: To make the data easier to handle, you'll want to convert it into JSON format. This is like turning it into a neat, organized list that your computer understands better.


Store in Database: Now, take that neat JSON data and put it into your database. This step depends on what database you're using. It could be as simple as an INSERT command if you're using SQL.


Here’s a little more detail, depending on the method:


If it’s in the URL (GET method): In your web application, where you handle the response URL, write some code to parse the URL and extract the data. Most programming languages have easy ways to do this.


If it’s POST method: You'll need to write some code on the server side to catch this data. It’s like opening a little package that’s been sent to your door. Once you open it, convert it to JSON, and voila!

2022-12-05 07-28-20
Nihil Gujar

Can you please send me that code that catches the hidden data from the URL in C# so I can create one extension and use it?

(Its POST method)

I got one code as well, but I did not understand where I was supposed to use it.

Am I supposed to use this code on the On Initialize of Response Screen, where eGHL sends a response?



Example.txt
2019-09-30 07-35-56
Aurelio Junior

Hi Nihil,

Take a look at this post, which I think has a solution for your scenario. So in summary, what you would have to do is:

  1. Have the gateway redirect to a REST endpoint (with POST method), instead of your screen.
  2. In that REST API method you have to:
    1. Set the status code to 302.
    2. Add a header with the name "Location" and whose value is the full URL to your screen, including all the input parameters you need.
2022-12-05 07-28-20
Nihil Gujar

Hello,

Demo:

Here I am Exposing One API with suppose 2 input Parameters NAme and age 

And One Form is submitted with NAme and age 

When I click the Save button, I will be redirected to the API's URL.

Are you trying to say that? Kindly let me know if I am doing something incorrectly.

Thanks 

 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.