mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
when order is created with payment token the status of the newly created order is COMPLETED already
This commit is contained in:
parent
5cd1de2446
commit
2af06b180e
1 changed files with 6 additions and 9 deletions
|
@ -131,15 +131,12 @@ class RenewalHandler
|
|||
private function captureOrder(Order $order, \WC_Order $wcOrder)
|
||||
{
|
||||
|
||||
if ($order->intent() === 'CAPTURE') {
|
||||
$order = $this->orderEndpoint->capture($order);
|
||||
if ($order->status()->is(OrderStatus::COMPLETED)) {
|
||||
$wcOrder->update_status(
|
||||
'processing',
|
||||
__('Payment received.', 'woocommerce-paypal-commerce-gateway')
|
||||
);
|
||||
\WC_Subscriptions_Manager::process_subscription_payments_on_order($wcOrder);
|
||||
}
|
||||
if ($order->intent() === 'CAPTURE' && $order->status()->is(OrderStatus::COMPLETED)) {
|
||||
$wcOrder->update_status(
|
||||
'processing',
|
||||
__('Payment received.', 'woocommerce-paypal-commerce-gateway')
|
||||
);
|
||||
\WC_Subscriptions_Manager::process_subscription_payments_on_order($wcOrder);
|
||||
}
|
||||
|
||||
if ($order->intent() === 'AUTHORIZE') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue