Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple POST from SagePay-Notifier and error 5006 #155

Closed
kevin-ryser opened this issue Sep 14, 2020 · 3 comments
Closed

Multiple POST from SagePay-Notifier and error 5006 #155

kevin-ryser opened this issue Sep 14, 2020 · 3 comments

Comments

@kevin-ryser
Copy link

kevin-ryser commented Sep 14, 2020

Hi,

I keep having the error 5006 (Unable to redirect to Vendor's web site. The Vendor failed to provide a RedirectionURL.) while all the payments are actually working (my payment are confirmed and I get the following status message: 0000 : The Authorisation was Successful.)

My website is WordPress, I use (I tried returnUrl and/or both):
'notifyUrl' => site_url('/payment-confirm/')

The order complete page (simplified):
`$gateway = OmniPay::create('SagePay\Server');
$gateway->setVendor('myvendor');
$gateway->setTestMode(true);

$requestMessage = $gateway->completePurchase([
    'transactionReference' => $transaction_ref,
]);


try {
    $responseMessage = $requestMessage->send();
} catch(\Exception $e) {
    $requestMessage = $gateway->completePurchase([]);
    $responseMessage = new ServerCompleteAuthorizeResponse($requestMessage, []);
    $responseMessage->invalid(site_url('/order-completed/?error=true'), $e->getMessage());
}

if ($responseMessage->isSuccessful()) {
    // some stuff
}

$responseMessage->confirm(site_url('/order-completed/?pr=' . $payment_id));`

I can see as well that the SagePay-Notifier is doing multiple POST requests:
Screenshot 2020-09-14 at 12 40 31

Thanks a lot!!
Kevin

@kevin-ryser
Copy link
Author

Edit: This is happening on the testing environment and 3D secure if OFF, should I turn it on?

@kevin-ryser
Copy link
Author

Okay I found my error. Some HTML was printed in my "payment-confirm" page, my bad!

@judgej
Copy link
Member

judgej commented Sep 16, 2020

Errors in the confirm page is so hard to debug, because it is only SagePay that ever sees it. Glad you have a solution now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants