mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Capture the order only if the intent is capture
This commit is contained in:
parent
717b7d1689
commit
f4fd1d8b7d
1 changed files with 3 additions and 1 deletions
|
@ -84,7 +84,9 @@ class WcGateway extends \WC_Payment_Gateway
|
|||
}
|
||||
|
||||
$order = $this->patchOrder($wcOrder, $order);
|
||||
$order = $this->endpoint->capture($order);
|
||||
if($order->intent() === 'CAPTURE') {
|
||||
$order = $this->endpoint->capture($order);
|
||||
}
|
||||
|
||||
$wcOrder->update_status('on-hold', __('Awaiting payment.', 'woocommerce-paypal-gateway'));
|
||||
if ($order->status()->is(OrderStatus::COMPLETED)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue