Handling charge expiration webhooks #3651
Merged
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 #1378
Changes proposed in this Pull Request:
When setting up a store to authorize and capture later, the payment for an order may never be captured. When this happens, Stripe expires the transaction after ~7 days.
Currently, we don't have any handlers for this event. Expired orders stay unchanged on the store side.
This PR adds a handler for them, updating the status to
failed
and including a note with the corresponding information.Testing instructions
add/handling-charge-expiration-webhooks
)wp-admin/admin.php?page=wc-settings&tab=checkout§ion=stripe&panel=settings
("Issue an authorization on checkout, and capture later")on-hold
-- Option 1: wait the payment to expire. 7 days for card and 60 minutes for Affirm. This requires the store to be publicly accessible
-- Option 2: copy the following event body sample:
Sample event
--- Request the webhook endpoint on your store using the event body (
/?wc-api=wc_stripe
) using Postman or something similarfailed
and the following note added:"This payment has expired. Order status changed from On hold to Failed."
changelog.txt
andreadme.txt
(or does not apply)Post merge