mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Check purchase units payments captures status is not declined before update order status
This commit is contained in:
parent
0c998a2b5d
commit
83039ba36b
1 changed files with 8 additions and 4 deletions
|
@ -168,10 +168,14 @@ class OrderProcessor {
|
|||
__( 'Awaiting payment.', 'woocommerce-paypal-payments' )
|
||||
);
|
||||
if ( $order->status()->is( OrderStatus::COMPLETED ) && $order->intent() === 'CAPTURE' ) {
|
||||
$wc_order->update_status(
|
||||
'processing',
|
||||
__( 'Payment received.', 'woocommerce-paypal-payments' )
|
||||
);
|
||||
|
||||
$purchaseUnitsPaymentsCapturesStatus = $order->purchase_units()[0]->payments()->captures()[0]->status() ?? '';
|
||||
if ( $purchaseUnitsPaymentsCapturesStatus && $purchaseUnitsPaymentsCapturesStatus !== 'DECLINED' ) {
|
||||
$wc_order->update_status(
|
||||
'processing',
|
||||
__( 'Payment received.', 'woocommerce-paypal-payments' )
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ( $this->capture_authorized_downloads( $order ) && $this->authorized_payments_processor->process( $wc_order ) ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue