Realex payments error 505 “You cannot use this service from there”

September 2, 2008

Did a booking engine for a hotel lately, and I wanted to record the booking details before redirecting the user to the payment processor’s site (realex in this case), so the final form was submitted to my own application, then I used php’s curl functions to get the payment page from realex.

In the response from realex’s server to the http request sent by curl I was getting an error with error code 505 and the message “You cannot use this service from there”. Before payment goes live for an account, realex asks for the url that you’ll be redirecting to their system from (the “incoming url”, they call it) and then they reject requests from any other “incoming url”. What this means, it turns out, is they check the “Referer” header in your incoming http request and make sure it matches the “incoming url” you’ve supplied to them. The request I was sending via curl wasn’t sending a “Referer” header, hence the error. Solved the problem like this:

$ch = curl_init(PAYMENT_PAGE_URL);
curl_setopt($ch,CURLOPT_HTTPHEADER,array("Referer: <myurl>"));

2 Responses to “Realex payments error 505 “You cannot use this service from there””

  1. Sean Owens Says:

    this error occurs when the site is moved to a new hosting server and a new ip address. Realex have to be informed of the new ip address to accept the payments from. Once this happens this 505 will go away.

    Sean Owens

    Willows Consulting Online Payment Specialists.

  2. cormacscode Says:

    Hi Sean

    You are right in that if you’re using realex remote and you move host then you need to inform realex of the new IP address of your server or else you will get a 505

    … but there are lots of different ways you can get this error. The case above was quite specific – I got a 505 in response to a realex redirect request that I was using curl to send, because I hadn’t set the “Referer” header in the HTTP request.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: