Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Use Cart's needs payment check instead of Order's (#4955)
Browse files Browse the repository at this point in the history
* Revert "Fix free orders missing payment method (#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 Oct 26, 2021
1 parent 34e367f commit ed517bb
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 ed517bb

Please sign in to comment.