mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
Add transaction id to order note when refund is received through webhook
This commit is contained in:
parent
22afa181d2
commit
ac9c0c982c
1 changed files with 11 additions and 0 deletions
|
@ -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 );
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue