2

I am using realex payments for a one time payment page I have got to the stage where I am successfully seeing the payment page. I am running my solution in visual studio but when the realex site is trying to get back to my local host I am presented with this message

enter image description here

enter image description here

My Code in my form is as follows for asp.net vb.net

<form id="payform" method="post" action="https://pay.sandbox.realexpayments.com/pay">
<input type=hidden name="MERCHANT_ID" value="<%=strMerchantID%>">

<!-- Uncomment line below to test on merchant sandbox -->
   <input type=hidden name="ACCOUNT" value="internet"> 

<input type=hidden name="ORDER_ID" value="<%=strOrderID%>">
<input type=hidden name="AMOUNT" value="<%=strAmount%>">
<input type=hidden name="CURRENCY" value="<%=strCurrency%>">
<input type=hidden name="TIMESTAMP" value="<%=strTimeStamp%>">
<input type=hidden name="SHA1HASH" value="<%=strSHA%>">
<input type=hidden name="AUTO_SETTLE_FLAG" value="<%=strAutoSettleFlag%>">
<input type=hidden name="AC" value="<%=strAC%>">
<input type="hidden" name="COMMENT1" value="One Of Payment">
 <input type="hidden" name="MERCHANT_RESPONSE_URL" value="http://localhost:52448/dynamic/OneTimePaymentRealexResponse.aspx">


You are being taken to the secure card payment page.
<br /><br />

<input type="submit" value="Go to Payment">
</form>

I am setting the various variables in the code behind and I am presented with the payment page upon submission so I no that is working right, I also made the port open on my local development machine but still releax presents me with that error message

localhost:52448/folder/onetimepayment.aspx?cust=&amount=150&&curr=GBP

Relex has set the merchant response in the account to this for sandbox.

<input type="hidden" name="MERCHANT_RESPONSE_URL" value="http://localhost:52448/folder/OneTimePaymentRealexResponse.aspx">

I used the word folder to mask my real path for security reasons, while sharing my code.

Has anyone been successful in setting this up on their local dev machine as I obv want to test what comes back from the response object and insert into database.

1 Answers1

1

Thanks for your question. In order for our HPP to communicate with the Response URL it must be accessible over the internet - publicly accessible as such.

If you're running your application on localhost, you can use port forwarding to allow HPP to access an endpoint that then maps to your localhost.

Alternatively, if you are loading the HPP in an iFrame you can use the field HPP_POST_RESPONSE in the request. You have to provide the domain address as the value, so for example https://localhost:60545. If your port keeps changing you can supply '*' as a value but don't use this in a Production environment,

Using this field will trigger the HPP to POST the response back to the parent frame and you can use a Listener to grab it. Please refer to https://developer.realexpayments.com/#!/hpp/customization/hpp-iframe-webview-optimization for more information.

Hope that's helpful.

Best.

Seán

Realex Payments

Global Payments
  • 500
  • 2
  • 10
  • Its now working but this was advised by graham at your support desk not here chatting to them now as well sean –  Aug 24 '17 at 11:49
  • Yes our support team should be able to advise no problem. – Global Payments Aug 24 '17 at 16:42
  • Do I need to provide a reponse URL? Your FAQ mentions that it's otherwise just posted to the parent? – Spurious May 17 '18 at 20:29
  • Depending on your implementation, you can use either HPP_POST_RESPONSE (ideal for iFrames) or MERCHANT_RESPONSE_URL (more suited for full redirect solutions). – Global Payments May 18 '18 at 09:31
  • What should be the explanation for the HPP_POST_RESPONSE to post to an invalid url? If I provide `https://local.paymentsjs.io` I am getting an error `Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://local.paymentsjs.io%2Chttps') does not match the recipient window's origin ('https://local.paymentsjs.io').`. It seems it's adding a `,https` at the end of the domain I provided? – peppeocchi Nov 27 '18 at 16:09
  • I'm unsure where that "%2Chttps" could be coming from. Are you using our JS LIbrary? Can you see when that value gets populated into that field? – Global Payments Dec 12 '18 at 19:20