Wrong order confirmation page URL
-
Hello,
When an order is paid for using Vipps MobilePay, the order confirmation page URL is wrong and customers get redirected to the WC Shop page.
Here’s an example.
Let’s say the default WC checkout page is https://server.com/kasse-standard/ and the Vipps checkout page URL is https://server.com/kasse/. We use the Alternative Vipps MobilePay Checkout screen, which replaces the standard checkout page.
When a non-subscription product is purchased and customers return to the website (from the Vipps payment screen, https://apitest.vipps.no/dwo-api-application/v1/deeplink/vippsgateway…) they get to https://server.com/kasse/order-received/XXX/?key=YYY instead of https://server.com/kasse-standard/order-received/XXX/?key=YYY.
The page https://server.com/kasse/order-received/XXX/?key=YYY doesn’t exist and customers are redirected to the WC Shop page, which in our case is https://server.com/produkt/.
If we register calls to the “template_redirect” hook, the redirects look like this:
- Current URL: https://server.com/kasse/order-received/XXX/?key=YYY
Referer: https://apitest.vipps.no/ - Current URL: https://server.com/produkt/
Referer: https://apitest.vipps.no/ - Current URL: https://server.com/produkt/
Referer: https://server.com/produkt/
The workaround that we currently use is:
add_filter('woocommerce_get_return_url', 'my_woocommerce_get_return_url', 100, 2);
function my_woocommerce_get_return_url($return_url, $order){
$checkout_url = get_permalink(get_option('woocommerce_checkout_page_id'));
$return_url = wc_get_endpoint_url('order-received', $order->get_id(), $checkout_url);
$return_url = add_query_arg('key', $order->get_order_key(), $return_url);
return $return_url;
}But it would be great if you could tweak the plugin code and release an update.
——————————————————————
The described issue doesn’t occur with subscription products. When the Vipps/MobilePay Recurring Payments gateway is used, the
woocommerce_get_return_urlfilter is never used. - Current URL: https://server.com/kasse/order-received/XXX/?key=YYY
You must be logged in to reply to this topic.