szelpe / woocommerce-barion

Barion Payment Gateway for WooCommerce
GNU General Public License v3.0
9 stars 14 forks source link

IPN callback sets custom order statuses to failed #59

Open alovitsm opened 2 years ago

alovitsm commented 2 years ago

We use custom order statuses to follow the progress of fulfilment. If a customer has tried to pay twice and only succeeded on the second try, the first payment callback sets the status to failed even if the second payment was successful (or the customer chose another method).

In WC_Gateway_Barion_IPN_Handler::check_barion_ipn(), line 42 only evaluates if a status is processing or completed. Maybe it'd be better to do !$order->has_status(array('pending')) instead of $order->has_status(array('processing', 'completed')) to resolve this for those who use custom statuses.