Add transaction id to order note when refund is received through webhook

This commit is contained in:
dinamiko 2022-02-07 12:50:24 +01:00
parent 22afa181d2
commit ac9c0c982c

View file

@ -150,6 +150,17 @@ class PaymentCaptureRefunded implements RequestHandler {
'order' => $wc_order,
)
);
if ( isset( $request['resource']['id'] ) ) {
$wc_order->add_order_note(
sprintf(
/* translators: %s is the PayPal transaction ID */
__( 'PayPal transaction ID: %s', 'woocommerce-paypal-payments' ),
$request['resource']['id']
)
);
}
$response['success'] = true;
return rest_ensure_response( $response );
}