0

We have been experiencing a bug with PayPal sending a order cancelled message to Magento, then sending a order paid message. But because Magento got the cancelled message it cancels the order (and ignores the paid message). It was happening very rarely but it happened twice in the last week. A few people seem to have the same issue on the magento forms with one (only) solution was to ingorre PayPal cancel message using the code (in the index.php file):

    if (strpos($_SERVER["REQUEST_URI"], '/paypal/standard/cancel') !==  false) {
header("Location: http://<your customer gets redirected here>");
die();   
}

But we have 2 website running on our Magento ( different domains), can I get it to return the homepage (base url) of the site the user is/was, using (so the get returned to the correct homepage?

1 Answer 1

1

Since June 2014 both absolute and relative URLs are allowed RFC 7231

So I can just have:

 if (strpos($_SERVER["REQUEST_URI"], '/paypal/standard/cancel') !==  false) {
header("Location: /checkout/cart/"); 
 die();   
}

Which will work for all site views. (obvious now)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.