asp.netvb.netrealex-payments-api

Trying to Test Relex Payments response object but site cannot contact machine


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.


Solution

  • 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