-
Notifications
You must be signed in to change notification settings - Fork 216
Process BLIK payment succeeded webhook event immediately instead of deferring themv #4866
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
Process BLIK payment succeeded webhook event immediately instead of deferring themv #4866
Conversation
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.
Pull request overview
This PR changes BLIK payment webhook processing from deferred to immediate execution, aligning it with voucher and wallet payment handling. When a payment_intent.succeeded webhook is received for a BLIK payment, it will now be processed immediately instead of being scheduled for deferred processing.
Key Changes
- BLIK payments now process
payment_intent.succeededwebhooks immediately like voucher and wallet payments - Added test coverage for BLIK payment webhook handling
- Improved logging levels throughout webhook handlers
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
includes/class-wc-stripe-webhook-handler.php |
Added BLIK payment type detection and included it in the immediate webhook processing condition |
tests/phpunit/WC_Stripe_Webhook_Handler_Test.php |
Added test case for BLIK payment webhook processing |
readme.txt |
Added changelog entry for BLIK webhook processing change |
changelog.txt |
Added changelog entry for BLIK webhook processing change |
includes/abstracts/abstract-wc-stripe-payment-gateway.php |
Improved logging levels and structure for charge response processing |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
| // Process the webhook now if it's for a voucher or wallet payment, or if filtered to process immediately and order is not awaiting action. | ||
| if ( $is_voucher_payment || $is_wallet_payment || ( ! $process_webhook_async && ! $is_awaiting_action ) ) { | ||
| // Process the webhook now if it's for a voucher, wallet, or BLIK payment, or if filtered to process immediately and order is not awaiting action. | ||
| if ( $is_voucher_payment || $is_wallet_payment || $is_blik_payment || ( ! $process_webhook_async && ! $is_awaiting_action ) ) { |
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.
Not sure if there's a chance of this check getting longer, but maybe we could update it to use a single variable for the payment methods, like $is_immediate_processing_method.
$immediate_processing_methods = array_merge( WC_Stripe_Payment_Methods::VOUCHER_PAYMENT_METHODS, WC_Stripe_Payment_Methods::WALLET_PAYMENT_METHODS, [ WC_Stripe_Payment_Methods::BLIK ] );
$is_immediate_processing_method = in_array( $payment_type_meta, immediate_processing_methods, true );
wjrosa
left a comment
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.
Looks good to me! Left a totatlly optional suggestion
malithsen
left a comment
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.
Looks good and tests well
…g-for-blik-confirmation-event
Fixes STRIPE-852
Related STRIPE-834
Changes proposed in this Pull Request:
The PR changes BLIK webhook processing from deferred to immediate.
This means BLIK payments now process
payment_intent.succeededwebhooks immediately (like voucher and wallet payments) instead of deferring them.Testing instructions
My Account > Orders, indevelopthe order remains in thePending paymentstatus for 2 minutes before transitioning toProcessing:But, with this branch (
fix/852-remove-deferred-webhook-processing-for-blik-confirmation-event), it takes just a couple of seconds before processing the payment:WP-Admin > WooCommerce > Ordersand select the order created aboveintent createdand thecharge completenotes:Changelog entry
Changelog Entry Comment
Comment
Post merge