Update the checkout order endpoint allowed order statuses for payment complete (https://github.com/woocommerce/woocommerce-blocks/pull/12018)
* Update the allowed order statuses for payment complete * Check if order exists before checking needs_payment
This commit is contained in:
parent
d959781fc6
commit
2578fa11e9
|
@ -100,7 +100,7 @@ class CheckoutOrder extends AbstractCartRoute {
|
|||
$order_id = absint( $request['id'] );
|
||||
$this->order = wc_get_order( $order_id );
|
||||
|
||||
if ( $this->order->get_status() !== 'pending' && $this->order->get_status() !== 'failed' ) {
|
||||
if ( ! $this->order || ! $this->order->needs_payment() ) {
|
||||
return new \WP_Error(
|
||||
'invalid_order_update_status',
|
||||
__( 'This order cannot be paid for.', 'woo-gutenberg-products-block' )
|
||||
|
|
Loading…
Reference in New Issue