Merge pull request #3570 from woocommerce/PCP-5034-block-checkout-proceed-to-pay-pal-endless-loop-unable-to-complete-transaction

Fix endless redirect bug for the PayPal button (5034)
This commit is contained in:
Danny Dudzic 2025-07-31 12:18:37 +02:00 committed by GitHub
commit e75d7085e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -109,6 +109,13 @@ class ReturnUrlEndpoint {
}
}
// Replace session order for approved/completed orders.
if ( $order->status()->is( OrderStatus::APPROVED )
|| $order->status()->is( OrderStatus::COMPLETED )
) {
$this->session_handler->replace_order( $order );
}
$wc_order_id = (int) $order->purchase_units()[0]->custom_id();
if ( ! $wc_order_id ) {
// We cannot finish processing here without WC order, but at least go into the continuation mode.