From 05dc87964ba29ebe428aa8238ac45a14eb79e5e0 Mon Sep 17 00:00:00 2001 From: Shahbaz Date: Tue, 3 Dec 2024 16:56:33 +0500 Subject: [PATCH] Prevent duplicate charge subscription attempts for MobilePay payments. --- CHANGELOG.md | 3 +++ altapay.php | 6 +++--- classes/core/AltapaySettings.php | 2 +- readme.txt | 7 +++++-- wiki.md | 4 ++-- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 876841a2..d20b5d5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog All notable changes to this project will be documented in this file. +## [3.7.4] +- Fix: Prevent duplicate charge subscription attempts for MobilePay payments. + ## [3.7.3] - Fix: Payment charged multiple times for subscription order. diff --git a/altapay.php b/altapay.php index eff281a1..8380f0d3 100755 --- a/altapay.php +++ b/altapay.php @@ -7,10 +7,10 @@ * Author URI: https://altapay.com * Text Domain: altapay * Domain Path: /languages - * Version: 3.7.3 + * Version: 3.7.4 * Name: SDM_Altapay * WC requires at least: 3.9.0 - * WC tested up to: 9.3.3 + * WC tested up to: 9.4.2 * * @package Altapay */ @@ -41,7 +41,7 @@ } if ( ! defined( 'ALTAPAY_PLUGIN_VERSION' ) ) { - define( 'ALTAPAY_PLUGIN_VERSION', '3.7.3' ); + define( 'ALTAPAY_PLUGIN_VERSION', '3.7.4' ); } // Include the autoloader, so we can dynamically include the rest of the classes. diff --git a/classes/core/AltapaySettings.php b/classes/core/AltapaySettings.php index 81976727..0e1d021d 100755 --- a/classes/core/AltapaySettings.php +++ b/classes/core/AltapaySettings.php @@ -114,7 +114,7 @@ public function altapayOrderStatusCompleted( $orderID ) { $api->setTransaction( $txnID ); $response = $api->call(); - if ( $response->Result !== 'Success' ) { + if ( $response && ! in_array( $response->Result, array( 'Success', 'Open' ), true ) ) { $order->add_order_note( __( 'Capture failed: ' . $response->MerchantErrorMessage, diff --git a/readme.txt b/readme.txt index 3b4ef730..ab76ff8b 100644 --- a/readme.txt +++ b/readme.txt @@ -4,10 +4,10 @@ Tags: AltaPay, Gateway, Payments, WooCommerce, Payment Card Industry Requires PHP: 7.4 Requires at least: 5.0 Tested up to: 6.6.2 -Stable tag: 3.7.3 +Stable tag: 3.7.4 License: MIT WC requires at least: 3.9.0 -WC tested up to: 9.3.3 +WC tested up to: 9.4.2 License URI: http://www.gnu.org/licenses/gpl-2.0.html A plugin that integrates your WooCommerce web shop to the AltaPay payments gateway. @@ -39,6 +39,9 @@ AltaPay's Payment Gateway for WooCommerce provides merchants with access to a fu == Changelog == += 3.7.4 = +* Fix: Prevent duplicate charge subscription attempts for MobilePay payments. + = 3.7.3 = * Fix: Payment charged multiple times for subscription order. diff --git a/wiki.md b/wiki.md index 4afb5824..beaa0180 100644 --- a/wiki.md +++ b/wiki.md @@ -275,13 +275,13 @@ In order to reconcile payments please follow the steps below: Minimum system requirements are: - WordPress min. 5.0 – max. 6.6.2 -- WooCommerce min. 3.9.0 – max. 9.3.3 +- WooCommerce min. 3.9.0 – max. 9.4.2 - PHP 7.4 and above - PHP-bcmath library installed. - PHP-curl MUST be enabled. The latest tested version is: -- WordPress 6.6.2, WooCommerce 9.3.3 and PHP 8.1 +- WordPress 6.6.2, WooCommerce 9.4.2 and PHP 8.1 ## Troubleshooting