Skip to content

Commit

Permalink
Skip 'Processing Order' customer email on merchant dispute win
Browse files Browse the repository at this point in the history
  • Loading branch information
annemirasol committed Dec 20, 2024
1 parent 9cd5240 commit 24ffd80
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 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,15 @@ 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 ) {
remove_action(
'woocommerce_order_status_on-hold_to_processing_notification',
[ 'WC_Email_Customer_Processing_Order', 'trigger' ]
);
}

$order->update_status( $order_status, $message );
} else {
$order->add_order_note( $message );
Expand Down

0 comments on commit 24ffd80

Please sign in to comment.