From 39f41e1a14a1bbe7292e40835c6c6a9aebebb6e6 Mon Sep 17 00:00:00 2001 From: emilicastells Date: Mon, 14 Nov 2022 16:04:58 +0100 Subject: [PATCH] Move update order status after PayPal order creation --- .../src/Gateway/PayUponInvoice/PayUponInvoiceGateway.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PayUponInvoiceGateway.php b/modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PayUponInvoiceGateway.php index f328b86d2..20ab81fb6 100644 --- a/modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PayUponInvoiceGateway.php +++ b/modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PayUponInvoiceGateway.php @@ -249,13 +249,13 @@ class PayUponInvoiceGateway extends WC_Payment_Gateway { $wc_order->save(); } - $wc_order->update_status( 'on-hold', __( 'Awaiting Pay upon Invoice payment.', 'woocommerce-paypal-payments' ) ); $purchase_unit = $this->purchase_unit_factory->from_wc_order( $wc_order ); $payment_source = $this->payment_source_factory->from_wc_order( $wc_order, $birth_date ); try { $order = $this->order_endpoint->create( array( $purchase_unit ), $payment_source, $wc_order ); $this->add_paypal_meta( $wc_order, $order, $this->environment ); + $wc_order->update_status( 'on-hold', __( 'Awaiting Pay upon Invoice payment.', 'woocommerce-paypal-payments' ) ); as_schedule_single_action( time() + ( 5 * MINUTE_IN_SECONDS ),