Use Cart's needs payment check instead of Order's (https://github.com/woocommerce/woocommerce-blocks/pull/4955)

* Revert "Fix free orders missing payment method (https://github.com/woocommerce/woocommerce-blocks/pull/4854)"

This reverts commit 60f82537f1.

* use Cart needs payment instead of Order needs payment

* switch to nullish coalescing

* remove extra line
This commit is contained in:
Seghir Nadir 2021-10-26 10:42:39 +01:00 committed by GitHub
parent 3ce06eb87b
commit b6c314f0d4
1 changed files with 1 additions and 1 deletions

View File

@ -462,7 +462,7 @@ class Checkout extends AbstractCartRoute {
*/
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.