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

Avoid resending Processing Order customer email when merchant wins dispute #3674

Merged
merged 4 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*** Changelog ***

= 9.1.0 - xxxx-xx-xx =
* Tweak - Avoid re-sending Processing Order customer email when merchant wins dispute.
* Fix - Allow the saving of iDEAL tokens when SEPA is disabled.
* Fix - Fixes the incompatibility notice in editor due missing style property when instantiating Stripe payment methods.
* Dev - Updates the GitHub caching action (`actions/cache`) to v4 due deprecation.
Expand Down
13 changes: 13 additions & 0 deletions includes/class-wc-stripe-webhook-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,19 @@ public function process_webhook_dispute_closed( $notification ) {

// Fail order if dispute is lost, or else revert to pre-dispute status.
$order_status = 'lost' === $status ? 'failed' : $this->get_stripe_order_status_before_hold( $order );

// Do not re-send "Processing Order" email to customer after a dispute win.
if ( 'processing' === $order_status ) {
$emails = WC()->mailer()->get_emails();
if ( isset( $emails['WC_Email_Customer_Processing_Order'] ) ) {
$callback = [ $emails['WC_Email_Customer_Processing_Order'], 'trigger' ];
remove_action(
'woocommerce_order_status_on-hold_to_processing_notification',
$callback
);
}
}

$order->update_status( $order_status, $message );
} else {
$order->add_order_note( $message );
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o
== Changelog ==

= 9.1.0 - xxxx-xx-xx =
* Tweak - Avoid re-sending Processing Order customer email when merchant wins dispute.
* Fix - Allow the saving of iDEAL tokens when SEPA is disabled.
* Fix - Fixes the incompatibility notice in editor due missing style property when instantiating Stripe payment methods.
* Dev - Updates the GitHub caching action (`actions/cache`) to v4 due deprecation.
Expand Down
Loading