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

Fix payment api endpoint url bug #25

Merged
merged 1 commit into from Jul 30, 2016
Merged

Fix payment api endpoint url bug #25

merged 1 commit into from Jul 30, 2016

Conversation

@TeemuSuoranta
Copy link
Contributor

@TeemuSuoranta TeemuSuoranta commented Mar 14, 2016

There's a bug in the payment api that causes orders log as waiting for payment even though payment is successfully done. The bug is caused by conflicting rewrite rules that make the permalink wrong. I make a filter for checkout payment url and remove these extra parts in the url which makes the payment api to work.

My solution isn't pretty and could use some regex magic but it does what it needs to do and it works.

You can debug the url by adding this in header of your theme:
global $woocommerce;
$order = new WC_Order($order_id);
var_dump($order->get_checkout_payment_url());

There's a bug in the payment api that causes orders log as waiting for payment even though payment is successfully done. The bug is caused by conflicting rewrite rules that make the permalink wrong. I make a filter for checkout payment url and remove these extra parts in the url which makes the payment api to work.

My solution isn't pretty and could use some regex magic but it does what it needs to do and it works.

You can debug the url by adding this in header of your theme:
global $woocommerce;
$order = new WC_Order($order_id);
var_dump($order->get_checkout_payment_url());
@hyyan
Copy link
Owner

@hyyan hyyan commented Jul 30, 2016

Thanks for the PR 👍

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

Successfully merging this pull request may close these issues.

None yet

2 participants