mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Fix not approved order processing
This commit is contained in:
parent
91c6e55f3d
commit
2dcfd115a9
2 changed files with 5 additions and 3 deletions
|
@ -85,7 +85,11 @@ class ReturnUrlEndpoint {
|
|||
// phpcs:enable WordPress.Security.NonceVerification.Recommended
|
||||
$order = $this->order_endpoint->order( $token );
|
||||
|
||||
$this->session_handler->replace_order( $order );
|
||||
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 ) {
|
||||
|
|
|
@ -286,8 +286,6 @@ class OrderProcessor {
|
|||
ApplicationContext::USER_ACTION_PAY_NOW
|
||||
);
|
||||
|
||||
$this->add_paypal_meta( $wc_order, $order, $this->environment );
|
||||
|
||||
return $order;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue