From 86b5f00fed51e0bbb0f326238f4e7adc5971c855 Mon Sep 17 00:00:00 2001 From: dinamiko Date: Fri, 7 Oct 2022 11:27:55 +0200 Subject: [PATCH] Do not add payment instructions meta into non pui orders --- .../src/Gateway/PayUponInvoice/PayUponInvoice.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PayUponInvoice.php b/modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PayUponInvoice.php index 2529afad4..3f0c464e4 100644 --- a/modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PayUponInvoice.php +++ b/modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PayUponInvoice.php @@ -228,6 +228,10 @@ class PayUponInvoice { 'ppcp_payment_capture_completed_webhook_handler', function ( WC_Order $wc_order, string $order_id ) { try { + if ( $wc_order->get_payment_method() !== PayUponInvoiceGateway::ID ) { + return; + } + $order = $this->pui_order_endpoint->order( $order_id ); $payment_instructions = array(