Skip to content

Commit

Permalink
Use Cart's needs payment check instead of Order's (woocommerce#4955)
Browse files Browse the repository at this point in the history
* Revert "Fix free orders missing payment method (woocommerce#4854)"

This reverts commit 90e513b.

* use Cart needs payment instead of Order needs payment

* switch to nullish coalescing

* remove extra line
  • Loading branch information
senadir authored and jonny-bull committed Dec 14, 2021
1 parent 88e9fdc commit f5b48ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/StoreApi/Routes/Checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit f5b48ba

Please sign in to comment.