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

Replace special chars in confirmation URL #444

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

anyakro
Copy link
Contributor

@anyakro anyakro commented Jan 16, 2025

Not sure if this could mess things up in other environments?

Can be tested in staging environment linked in related ClickUp task.

Copy link
Contributor

@MichaelBengtsson MichaelBengtsson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets look at this a bit more and discuss with Klarna regarding this issue before we make a fix. We would need to make sure that Klarna actually are able to support this before we try to solve it.

@@ -36,7 +36,7 @@ public function get_body() {
$order = wc_get_order( $this->arguments['order_id'] );
$body['merchant_reference1'] = $order->get_order_number();
$body['merchant_reference2'] = $order->get_id();
$body['merchant_urls']['confirmation'] = $order->get_checkout_order_received_url();
$body['merchant_urls']['confirmation'] = preg_replace( '#/[^/]+/order-received/#', '/checkout/order-received/', $order->get_checkout_order_received_url() );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can not be sure that the URL is checkout/order-received. This might be different for other stores, its only the default page that WooCommerce creates initially that is called checkout, if a merchant makes a new page with a new name this will also be changed. So this is not a valid solution for this. I think we need to do some more testing before we can solve this issue, if its something we should solve.

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

Successfully merging this pull request may close these issues.

2 participants