mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +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,16 +131,13 @@ class RenewalHandler
|
||||||
private function captureOrder(Order $order, \WC_Order $wcOrder)
|
private function captureOrder(Order $order, \WC_Order $wcOrder)
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($order->intent() === 'CAPTURE') {
|
if ($order->intent() === 'CAPTURE' && $order->status()->is(OrderStatus::COMPLETED)) {
|
||||||
$order = $this->orderEndpoint->capture($order);
|
|
||||||
if ($order->status()->is(OrderStatus::COMPLETED)) {
|
|
||||||
$wcOrder->update_status(
|
$wcOrder->update_status(
|
||||||
'processing',
|
'processing',
|
||||||
__('Payment received.', 'woocommerce-paypal-commerce-gateway')
|
__('Payment received.', 'woocommerce-paypal-commerce-gateway')
|
||||||
);
|
);
|
||||||
\WC_Subscriptions_Manager::process_subscription_payments_on_order($wcOrder);
|
\WC_Subscriptions_Manager::process_subscription_payments_on_order($wcOrder);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ($order->intent() === 'AUTHORIZE') {
|
if ($order->intent() === 'AUTHORIZE') {
|
||||||
$this->orderEndpoint->authorize($order);
|
$this->orderEndpoint->authorize($order);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue