Urgent: Payment Link Redirection Issue for Logged-In Repeat Customers
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page pleaseIf you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.
Quote from prince on February 10, 2025, 11:03Hello Team,
We’re experiencing an issue where the payment link in our emails is not redirecting correctly when your plugin is enabled.
Issue Details:
- The correct payment link should be: https://www.abc.com/checkout/booking-pay/176682/?pay_for_order=true&key=wc_order_zob6Q70cHaLLE
- However, when users click the "Click here to pay now" link, they are instead redirected to: https://www.abc.com/checkout/booking-pay/176682/?currency=ENC::QVVE
- This results in an error message: “Sorry, this order is invalid and cannot be paid for.”
- The issue occurs only for logged-in repeat customers.
- When the plugin is disabled, the redirection works correctly without any issues.
What We've Checked:
- The correct payment links are being sent via email.
- The issue only occurs when the plugin is active, and the user is clicking on the email link.
- It seems that the required parameters
?pay_for_order=true&key=wc_order_zob6Q70cHaLLEare getting removed or altered during redirection.- No GET data in link toggle is on in the Woocommerce Settings > Currency > Options
- Tested with Currency storage > Transient and FOX Session both and facing same issue
- Current Setting: https://ibb.co/sdtBs8dc
Could you please help me to investigate this issue? Let us know if there's a possible fix or adjustment to the setting to ensure the correct redirection so it won't add ?currency=ENC::QVVE.
Looking forward to your response.
Best regards,
Prince
Hello Team,
We’re experiencing an issue where the payment link in our emails is not redirecting correctly when your plugin is enabled.
Issue Details:
- The correct payment link should be: https://www.abc.com/checkout/booking-pay/176682/?pay_for_order=true&key=wc_order_zob6Q70cHaLLE
- However, when users click the"Click here to pay now" link, they are instead redirected to: https://www.abc.com/checkout/booking-pay/176682/?currency=ENC::QVVE
- This results in an error message: “Sorry, this order is invalid and cannot be paid for.”
- The issue occurs only for logged-in repeat customers.
- When the plugin is disabled, the redirection works correctly without any issues.
What We've Checked:
- The correct payment links are being sent via email.
- The issue only occurs when the plugin is active, and the user is clicking on the email link.
- It seems that the required parameters
?pay_for_order=true&key=wc_order_zob6Q70cHaLLEare getting removed or altered during redirection. - No GET data in link toggle is on in the Woocommerce Settings > Currency > Options
- Tested with Currency storage > Transient and FOX Session both and facing same issue
- Current Setting: https://ibb.co/sdtBs8dc
Could you please help me to investigate this issue? Let us know if there's a possible fix or adjustment to the setting to ensure the correct redirection so it won't add ?currency=ENC::QVVE.
Looking forward to your response.
Best regards,
Prince
Quote from Pablo Borysenco on February 10, 2025, 14:47Hello Prince
Can you drop me wp-admin access - https://share.pluginus.net/image/i20230222134241.png ->https://share.pluginus.net/image/i20230222134615.png
Hello Prince
Can you drop me wp-admin access - https://share.pluginus.net/image/i20230222134241.png ->https://share.pluginus.net/image/i20230222134615.png
Quote from prince on February 11, 2025, 04:44Hello @pavlo_borysenco
Access has been added.
Hello @pavlo_borysenco
Access has been added.
Quote from Pablo Borysenco on February 11, 2025, 13:40Hello
It seems that the problem is related to third-party booking functionality
We have done testing on several of our sites with standard orders - there is no such error. And our plugin does not contain code to change links in the email
Do you have a test site?
Hello
It seems that the problem is related to third-party booking functionality
We have done testing on several of our sites with standard orders - there is no such error. And our plugin does not contain code to change links in the email
Do you have a test site?
Quote from prince on February 11, 2025, 13:45Hello,
I currently don't have access to the test site. However, do you know how it's adding ?currency=ENC::QVVE to the URL? This way, we can find a solution to prevent it from happening! We're only using this plugin for currency conversion.
Hello,
I currently don't have access to the test site. However, do you know how it's adding ?currency=ENC::QVVE to the URL? This way, we can find a solution to prevent it from happening! We're only using this plugin for currency conversion.
Quote from prince on February 12, 2025, 05:03I am thinking to add below code into functions.php what's your thought on it?
function remove_currency_from_checkout_url($url) {
if (strpos($url, 'checkout/booking-pay') !== false) {
// Parse URL to separate query parameters
$parsed_url = parse_url($url);
if (!isset($parsed_url['query'])) {
return $url; // If no query string, return original URL
}// Convert query string into an array
parse_str($parsed_url['query'], $query_params);// Remove the currency parameter if it exists
unset($query_params['currency']);// Rebuild the query string without the currency parameter
$new_query = http_build_query($query_params);// Construct the final URL
$clean_url = $parsed_url['scheme'] . '://' . $parsed_url['host'] . $parsed_url['path'];
if (!empty($new_query)) {
$clean_url .= '?' . $new_query;
}return $clean_url;
}
return $url;
}
add_filter('woocommerce_get_checkout_payment_url', 'remove_currency_from_checkout_url', 20, 1);OR
function remove_currency_from_payment_redirect() {
if (is_checkout() && isset($_GET['currency'])) {
wp_redirect(remove_query_arg('currency'));
exit;
}
}
add_action('template_redirect', 'remove_currency_from_payment_redirect');- Keeps all original parameters (e.g., pay_for_order=true&key=wc_order_xyz)
- Only removes currency=ENC::QVVE
- Ensures proper redirection without breaking WooCommerce payment flow
I am thinking to add below code into functions.php what's your thought on it?
function remove_currency_from_checkout_url($url) {
if (strpos($url, 'checkout/booking-pay') !== false) {
// Parse URL to separate query parameters
$parsed_url = parse_url($url);
if (!isset($parsed_url['query'])) {
return $url; // If no query string, return original URL
}
// Convert query string into an array
parse_str($parsed_url['query'], $query_params);
// Remove the currency parameter if it exists
unset($query_params['currency']);
// Rebuild the query string without the currency parameter
$new_query = http_build_query($query_params);
// Construct the final URL
$clean_url = $parsed_url['scheme'] . '://' . $parsed_url['host'] . $parsed_url['path'];
if (!empty($new_query)) {
$clean_url .= '?' . $new_query;
}
return $clean_url;
}
return $url;
}
add_filter('woocommerce_get_checkout_payment_url', 'remove_currency_from_checkout_url', 20, 1);
OR
function remove_currency_from_payment_redirect() {
if (is_checkout() && isset($_GET['currency'])) {
wp_redirect(remove_query_arg('currency'));
exit;
}
}
add_action('template_redirect', 'remove_currency_from_payment_redirect');
- Keeps all original parameters (e.g., pay_for_order=true&key=wc_order_xyz)
- Only removes currency=ENC::QVVE
- Ensures proper redirection without breaking WooCommerce payment flow
Quote from Pablo Borysenco on February 12, 2025, 10:27Hello
However, do you know how it's adding ?currency=ENC::QVVE to the URL? - https://share.pluginus.net/image/i20250212102423.png
In order to fix this, you should find the source of this behavior. As I wrote above, my plugin does not have such functionality, so for the test, disable third-party plugins
Unfortunately I'm not sure this code will help.
Hello
However, do you know how it's adding ?currency=ENC::QVVE to the URL? - https://share.pluginus.net/image/i20250212102423.png
In order to fix this, you should find the source of this behavior. As I wrote above, my plugin does not have such functionality, so for the test, disable third-party plugins
Unfortunately I'm not sure this code will help.
Quote from prince on February 12, 2025, 11:35Hello @pavlo_borysenco,
Thank you for investigating this; it originated from the custom code. Mark this as issue resolved.
Hello @pavlo_borysenco,
Thank you for investigating this; it originated from the custom code. Mark this as issue resolved.
Quote from Pablo Borysenco on February 12, 2025, 12:07Great! Welcome;)
Great! Welcome;)