From b81c3a9af6eeef4069c548fd7d7b21be91f97637 Mon Sep 17 00:00:00 2001 From: Nadir Seghir Date: Mon, 18 Oct 2021 11:28:36 +0100 Subject: [PATCH] Revert "Fix free orders missing payment method (#4854)" This reverts commit 90e513b893fce394a83640a01471c96045eac983. --- src/StoreApi/Routes/Checkout.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/StoreApi/Routes/Checkout.php b/src/StoreApi/Routes/Checkout.php index a641df08576..5d6d223113c 100644 --- a/src/StoreApi/Routes/Checkout.php +++ b/src/StoreApi/Routes/Checkout.php @@ -462,7 +462,7 @@ private function update_customer_from_request( \WP_REST_Request $request ) { */ private function update_order_from_request( \WP_REST_Request $request ) { $this->order->set_customer_note( $request['customer_note'] ?? '' ); - $this->order->set_payment_method( $this->get_request_payment_method( $request ) ); + $this->order->set_payment_method( $this->order->needs_payment() ? $this->get_request_payment_method( $request ) : '' ); /** * Fires when the Checkout Block/Store API updates an order's from the API request data.