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

WooCommerce order IDs should be database IDs instead of display IDs #80

Open
Resonious opened this issue Nov 30, 2022 · 0 comments · May be fixed by #81
Open

WooCommerce order IDs should be database IDs instead of display IDs #80

Resonious opened this issue Nov 30, 2022 · 0 comments · May be fixed by #81
Assignees

Comments

@Resonious
Copy link
Member

Resonious commented Nov 30, 2022

The problem

WC merchants can change the format of order numbers. Unfortunately, when they do so, it breaks this plugin's ability to process webhooks for old orders.

In short, this plugin is using order display IDs to associate KOMOJU payments with WC orders. It should use database IDs instead if possible.

Possible fix

This is where we save the order ID on the KOMOJU session

'woocommerce_order_id' => $order->get_order_number(),

This is where we use the saved order ID

$order = wc_get_order($session->metadata->woocommerce_order_id);

I think we can change the get_order_number to be get_id. The wc_get_order function can probably stay the same. In the docs, it says you can pass "Post object or post ID of the order".

@FTLam11 FTLam11 linked a pull request Dec 7, 2022 that will close this issue
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 a pull request may close this issue.

2 participants