Plugin Directory

Changeset 3239254


Ignore:
Timestamp:
02/12/2025 10:00:25 AM (12 months ago)
Author:
PerfectSolution
Message:

Update trunk/ - 7.3.5

Location:
woocommerce-quickpay
Files:
12 edited
2 copied

Legend:

Unmodified
Added
Removed
  • woocommerce-quickpay/tags/7.3.5/README.txt

    r3095043 r3239254  
    2828
    2929== Changelog ==
    30 = 7.3.4=
     30= 7.3.5 =
     31* Fix: woocommerce_quickpay_get_order now makes a specific check on WC_Order instance to avoid possible direct property access on a WC_Order object.
     32* Fix: add check in callback handler to avoid payment failed transitioning on orders and subscriptions that does not actually require a payment.
     33* Fix: add extra check on qp_status_code in callback handler to avoid possible incorrect logging when refunds or captures fail.
     34
     35= 7.3.4 =
    3136* Fix: MobilePay Subscriptions now calls WC_Subscription::cancel_order to leverage support of pending-cancel/cancelled logic when setting "Cancelled agreement status" to 'Cancelled'.
    3237* Fix: Change QuickPay to Quickpay in text strings
  • woocommerce-quickpay/tags/7.3.5/classes/woocommerce-quickpay-callbacks.php

    r3095043 r3239254  
    6060            $order->update_status( 'completed', $capture_note );
    6161        } else {
    62             $order->add_order_note( $capture_note );
     62            $order->add_order_note( 'Quickpay: ' . $capture_note );
    6363        }
    6464
  • woocommerce-quickpay/tags/7.3.5/helpers/transactions.php

    r2924617 r3239254  
    9393 */
    9494function woocommerce_quickpay_get_order( $order ): ?WC_Order {
     95
    9596    if ( ! is_object( $order ) ) {
    9697        return wc_get_order( $order ) ?: null;
     98    }
     99
     100    if ( $order instanceof WC_Order ) {
     101        return $order;
    97102    }
    98103
  • woocommerce-quickpay/tags/7.3.5/trunk/README.txt

    r3095043 r3239254  
    2828
    2929== Changelog ==
    30 = 7.3.4=
     30= 7.3.5 =
     31* Fix: woocommerce_quickpay_get_order now makes a specific check on WC_Order instance to avoid possible direct property access on a WC_Order object.
     32* Fix: add check in callback handler to avoid payment failed transitioning on orders and subscriptions that does not actually require a payment.
     33* Fix: add extra check on qp_status_code in callback handler to avoid possible incorrect logging when refunds or captures fail.
     34
     35= 7.3.4 =
    3136* Fix: MobilePay Subscriptions now calls WC_Subscription::cancel_order to leverage support of pending-cancel/cancelled logic when setting "Cancelled agreement status" to 'Cancelled'.
    3237* Fix: Change QuickPay to Quickpay in text strings
  • woocommerce-quickpay/tags/7.3.5/trunk/classes/woocommerce-quickpay-callbacks.php

    r3095043 r3239254  
    6060            $order->update_status( 'completed', $capture_note );
    6161        } else {
    62             $order->add_order_note( $capture_note );
     62            $order->add_order_note( 'Quickpay: ' . $capture_note );
    6363        }
    6464
  • woocommerce-quickpay/tags/7.3.5/trunk/helpers/transactions.php

    r2924617 r3239254  
    9393 */
    9494function woocommerce_quickpay_get_order( $order ): ?WC_Order {
     95
    9596    if ( ! is_object( $order ) ) {
    9697        return wc_get_order( $order ) ?: null;
     98    }
     99
     100    if ( $order instanceof WC_Order ) {
     101        return $order;
    97102    }
    98103
  • woocommerce-quickpay/tags/7.3.5/trunk/woocommerce-quickpay.php

    r3095043 r3239254  
    44 * Plugin URI: http://wordpress.org/plugins/woocommerce-quickpay/
    55 * Description: Integrates your Quickpay payment gateway into your WooCommerce installation.
    6  * Version: 7.3.4
     6 * Version: 7.3.5
    77 * Author: Perfect Solution
    88 * Text Domain: woo-quickpay
     
    2020}
    2121
    22 define( 'WCQP_VERSION', '7.3.4' );
     22define( 'WCQP_VERSION', '7.3.5' );
    2323define( 'WCQP_URL', plugins_url( __FILE__ ) );
    2424define( 'WCQP_PATH', plugin_dir_path( __FILE__ ) );
     
    784784                $subscription_id = WC_QuickPay_Callbacks::get_subscription_id_from_callback( $json );
    785785                $subscription    = null;
     786
    786787                if ( $subscription_id !== null ) {
    787788                    $subscription = woocommerce_quickpay_get_subscription( $subscription_id );
     
    797798                    // Is the transaction accepted and approved by QP / Acquirer?
    798799                    // Did we find an order?
    799                     if ( $json->accepted && $order ) {
     800                    if ( $json->accepted && $order && in_array( (int) $transaction->qp_status_code, [ 20000, 20200 ], true ) ) {
    800801                        do_action( 'woocommerce_quickpay_accepted_callback_before_processing', $order, $json );
    801802                        do_action( 'woocommerce_quickpay_accepted_callback_before_processing_status_' . $transaction->type, $order, $json );
     
    823824
    824825                                case 'refund' :
    825                                     $order->add_order_note( sprintf( __( 'Refunded %s %s', 'woo-quickpay' ), WC_QuickPay_Helper::price_normalize( $transaction->amount, $json->currency ), $json->currency ) );
     826                                    $order->add_order_note( sprintf( 'Quickpay: ' . __( 'Refunded %s %s', 'woo-quickpay' ), WC_QuickPay_Helper::price_normalize( $transaction->amount, $json->currency ), $json->currency ) );
    826827                                    break;
    827828
     
    865866                        ] );
    866867
    867                         if ( $order && ( $transaction->type === 'recurring' || 'rejected' !== $json->state ) ) {
     868                        if ( $order && $order->needs_payment() && ( $transaction->type === 'recurring' || 'rejected' !== $json->state ) ) {
    868869                            $order->update_status( 'failed', sprintf( 'Payment failed <br />QuickPay Message: %s<br />Acquirer Message: %s', $transaction->qp_status_msg, $transaction->aq_status_msg ) );
    869870                        }
  • woocommerce-quickpay/tags/7.3.5/woocommerce-quickpay.php

    r3095043 r3239254  
    44 * Plugin URI: http://wordpress.org/plugins/woocommerce-quickpay/
    55 * Description: Integrates your Quickpay payment gateway into your WooCommerce installation.
    6  * Version: 7.3.4
     6 * Version: 7.3.5
    77 * Author: Perfect Solution
    88 * Text Domain: woo-quickpay
     
    2020}
    2121
    22 define( 'WCQP_VERSION', '7.3.4' );
     22define( 'WCQP_VERSION', '7.3.5' );
    2323define( 'WCQP_URL', plugins_url( __FILE__ ) );
    2424define( 'WCQP_PATH', plugin_dir_path( __FILE__ ) );
     
    784784                $subscription_id = WC_QuickPay_Callbacks::get_subscription_id_from_callback( $json );
    785785                $subscription    = null;
     786
    786787                if ( $subscription_id !== null ) {
    787788                    $subscription = woocommerce_quickpay_get_subscription( $subscription_id );
     
    797798                    // Is the transaction accepted and approved by QP / Acquirer?
    798799                    // Did we find an order?
    799                     if ( $json->accepted && $order ) {
     800                    if ( $json->accepted && $order && in_array( (int) $transaction->qp_status_code, [ 20000, 20200 ], true ) ) {
    800801                        do_action( 'woocommerce_quickpay_accepted_callback_before_processing', $order, $json );
    801802                        do_action( 'woocommerce_quickpay_accepted_callback_before_processing_status_' . $transaction->type, $order, $json );
     
    823824
    824825                                case 'refund' :
    825                                     $order->add_order_note( sprintf( __( 'Refunded %s %s', 'woo-quickpay' ), WC_QuickPay_Helper::price_normalize( $transaction->amount, $json->currency ), $json->currency ) );
     826                                    $order->add_order_note( sprintf( 'Quickpay: ' . __( 'Refunded %s %s', 'woo-quickpay' ), WC_QuickPay_Helper::price_normalize( $transaction->amount, $json->currency ), $json->currency ) );
    826827                                    break;
    827828
     
    865866                        ] );
    866867
    867                         if ( $order && ( $transaction->type === 'recurring' || 'rejected' !== $json->state ) ) {
     868                        if ( $order && $order->needs_payment() && ( $transaction->type === 'recurring' || 'rejected' !== $json->state ) ) {
    868869                            $order->update_status( 'failed', sprintf( 'Payment failed <br />QuickPay Message: %s<br />Acquirer Message: %s', $transaction->qp_status_msg, $transaction->aq_status_msg ) );
    869870                        }
  • woocommerce-quickpay/trunk/README.txt

    r3095043 r3239254  
    2828
    2929== Changelog ==
    30 = 7.3.4=
     30= 7.3.5 =
     31* Fix: woocommerce_quickpay_get_order now makes a specific check on WC_Order instance to avoid possible direct property access on a WC_Order object.
     32* Fix: add check in callback handler to avoid payment failed transitioning on orders and subscriptions that does not actually require a payment.
     33* Fix: add extra check on qp_status_code in callback handler to avoid possible incorrect logging when refunds or captures fail.
     34
     35= 7.3.4 =
    3136* Fix: MobilePay Subscriptions now calls WC_Subscription::cancel_order to leverage support of pending-cancel/cancelled logic when setting "Cancelled agreement status" to 'Cancelled'.
    3237* Fix: Change QuickPay to Quickpay in text strings
  • woocommerce-quickpay/trunk/classes/woocommerce-quickpay-callbacks.php

    r3095043 r3239254  
    6060            $order->update_status( 'completed', $capture_note );
    6161        } else {
    62             $order->add_order_note( $capture_note );
     62            $order->add_order_note( 'Quickpay: ' . $capture_note );
    6363        }
    6464
  • woocommerce-quickpay/trunk/helpers/transactions.php

    r2924617 r3239254  
    9393 */
    9494function woocommerce_quickpay_get_order( $order ): ?WC_Order {
     95
    9596    if ( ! is_object( $order ) ) {
    9697        return wc_get_order( $order ) ?: null;
     98    }
     99
     100    if ( $order instanceof WC_Order ) {
     101        return $order;
    97102    }
    98103
  • woocommerce-quickpay/trunk/woocommerce-quickpay.php

    r3095043 r3239254  
    44 * Plugin URI: http://wordpress.org/plugins/woocommerce-quickpay/
    55 * Description: Integrates your Quickpay payment gateway into your WooCommerce installation.
    6  * Version: 7.3.4
     6 * Version: 7.3.5
    77 * Author: Perfect Solution
    88 * Text Domain: woo-quickpay
     
    2020}
    2121
    22 define( 'WCQP_VERSION', '7.3.4' );
     22define( 'WCQP_VERSION', '7.3.5' );
    2323define( 'WCQP_URL', plugins_url( __FILE__ ) );
    2424define( 'WCQP_PATH', plugin_dir_path( __FILE__ ) );
     
    784784                $subscription_id = WC_QuickPay_Callbacks::get_subscription_id_from_callback( $json );
    785785                $subscription    = null;
     786
    786787                if ( $subscription_id !== null ) {
    787788                    $subscription = woocommerce_quickpay_get_subscription( $subscription_id );
     
    797798                    // Is the transaction accepted and approved by QP / Acquirer?
    798799                    // Did we find an order?
    799                     if ( $json->accepted && $order ) {
     800                    if ( $json->accepted && $order && in_array( (int) $transaction->qp_status_code, [ 20000, 20200 ], true ) ) {
    800801                        do_action( 'woocommerce_quickpay_accepted_callback_before_processing', $order, $json );
    801802                        do_action( 'woocommerce_quickpay_accepted_callback_before_processing_status_' . $transaction->type, $order, $json );
     
    823824
    824825                                case 'refund' :
    825                                     $order->add_order_note( sprintf( __( 'Refunded %s %s', 'woo-quickpay' ), WC_QuickPay_Helper::price_normalize( $transaction->amount, $json->currency ), $json->currency ) );
     826                                    $order->add_order_note( sprintf( 'Quickpay: ' . __( 'Refunded %s %s', 'woo-quickpay' ), WC_QuickPay_Helper::price_normalize( $transaction->amount, $json->currency ), $json->currency ) );
    826827                                    break;
    827828
     
    865866                        ] );
    866867
    867                         if ( $order && ( $transaction->type === 'recurring' || 'rejected' !== $json->state ) ) {
     868                        if ( $order && $order->needs_payment() && ( $transaction->type === 'recurring' || 'rejected' !== $json->state ) ) {
    868869                            $order->update_status( 'failed', sprintf( 'Payment failed <br />QuickPay Message: %s<br />Acquirer Message: %s', $transaction->qp_status_msg, $transaction->aq_status_msg ) );
    869870                        }
Note: See TracChangeset for help on using the changeset viewer.