The method payment_complete doesn’t change the status of the order
-
Hi,
after updating WooCommerce to version 8.5.2 I have a problem with this code:
$order_id = Gateway_Controller::extract_order_number( $options[‘order_prefix’], $versamento_code );
$order = new WC_Order( $order_id );
$log_manager = new Log_Manager( $order );
$p_found = $log_manager->check_payment_status( $order->get_id(), $iuv, STATUS_PAYMENT_CREATED );if ( $p_found ) {
// Set the order as paid.
$order->payment_complete();
$log_manager->log( STATUS_PAYMENT_CONFIRMED_BY_NOTIFICATION, $iuv );
$this->log_action( ‘info’, ‘Payment confirmed by notification. Order: ‘ . $versamento_code ); // Printed correctly !!!
} else {
$this->log_action( ‘warning’, ‘Payment already confirmed or payment not found. Order: ‘ . $versamento_code );
}It seems that the command $order->payment_complete(); is ignored.
$p_found is equal to 1, the log “Payment confirmed by….” is printed correctly, but the order doesn’t chnage its status.
Do you know if it is a known problem?
Thank you very much
Claudio
- The topic ‘The method payment_complete doesn’t change the status of the order’ is closed to new replies.