From ed517bbbd9541e85b8a95d0cbb8e5d6abc5ceb06 Mon Sep 17 00:00:00 2001 From: Seghir Nadir Date: Tue, 26 Oct 2021 10:42:39 +0100 Subject: [PATCH] Use Cart's needs payment check instead of Order's (#4955) * Revert "Fix free orders missing payment method (#4854)" This reverts commit 90e513b893fce394a83640a01471c96045eac983. * use Cart needs payment instead of Order needs payment * switch to nullish coalescing * remove extra line --- 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..6c8603f79c1 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( $request['payment_method'] ?? '' ); /** * Fires when the Checkout Block/Store API updates an order's from the API request data.