Skip to content

Commit

Permalink
For open payment we set the order on hold instead of pending payment.
Browse files Browse the repository at this point in the history
See #70 (comment) for details.
  • Loading branch information
remcotolsma committed Sep 6, 2024
1 parent 28d74a1 commit 1bb7830
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -476,16 +476,14 @@ public static function status_update( Payment $payment ) {
}

/**
* For new WooCommerce orders, the order status is 'pending' by
* default. It is possible that a first payment attempt fails and the
* order status is set to 'failed'. If a new payment attempt is made,
* we will reset the order status to pending payment.
* Payment status open.
*
* @link https://github.com/pronamic/wp-pronamic-pay-woocommerce/issues/70
* @link https://github.com/woocommerce/woocommerce/blob/7897a61a1040ca6ed3310cb537ce22211058256c/plugins/woocommerce/includes/abstracts/abstract-wc-order.php#L402-L403
* @link https://github.com/pronamic/wp-pronamic-pay-woocommerce/issues/48
*/
if ( PaymentStatus::OPEN === $payment->get_status() && $order->needs_payment() && 'pending' !== $order->get_status() ) {
$new_status = WooCommerce::ORDER_STATUS_PENDING;
if ( PaymentStatus::OPEN === $payment->get_status() ) {
$new_status = WooCommerce::ORDER_STATUS_ON_HOLD;
}

/**
Expand Down

0 comments on commit 1bb7830

Please sign in to comment.