1
votes

I am trying to apply the Server Inframe integration (v3.00) with low profile (with iframe) in test environment. All seems to work fine until the "Please wait while your transaction is being authorised with the bank" message.

After it, I get an 5006 error: Unable to redirect to Vendor's web site. The Vendor failed to provide a RedirectionURL.

But RedirectionURL is correct because I can receive at this page the posts sent by SagePay (Status=OK/ABORT/REJECTED/ERROR/... and others datas ).

To close the process properly, I have to reply to SagePay' s server three "plain text" datas, ( for instance: Status=OK, SatusDetail=Thank you for this order, and RedirectURL=https://mySite.com/youpi.php ). The encoding must be Name=Value fields separated by carriage-return-linefeeds (CRLF).

I would ask you if you have any idea or example of how to write this part of code with Php?

I have tried these lines unsuccessfully in my php page:

header("Content-type: text/plain");
$redirect_url="Status=OK" . chr(13) . chr(10) ;
$redirect_url.="RedirectURL=https://mySite.com/redirectOK" . chr(13) . chr(10) ;
$redirect_url.="StatusDetail=Thank you." . chr(13) . chr(10) ;
echo $redirect_url;

I note that the NotificationURL is called eleven times, which is conformed with the process behaviour when no response sent back.

Here the datas (Status and StatusDetail) of each posts' set received from the server:

set 1: Status="OK" StatusDetail="2014 : The Transaction was Registered Successfully."
set 2 to 10: Status="OK" StatusDetail="0000 : The Authorisation was Successful."
set 11: Status="ABORT" StatusDetail="2008 : The Transaction timed-out."

I don't reply to the SagePay server's posts for the moment because I don't see / I don't know how to do it!

Thank you in advance for your help!

1

1 Answers

2
votes

It's ok now. I have gotten the answer in the old php kit for version 2.23.

The script now:

if ($Status=="ABORT")
  {
    ob_flush(); // THIS LINE WAS MISSING 

    header("Content-type: text/plain");
    $redirect_url="Status=OK"  . chr(13) . chr(10)  ;
    $redirect_url.="RedirectURL=https://mySite.com/redirectCANCEL"  . chr(13) . chr(10)  ;
    $redirect_url.="StatusDetail=Thank you."  . chr(13) . chr(10)  ;
    echo $redirect_url;

    exit(); // THIS LINE WAS MISSING TOO
   }