Plugin Directory

Changeset 3491671


Ignore:
Timestamp:
03/26/2026 10:25:13 AM (8 days ago)
Author:
easypayment
Message:

tags/9.0.60

Location:
woo-paypal-gateway
Files:
1068 added
7 edited

Legend:

Unmodified
Added
Removed
  • woo-paypal-gateway/trunk/languages/woo-paypal-gateway.pot

    r3487151 r3491671  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Payment Gateway for PayPal on WooCommerce 9.0.59\n"
     5"Project-Id-Version: Payment Gateway for PayPal on WooCommerce 9.0.60\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woo-paypal-gateway\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  • woo-paypal-gateway/trunk/ppcp/includes/class-ppcp-paypal-checkout-for-woocommerce-request.php

    r3487151 r3491671  
    783783                    $return_response['paypal_order_id'] = $api_response['id'];
    784784                    $this->ppcp_set_order_session_data($api_response['id'], 'capture', $woo_order_id);
    785                     if ($api_response['status'] == 'COMPLETED') {
     785                    $this->ppcp_log('Capture response for order #' . $woo_order_id . ': PayPal order status=' . (isset($api_response['status']) ? $api_response['status'] : 'N/A'));
     786                    if (isset($api_response['status']) && $api_response['status'] === 'COMPLETED') {
    786787                        do_action('wpg_ppcp_save_payment_method_details', $woo_order_id, $api_response);
    787788                        $payment_source = isset($api_response['payment_source']) ? $api_response['payment_source'] : '';
     
    825826                        $seller_protection = isset($api_response['purchase_units']['0']['payments']['captures']['0']['seller_protection']['status']) ? $api_response['purchase_units']['0']['payments']['captures']['0']['seller_protection']['status'] : '';
    826827                        $payment_status = isset($api_response['purchase_units']['0']['payments']['captures']['0']['status']) ? $api_response['purchase_units']['0']['payments']['captures']['0']['status'] : '';
    827                         if ($payment_status == 'COMPLETED') {
     828                        $this->ppcp_log('Capture payment_status for order #' . $woo_order_id . ': capture status=' . ($payment_status ? $payment_status : 'N/A') . ', transaction_id=' . ($transaction_id ? $transaction_id : 'N/A'));
     829                        if ($payment_status === 'COMPLETED') {
    828830                            wpg_set_order_payment_method_title_from_paypal_response($order, $api_response);
    829831                            $order->payment_complete($transaction_id);
     
    978980                    $return_response['paypal_order_id'] = $api_response['id'];
    979981                    $this->ppcp_set_order_session_data($api_response['id'], 'approved', $woo_order_id);
    980                     if ($api_response['status'] == 'COMPLETED') {
    981                         $transaction_id = isset($api_response['purchase_units']['0']['payments']['authorizations']['0']['id']) ? $api_response['purchase_units']['0']['payments']['authorizations']['0']['id'] : '';
    982                         $seller_protection = isset($api_response['purchase_units']['0']['payments']['authorizations']['0']['seller_protection']['status']) ? $api_response['purchase_units']['0']['payments']['authorizations']['0']['seller_protection']['status'] : '';
    983                         $payment_status = isset($api_response['purchase_units']['0']['payments']['authorizations']['0']['status']) ? $api_response['purchase_units']['0']['payments']['authorizations']['0']['status'] : '';
     982                    $transaction_id = isset($api_response['purchase_units']['0']['payments']['authorizations']['0']['id']) ? $api_response['purchase_units']['0']['payments']['authorizations']['0']['id'] : '';
     983                    $seller_protection = isset($api_response['purchase_units']['0']['payments']['authorizations']['0']['seller_protection']['status']) ? $api_response['purchase_units']['0']['payments']['authorizations']['0']['seller_protection']['status'] : '';
     984                    $payment_status = isset($api_response['purchase_units']['0']['payments']['authorizations']['0']['status']) ? strtoupper($api_response['purchase_units']['0']['payments']['authorizations']['0']['status']) : '';
     985                    $payment_status_reason = isset($api_response['purchase_units']['0']['payments']['authorizations']['0']['status_details']['reason']) ? $api_response['purchase_units']['0']['payments']['authorizations']['0']['status_details']['reason'] : '';
     986                    $this->ppcp_log('Authorize response status for order #' . $woo_order_id . ': order_status=' . (isset($api_response['status']) ? $api_response['status'] : 'N/A') . ', authorization_status=' . ($payment_status ? $payment_status : 'N/A'));
     987                    if (in_array($payment_status, array('AUTHORIZED', 'CREATED'), true)) {
    984988                        $order->set_transaction_id($transaction_id);
    985989                        $order->update_meta_data('_payment_status', $payment_status);
     
    992996                        $order->update_status($this->authorized_order_status);
    993997                        $order->add_order_note($this->get_payment_authorized_note());
     998                    } else {
     999                        $this->ppcp_log('Authorize request did not return a successful authorization status for order #' . $woo_order_id . '. Received status: ' . ($payment_status ? $payment_status : 'N/A'));
     1000                        ppcp_update_woo_order_status($woo_order_id, $payment_status ? $payment_status : 'FAILED', $payment_status_reason);
     1001                        $order->add_order_note(
     1002                            sprintf(
     1003                                __('PayPal authorization was not successful. Received status: %1$s.', 'woo-paypal-gateway'),
     1004                                $payment_status ? $payment_status : __('N/A', 'woo-paypal-gateway')
     1005                            )
     1006                        );
     1007                        return false;
    9941008                    }
    9951009                    wpg_clear_ppcp_session_and_cart();
     
    17621776                $webhook_request['event_types'][] = array('name' => 'CHECKOUT.ORDER.APPROVED');
    17631777                $webhook_request['event_types'][] = array('name' => 'PAYMENT.AUTHORIZATION.CREATED');
     1778                $webhook_request['event_types'][] = array('name' => 'PAYMENT.AUTHORIZATION.DENIED');
    17641779                $webhook_request['event_types'][] = array('name' => 'PAYMENT.AUTHORIZATION.VOIDED');
    17651780                $webhook_request['event_types'][] = array('name' => 'PAYMENT.CAPTURE.COMPLETED');
     1781                $webhook_request['event_types'][] = array('name' => 'PAYMENT.CAPTURE.DECLINED');
    17661782                $webhook_request['event_types'][] = array('name' => 'PAYMENT.CAPTURE.DENIED');
    17671783                $webhook_request['event_types'][] = array('name' => 'PAYMENT.CAPTURE.PENDING');
     
    19962012            }
    19972013            if (isset($posted['resource']['status']) && isset($posted['resource']['id'])) {
    1998                 switch ($posted['event_type']) {
    1999                     case 'PAYMENT.AUTHORIZATION.CREATED' :
     2014                $event_type     = isset($posted['event_type']) ? $posted['event_type'] : '';
     2015                $resource_status = isset($posted['resource']['status']) ? $posted['resource']['status'] : '';
     2016                $resource_id     = isset($posted['resource']['id']) ? $posted['resource']['id'] : '';
     2017                $this->ppcp_log(
     2018                    'Webhook event received: event_type=' . $event_type .
     2019                    ', resource_status=' . $resource_status .
     2020                    ', resource_id=' . $resource_id .
     2021                    ', order_id=' . ($order ? $order->get_id() : 'unknown')
     2022                );
     2023                switch ($event_type) {
     2024                    case 'CHECKOUT.ORDER.APPROVED':
     2025                        $this->ppcp_log(
     2026                            'CHECKOUT.ORDER.APPROVED webhook received for order #' .
     2027                            ($order ? $order->get_id() : 'unknown') .
     2028                            '. No order status change — awaiting capture or authorization event.'
     2029                        );
     2030                        break;
     2031                    case 'PAYMENT.AUTHORIZATION.CREATED':
     2032                        $this->ppcp_log('Processing PAYMENT.AUTHORIZATION.CREATED for order #' . ($order ? $order->get_id() : 'unknown'));
    20002033                        $this->payment_status_authorized($order);
    20012034                        break;
    2002                     case 'PAYMENT.AUTHORIZATION.VOIDED' :
     2035                    case 'PAYMENT.AUTHORIZATION.DENIED':
     2036                        $this->ppcp_log('Processing PAYMENT.AUTHORIZATION.DENIED for order #' . ($order ? $order->get_id() : 'unknown') . '. Marking as failed.');
     2037                        $this->payment_status_denied($order, $posted);
     2038                        break;
     2039                    case 'PAYMENT.AUTHORIZATION.VOIDED':
     2040                        $this->ppcp_log('Processing PAYMENT.AUTHORIZATION.VOIDED for order #' . ($order ? $order->get_id() : 'unknown') . '. Marking as failed.');
    20032041                        $this->payment_status_voided($order, $posted);
    20042042                        break;
    2005                     case 'PAYMENT.CAPTURE.COMPLETED' :
     2043                    case 'PAYMENT.CAPTURE.COMPLETED':
     2044                        $this->ppcp_log('Processing PAYMENT.CAPTURE.COMPLETED for order #' . ($order ? $order->get_id() : 'unknown'));
    20062045                        $this->payment_status_completed($order, $posted);
    20072046                        break;
    2008                     case 'PAYMENT.CAPTURE.DENIED' :
     2047                    case 'PAYMENT.CAPTURE.DECLINED':
     2048                    case 'PAYMENT.CAPTURE.DENIED':
     2049                        $this->ppcp_log('Processing ' . $event_type . ' for order #' . ($order ? $order->get_id() : 'unknown') . '. Marking as failed.');
    20092050                        $this->payment_status_denied($order, $posted);
    20102051                        break;
    2011                     case 'PAYMENT.CAPTURE.PENDING' :
     2052                    case 'PAYMENT.CAPTURE.PENDING':
     2053                        $this->ppcp_log('Processing PAYMENT.CAPTURE.PENDING for order #' . ($order ? $order->get_id() : 'unknown') . '. Setting on-hold.');
    20122054                        $this->payment_status_on_hold($order, $posted);
    20132055                        break;
    2014                     case 'PAYMENT.CAPTURE.REFUNDED' :
     2056                    case 'PAYMENT.CAPTURE.REFUNDED':
     2057                        $this->ppcp_log('Processing PAYMENT.CAPTURE.REFUNDED for order #' . ($order ? $order->get_id() : 'unknown'));
    20152058                        $this->payment_status_refunded($order, $posted);
     2059                        break;
     2060                    default:
     2061                        $this->ppcp_log('Unhandled webhook event_type: ' . $event_type . ' for order #' . ($order ? $order->get_id() : 'unknown'));
    20162062                        break;
    20172063                }
     
    20252071            exit;
    20262072        }
    2027         if ('COMPLETED' === $posted['resource']['status']) {
     2073        $resource_status = isset($posted['resource']['status']) ? strtoupper($posted['resource']['status']) : '';
     2074        $this->ppcp_log('Webhook payment completion check for order #' . $order->get_id() . ': event=' . (isset($posted['event_type']) ? $posted['event_type'] : 'N/A') . ', resource_status=' . $resource_status);
     2075        if ('COMPLETED' === $resource_status) {
    20282076            $this->payment_complete($order);
    20292077        } else {
    2030             if ('created' === $posted['resource']['status']) {
     2078            if ('PENDING' === $resource_status) {
     2079                if (!empty($posted['resource']['status_details']['reason'])) {
     2080                    $this->payment_on_hold($order, sprintf(__('Payment pending (%1$s).', 'woo-paypal-gateway'), $posted['resource']['status_details']['reason']));
     2081                } else {
     2082                    $this->payment_on_hold($order, __('Payment is pending at PayPal.', 'woo-paypal-gateway'));
     2083                }
     2084            } elseif ('AUTHORIZED' === $resource_status || 'CREATED' === $resource_status) {
    20312085                $this->payment_on_hold($order, $this->get_payment_authorized_note());
    20322086            } else {
    2033                 if (!empty($posted['pending_reason'])) {
    2034                     // translators: 1: PayPal pending reason.
    2035                     $this->payment_on_hold($order, sprintf(__('Payment pending (%1$s).', 'woo-paypal-gateway'), $posted['pending_reason']));
    2036                 }
     2087                $this->ppcp_log('Webhook payment status is not successful for order #' . $order->get_id() . '. Marking order as failed. Status: ' . $resource_status);
     2088                $this->payment_status_failed($order);
    20372089            }
    20382090        }
  • woo-paypal-gateway/trunk/ppcp/includes/ppcp-paypal-checkout-for-woocommerce-function.php

    r3486327 r3491671  
    354354    function ppcp_update_woo_order_status($orderid, $payment_status, $pending_reason, $processor_response = null) {
    355355        try {
     356            $payment_status = strtoupper((string) $payment_status);
    356357            if (empty($pending_reason)) {
    357358                $pending_reason = $payment_status;
     
    382383            }
    383384            $pending_reason_text = '';
    384             if (in_array(strtoupper($payment_status), ['DECLINED', 'PENDING'], true)) {
     385            if (in_array($payment_status, ['DECLINED', 'PENDING'], true)) {
    385386                switch (strtoupper($pending_reason)) {
    386387                    case 'BUYER_COMPLAINT':
     
    426427            }
    427428            $final_detail = $reasons ? implode(' ', $reasons) : __('The transaction could not be completed.', 'woo-paypal-gateway');
    428             $success = true;
    429             switch (strtoupper($payment_status)) {
     429            $order->add_order_note(sprintf(__('PayPal payment status received: %s', 'woo-paypal-gateway'), $payment_status ? $payment_status : __('N/A', 'woo-paypal-gateway')));
     430            $success = false;
     431            switch ($payment_status) {
     432                case 'AUTHORIZED':
     433                case 'CREATED':
     434                    $settings = get_option('woocommerce_wpg_paypal_checkout_settings', array());
     435                    $authorized_status = !empty($settings['authorized_order_status']) ? sanitize_key($settings['authorized_order_status']) : 'on-hold';
     436                    if (strpos($authorized_status, 'wc-') === 0) {
     437                        $authorized_status = substr($authorized_status, 3);
     438                    }
     439                    if (empty($authorized_status)) {
     440                        $authorized_status = 'on-hold';
     441                    }
     442                    $order->update_status($authorized_status, __('Payment authorized. Awaiting capture.', 'woo-paypal-gateway'));
     443                    $success = true;
     444                    break;
     445                case 'COMPLETED':
     446                    $success = true;
     447                    break;
    430448                case 'PENDING':
    431449                    $order->update_status(
     
    541559                    $success = true;
    542560                    break;
     561                case 'DENIED':
     562                case 'VOIDED':
     563                    $order->update_status(
     564                            'failed',
     565                            sprintf(
     566                                    /* translators: 1: payment method title, 2: payment status */
     567                                    __('Payment via %1$s %2$s.', 'woo-paypal-gateway'),
     568                                    $order->get_payment_method_title(),
     569                                    strtolower($payment_status)
     570                            )
     571                    );
     572                    $success = false;
     573                    break;
    543574
    544575                default:
    545                     $success = true;
     576                    $order->update_status(
     577                            'failed',
     578                            sprintf(
     579                                    /* translators: 1: payment method title, 2: payment status */
     580                                    __('Payment via %1$s returned unsupported status: %2$s.', 'woo-paypal-gateway'),
     581                                    $order->get_payment_method_title(),
     582                                    $payment_status ? $payment_status : __('UNKNOWN', 'woo-paypal-gateway')
     583                            )
     584                    );
     585                    $success = false;
    546586                    break;
    547587            }
  • woo-paypal-gateway/trunk/ppcp/public/class-ppcp-paypal-checkout-for-woocommerce-button-manager.php

    r3487151 r3491671  
    15811581
    15821582    public function ppcp_display_order_page() {
     1583        $is_success = false;
     1584        $is_handled = false;
    15831585        $this->checkout_details = $this->request->ppcp_get_checkout_details($_GET['paypal_order_id']);
    15841586        ppcp_set_session('ppcp_paypal_transaction_details', $this->checkout_details);
     
    15971599        $order = wc_get_order($order_id);
    15981600        $this->checkout_details = $this->checkout_details;
    1599         if ($this->paymentaction === 'capture' && !empty($this->checkout_details->status) && $this->checkout_details->status == 'COMPLETED' && $order !== false) {
     1601        if ($this->paymentaction === 'capture' && !empty($this->checkout_details->status) && $this->checkout_details->status === 'COMPLETED' && $order !== false) {
     1602            $is_handled = true;
    16001603            $transaction_id = isset($this->checkout_details->purchase_units[0]->payments->captures[0]->id) ? $this->checkout_details->purchase_units['0']->payments->captures[0]->id : '';
    16011604            $seller_protection = isset($this->checkout_details->purchase_units[0]->payments->captures[0]->seller_protection->status) ? $this->checkout_details->purchase_units[0]->payments->captures[0]->seller_protection->status : '';
     
    16381641            }
    16391642            $payment_status = isset($this->checkout_details->purchase_units[0]->payments->captures[0]->status) ? $this->checkout_details->purchase_units[0]->payments->captures[0]->status : '';
    1640             if ($payment_status == 'COMPLETED') {
     1643            $this->request->ppcp_log('ppcp_display_order_page capture: order #' . $order_id . ', capture status=' . ($payment_status ? $payment_status : 'N/A') . ', transaction_id=' . ($transaction_id ? $transaction_id : 'N/A'));
     1644            if ($payment_status === 'COMPLETED') {
    16411645                wpg_set_order_payment_method_title_from_paypal_response($order, $this->checkout_details);
    16421646                $order->payment_complete($transaction_id);
     
    16471651                $order->add_order_note(sprintf(__('%1$s Transaction ID: %2$s', 'woo-paypal-gateway'), $this->title, $transaction_id));
    16481652                $order->add_order_note('Seller Protection Status: ' . ppcp_readable($seller_protection));
     1653                $is_success = true;
    16491654            } else {
    1650                 $payment_status_reason = $payment_status_reason = isset($this->checkout_details->purchase_units[0]->payments->authorizations[0]->status_details->reason) ? $this->checkout_details->purchase_units[0]->payments->authorizations[0]->status_details->reason : '';
    1651                 ppcp_update_woo_order_status($order_id, $payment_status, $payment_status_reason, $processor_response);
     1655                $payment_status_reason = isset($this->checkout_details->purchase_units[0]->payments->captures[0]->status_details->reason) ? $this->checkout_details->purchase_units[0]->payments->captures[0]->status_details->reason : '';
     1656                $is_success = ppcp_update_woo_order_status($order_id, $payment_status, $payment_status_reason, $processor_response);
    16521657            }
    16531658           
    1654         } elseif ($this->paymentaction === 'authorize' && !empty($this->checkout_details->status) && $this->checkout_details->status == 'COMPLETED' && $order !== false) {
     1659        } elseif ($this->paymentaction === 'authorize' && !empty($this->checkout_details->status) && $this->checkout_details->status === 'COMPLETED' && $order !== false) {
     1660            $is_handled = true;
    16551661            $transaction_id = isset($this->checkout_details->purchase_units[0]->payments->authorizations[0]->id) ? $this->checkout_details->purchase_units['0']->payments->authorizations[0]->id : '';
    16561662            $seller_protection = isset($this->checkout_details->purchase_units[0]->payments->authorizations[0]->seller_protection->status) ? $this->checkout_details->purchase_units[0]->payments->authorizations[0]->seller_protection->status : '';
    1657             $payment_status = isset($this->checkout_details->purchase_units[0]->payments->authorizations[0]->status) ? $this->checkout_details->purchase_units[0]->payments->authorizations[0]->status : '';
     1663            $payment_status = isset($this->checkout_details->purchase_units[0]->payments->authorizations[0]->status) ? strtoupper($this->checkout_details->purchase_units[0]->payments->authorizations[0]->status) : '';
    16581664            $payment_status_reason = isset($this->checkout_details->purchase_units[0]->payments->authorizations[0]->status_details->reason) ? $this->checkout_details->purchase_units[0]->payments->authorizations[0]->status_details->reason : '';
    1659             if (!empty($payment_status_reason)) {
    1660                 // translators: %1$s is the payment method title, %2$s is the pending reason from PayPal.
    1661                 $order->add_order_note(sprintf(__('Payment via %1$s Pending. PayPal reason: %2$s.', 'woo-paypal-gateway'), $this->title, $payment_status_reason));
    1662             }
    1663             apply_filters('woocommerce_payment_successful_result', array('result' => 'success'), $order_id);
    1664             $order->set_transaction_id($transaction_id);
    1665             $order->update_meta_data('_payment_status', $payment_status);
    1666             $order->update_meta_data('_auth_transaction_id', $transaction_id);
    1667             $order->update_meta_data('_payment_action', $this->paymentaction);
    1668             $order->save_meta_data();
    1669             // translators: %1$s is the payment method title, %2$s is the PayPal transaction ID.
    1670             $order->add_order_note(sprintf(__('Payment via %1$s. Transaction ID: %2$s', 'woo-paypal-gateway'), $this->title, $transaction_id));
    1671             $order->add_order_note('Seller Protection Status: ' . ppcp_readable($seller_protection));
    1672             $order->update_status($this->authorized_order_status);
    1673             $order->add_order_note($this->get_payment_authorized_note());
    1674         }
     1665            $this->request->ppcp_log(
     1666                'ppcp_display_order_page authorize: order #' . $order_id .
     1667                ', PayPal order status=' . $this->checkout_details->status .
     1668                ', authorization status=' . ($payment_status ? $payment_status : 'N/A') .
     1669                ', transaction_id=' . ($transaction_id ? $transaction_id : 'N/A')
     1670            );
     1671            $order->add_order_note(sprintf(__('Authorize response status received from PayPal: %s.', 'woo-paypal-gateway'), $payment_status ? $payment_status : __('N/A', 'woo-paypal-gateway')));
     1672            if (in_array($payment_status, array('AUTHORIZED', 'CREATED'), true)) {
     1673                if (!empty($payment_status_reason)) {
     1674                    // translators: %1$s is the payment method title, %2$s is the pending reason from PayPal.
     1675                    $order->add_order_note(sprintf(__('Payment via %1$s Pending. PayPal reason: %2$s.', 'woo-paypal-gateway'), $this->title, $payment_status_reason));
     1676                }
     1677                apply_filters('woocommerce_payment_successful_result', array('result' => 'success'), $order_id);
     1678                $order->set_transaction_id($transaction_id);
     1679                $order->update_meta_data('_payment_status', $payment_status);
     1680                $order->update_meta_data('_auth_transaction_id', $transaction_id);
     1681                $order->update_meta_data('_payment_action', $this->paymentaction);
     1682                $order->save_meta_data();
     1683                // translators: %1$s is the payment method title, %2$s is the PayPal transaction ID.
     1684                $order->add_order_note(sprintf(__('Payment via %1$s. Transaction ID: %2$s', 'woo-paypal-gateway'), $this->title, $transaction_id));
     1685                $order->add_order_note('Seller Protection Status: ' . ppcp_readable($seller_protection));
     1686                $order->update_status($this->authorized_order_status);
     1687                $order->add_order_note($this->get_payment_authorized_note());
     1688                $is_success = true;
     1689            } else {
     1690                $is_success = ppcp_update_woo_order_status($order_id, $payment_status ? $payment_status : 'FAILED', $payment_status_reason);
     1691            }
     1692        }
     1693
     1694        if ($is_handled && !$is_success) {
     1695            if (function_exists('wc_add_notice')) {
     1696                wc_add_notice(__('PayPal payment was not approved. Please try again or use a different payment method.', 'woo-paypal-gateway'), 'error');
     1697            }
     1698            if ($order) {
     1699                wp_safe_redirect($order->get_checkout_payment_url());
     1700            } else {
     1701                wp_safe_redirect(wc_get_checkout_url());
     1702            }
     1703            exit();
     1704        }
     1705
     1706        if (!$is_handled) {
     1707            $paypal_order_status = !empty($this->checkout_details->status) ? strtoupper($this->checkout_details->status) : 'UNKNOWN';
     1708            $this->request->ppcp_log(
     1709                'ppcp_display_order_page: order #' . $order_id . ' was not handled. ' .
     1710                'PayPal order status: ' . $paypal_order_status . '. ' .
     1711                'paymentaction: ' . $this->paymentaction . '. ' .
     1712                'Treating as failed to prevent incorrectly marking order as paid.'
     1713            );
     1714            if ($order) {
     1715                $order->add_order_note(
     1716                    sprintf(
     1717                        __('PayPal payment not completed. PayPal order status received: %s. Order marked as failed.', 'woo-paypal-gateway'),
     1718                        $paypal_order_status
     1719                    )
     1720                );
     1721                if (!$order->has_status(array('failed', 'cancelled'))) {
     1722                    $order->update_status('failed', sprintf(__('PayPal payment not completed. Status: %s', 'woo-paypal-gateway'), $paypal_order_status));
     1723                }
     1724                if (function_exists('wc_add_notice')) {
     1725                    wc_add_notice(__('PayPal payment was not completed. Please try again or use a different payment method.', 'woo-paypal-gateway'), 'error');
     1726                }
     1727                wp_safe_redirect($order->get_checkout_payment_url());
     1728            } else {
     1729                if (function_exists('wc_add_notice')) {
     1730                    wc_add_notice(__('PayPal payment was not completed. Please try again or use a different payment method.', 'woo-paypal-gateway'), 'error');
     1731                }
     1732                wp_safe_redirect(wc_get_checkout_url());
     1733            }
     1734            exit();
     1735        }
     1736
    16751737        wpg_clear_ppcp_session_and_cart();
    16761738        wp_safe_redirect($order->get_checkout_order_received_url());
     
    30583120
    30593121    public function should_enable_google_pay_for_page($page) {
    3060         // Condition 1: Check if Google Pay is explicitly enabled for the current page
    30613122        if ($this->is_google_pay_enable_for_page($page)) {
    30623123            return true;
    30633124        }
    3064 
    3065         // Condition 2: If the current page is "product" or "cart"
    3066         // AND Google Pay is enabled for "mini_cart", treat it as enabled
    30673125        if (in_array($page, ['product', 'cart'], true) && $this->is_google_pay_enable_for_page('mini_cart')) {
    30683126            return true;
    30693127        }
    3070 
    3071         // Condition 3: If the current page is "checkout"
    3072         // AND Express Checkout is enabled, then allow Google Pay
    30733128        if ($page === 'checkout' && $this->is_google_pay_enable_for_page('express_checkout')) {
    30743129            return true;
    30753130        }
    3076 
    3077         // Default: Google Pay is not enabled for this context
    30783131        return false;
    30793132    }
    30803133
    30813134    public function should_enable_apple_pay_for_page($page) {
    3082         // Condition 1: Check if Apple Pay is explicitly enabled for the current page
    30833135        if ($this->is_apple_pay_enable_for_page($page)) {
    30843136            return true;
    30853137        }
    3086 
    3087         // Condition 2: If the current page is "product" or "cart"
    3088         // AND Apple Pay is enabled for "mini_cart", treat it as enabled
    30893138        if (in_array($page, ['product', 'cart'], true) && $this->is_apple_pay_enable_for_page('mini_cart')) {
    30903139            return true;
    30913140        }
    3092 
    3093         // Condition 3: If the current page is "checkout"
    3094         // AND Express Checkout is enabled, then allow Apple Pay
    30953141        if ($page === 'checkout' && $this->is_apple_pay_enable_for_page('express_checkout')) {
    30963142            return true;
    30973143        }
    3098 
    3099         // Default: Apple Pay is not enabled for this context
    31003144        return false;
    31013145    }
  • woo-paypal-gateway/trunk/ppcp/public/js/ppcp-paypal-checkout-for-woocommerce-public.js

    r3487151 r3491671  
    22    class PPCPManager {
    33        constructor(ppcp_manager) {
    4             // 9.0.59
     4            // 9.0.60
    55            this.ppcp_manager = ppcp_manager;
    66            this.productAddToCart = true;
  • woo-paypal-gateway/trunk/readme.txt

    r3487151 r3491671  
    44Requires at least: 3.3 
    55Tested up to: 6.9.4
    6 Stable tag: 9.0.59
     6Stable tag: 9.0.60
    77Requires PHP: 7.4 
    88License: GPLv3 
     
    102102== Changelog ==
    103103
     104= 9.0.60 - 2026-03-21 =
     105* Fixed - Improved handling of authorization-only payments to ensure correct order status updates.
     106
    104107= 9.0.59 - 2026-03-20 =
    105108* Fixed PayPal order capture skipped and shipping address update not applied due to session status race condition during express checkout flow.
  • woo-paypal-gateway/trunk/woo-paypal-gateway.php

    r3487151 r3491671  
    66 * Plugin URI:        https://profiles.wordpress.org/easypayment
    77 * Description:       PayPal, Credit/Debit Cards, Google Pay, Apple Pay, Pay Later, Venmo, SEPA, iDEAL, Mercado Pago, Sofort, Bancontact & more - by an official PayPal Partner
    8  * Version:           9.0.59
     8 * Version:           9.0.60
    99 * Author:            easypayment
    1010 * Author URI:        https://profiles.wordpress.org/easypayment/
     
    2626
    2727if (!defined('WPG_PLUGIN_VERSION')) {
    28     define('WPG_PLUGIN_VERSION', '9.0.59');
     28    define('WPG_PLUGIN_VERSION', '9.0.60');
    2929}
    3030if (!defined('WPG_PLUGIN_PATH')) {
Note: See TracChangeset for help on using the changeset viewer.