1

I managed to navigate to realex hpp. I fill all data and the transaction seems to work ok but when it should redirect to my page it does not. It write some part of my application inside realex-hpp page.

Here is the form I'm using to navigate. The response_url is a valid url, I tried several times.

<form action="https://pay.sandbox.realexpayments.com/pay" method="POST" 
id="payment-gateway" name="payment-gateway" accept-charset="UTF-8">
<input type="hidden" name="MERCHANT_ID" id="MERCHANT_ID" value=">>
<merchant_id>"/> 
<input type="hidden" name="TIMESTAMP" id="TIMESTAMP" value="20170824103739" 
/> 
<input type="hidden" name="ACCOUNT" id="ACCOUNT" value="internet" /> 
<input type="hidden" name="ORDER_ID" id="ORDER_ID" 
value="eRz4N2PLTMOoc8sO1nlSlA" /> 
<input type="hidden" name="AMOUNT" id="AMOUNT" value="12657" /> 
<input type="hidden" name="CURRENCY" id="CURRENCY" value="EUR" /> 
<input type="hidden" name="SHA1HASH" id="SHA1HASH" 
value="b279a662b6f3e84173454537f94ef4fcb5174d7b" /> 
<input type="hidden" name="AUTO_SETTLE_FLAG" id="AUTO_SETTLE_FLAG" value="1" 
/> 
<input type="hidden" name="MERCHANT_RESPONSE_URL" id="MERCHANT_RESPONSE_URL" 
value="<response_url>" /> 

Here is what I see insted the redirection.

https://i.stack.imgur.com/Lb36w.jpgscreenshot

Albert Lazaro de Lara
  • 2,540
  • 6
  • 26
  • 41
Javier
  • 11
  • 3

2 Answers2

3

Thanks for your question. When the HPP connects to your Response URL, it sends the response values but also "looks" at that URL and will display any content that resides on that page - effectively acting like a browser.

With this in mind, a typical implementation of the Response URL will do the following:

  1. Take in the response values - this is a server-side operation
  2. Based on the transaction result (for example, result=00) redirect the customer's browser to a success or failure page

You can use a simple JavaScript redirect for point 2 above.

Best,

Seán

Realex Payments

Global Payments
  • 500
  • 2
  • 10
  • I want response in client side only, So what should I do for it, I got transaction success but not getting response, So i want response in client side only How can I archive this, Can you please guide me ? – Gaurav Radadiya May 16 '20 at 11:32
3

I just had the exact same problem, the HPP displayed the website's content without any css. Fixed it by creating a new endpoint that accepts a POST and then using javascript to redirect use on the client-side instead.

    [Route("thankyou")]
    [HttpPost]
    public ContentResult RerouteToThankYouPage()
    {
        return Content($"<script language='javascript' type='text/javascript'>window.location.replace(\"{_options.PageEndpoint}\");</script>");
    }
Raze
  • 75
  • 9
  • Thanks! This worked for me there. I got the hint about using JS here https://stackoverflow.com/a/72499162/2474687 - the full solution is there now. – Josef Habr Jun 05 '22 at 16:38