-
Notifications
You must be signed in to change notification settings - Fork 69
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
Allow payment_intent_succeeded webhook to handle orders without intent_id attached #3118
Merged
daquinons
merged 13 commits into
develop
from
fix/s-1202-canceled-orders-successfully-paid
Oct 21, 2021
Merged
Allow payment_intent_succeeded webhook to handle orders without intent_id attached #3118
daquinons
merged 13 commits into
develop
from
fix/s-1202-canceled-orders-successfully-paid
Oct 21, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
daquinons
changed the title
WIP: Allow payment_intent_succeeded webhook to handle orders without intent_id attached
Allow payment_intent_succeeded webhook to handle orders without intent_id attached
Oct 14, 2021
… the order as early as possible
dmallory42
approved these changes
Oct 14, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and works well, thanks for working on this!
As mentioned via Slack, I think we should add a few GlobalStep flows to the next release for using the checkout and the blocks checkout purchasing a simple product, subscription product, etc.
6 tasks
4 tasks
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes 1202-gh-Automattic/woocommerce-payments-server
Changes proposed in this Pull Request
There has been a lot of reports in different merchants about a situation where an order was successfully paid in Stripe side, but canceled in WooCommerce (because of
woocommerce_hold_stock_minutes
).Find more about it and its investigation in the shared links here 1202-gh-Automattic/woocommerce-payments-server
This PR allows the webhook to obtain an order using the attached
order_id
in the metadata of the object, in case the intent_id was not properly attached into the order because of any racing condition.@dmallory42 has also contributed moving
attach_intent_info_to_order
andattach_exchange_info_to_order
higher in the execution to try to mitigate the racing condition as we spoke here p1634210077172300-slack-C0208C3BXHPTesting instructions
woocommerce-payments/includes/admin/class-wc-rest-payments-webhook-controller.php
Line 264 in 38dade9
$order = $this->wcpay_db->order_from_intent_id( "anything" );
in order to simulate getting an intent_id that we had no record of.intent_id not found, using order_id to retrieve order
, that indicates the webhook has gone into the new added logic.payment_complete
after the order was successfully retrieved using the webhook metadata.Post merge