From cad8b225eb0280020f5bef08e5ea20390973885f Mon Sep 17 00:00:00 2001 From: Nagesh Pai <4162931+nagpai@users.noreply.github.com> Date: Wed, 13 Mar 2024 10:29:41 +0530 Subject: [PATCH] Disputes: Update a more clear order note for dispute fund withdrawn event (#8371) Co-authored-by: Nagesh Pai --- changelog/fix-6380-edit-dispute-order-note | 4 ++++ includes/class-wc-payments-webhook-processing-service.php | 2 +- .../test-class-wc-payments-webhook-processing-service.php | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 changelog/fix-6380-edit-dispute-order-note diff --git a/changelog/fix-6380-edit-dispute-order-note b/changelog/fix-6380-edit-dispute-order-note new file mode 100644 index 00000000000..2d4d699894b --- /dev/null +++ b/changelog/fix-6380-edit-dispute-order-note @@ -0,0 +1,4 @@ +Significance: patch +Type: update + +Make the order note for `dispute funds withdrawn` event clearly mention that the dispute amount and fee would be deducted from the next deposit. diff --git a/includes/class-wc-payments-webhook-processing-service.php b/includes/class-wc-payments-webhook-processing-service.php index d581a808aa0..39c9d70ba78 100644 --- a/includes/class-wc-payments-webhook-processing-service.php +++ b/includes/class-wc-payments-webhook-processing-service.php @@ -618,7 +618,7 @@ private function process_webhook_dispute_updated( $event_body ) { switch ( $event_type ) { case 'charge.dispute.funds_withdrawn': - $message = __( 'Payment dispute funds have been withdrawn', 'woocommerce-payments' ); + $message = __( 'Payment dispute and fees have been deducted from your next deposit', 'woocommerce-payments' ); break; case 'charge.dispute.funds_reinstated': $message = __( 'Payment dispute funds have been reinstated', 'woocommerce-payments' ); diff --git a/tests/unit/test-class-wc-payments-webhook-processing-service.php b/tests/unit/test-class-wc-payments-webhook-processing-service.php index 041ffe50220..9fd33be0b30 100644 --- a/tests/unit/test-class-wc-payments-webhook-processing-service.php +++ b/tests/unit/test-class-wc-payments-webhook-processing-service.php @@ -1359,7 +1359,7 @@ public function test_dispute_funds_withdrawn_order_note() { ->method( 'add_order_note' ) ->with( $this->matchesRegularExpression( - '/Payment dispute funds have been withdrawn/' + '/Payment dispute and fees have been deducted from your next deposit/' ) );