From d31f9bf2f9ffd112abe5bbe4397bc5976c584a50 Mon Sep 17 00:00:00 2001 From: David Remer Date: Thu, 9 Jul 2020 11:18:53 +0300 Subject: [PATCH] get correct custom id for order detection in refund handler --- .../ppcp-webhooks/src/Handler/PaymentCaptureRefunded.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules.local/ppcp-webhooks/src/Handler/PaymentCaptureRefunded.php b/modules.local/ppcp-webhooks/src/Handler/PaymentCaptureRefunded.php index b454ef9b2..97c0e78c5 100644 --- a/modules.local/ppcp-webhooks/src/Handler/PaymentCaptureRefunded.php +++ b/modules.local/ppcp-webhooks/src/Handler/PaymentCaptureRefunded.php @@ -27,7 +27,7 @@ class PaymentCaptureRefunded implements RequestHandler public function handleRequest(\WP_REST_Request $request): \WP_REST_Response { $response = ['success' => false]; - $orderId = isset($request['custom_id']) ? (int) $request['custom_id'] : 0; + $orderId = isset($request['resource']['custom_id']) ? (int) $request['resource']['custom_id'] : 0; if (! $orderId) { $message = sprintf( // translators: %s is the PayPal webhook Id.