From 367ef8edfe1cd94237196a158b04922b5e7b18f6 Mon Sep 17 00:00:00 2001 From: Shahbaz Date: Tue, 12 May 2026 12:52:09 +0500 Subject: [PATCH 1/8] Add support for CheckoutSession --- views/paymentClass.tpl | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/views/paymentClass.tpl b/views/paymentClass.tpl index 101714dc..dceaa6e0 100644 --- a/views/paymentClass.tpl +++ b/views/paymentClass.tpl @@ -12,6 +12,7 @@ use Altapay\Classes\Util; use Altapay\Classes\Core; use Altapay\Helpers; use Altapay\Api\Ecommerce\PaymentRequest; +use Altapay\Api\Payments\CheckoutSession; use Altapay\Request\Address; use Altapay\Request\Customer; use Altapay\Request\Config; @@ -271,7 +272,41 @@ class WC_Gateway_{key} extends WC_Payment_Gateway { } $auth = $this->getAuth(); + $sessionId = null; + + $active_terminals = [ $terminal ]; + $enabled_keys = json_decode( get_option( 'altapay_terminals_enabled', '[]' ), true ) ?: []; + $all_terminals = json_decode( get_option( 'altapay_terminals', '[]' ), true ) ?: []; + + if ( ! empty( $all_terminals ) && ! empty( $enabled_keys ) ) { + foreach ( $all_terminals as $t ) { + if ( isset( $t['key'], $t['name'] ) && in_array( $t['key'], $enabled_keys, true ) && $t['name'] !== $terminal ) { + $active_terminals[] = $t['name']; + } + } + } + + try { + $checkoutSession = new CheckoutSession( $auth ); + $checkoutSession->setTerminal( $terminal ) + ->setTerminals( $active_terminals ) + ->setShopOrderId( $order_id ) + ->setAmount( round( $amount, 2 ) ) + ->setCurrency( $currency ); + + $checkoutSessionResponse = $checkoutSession->call(); + if ( $checkoutSessionResponse->Result === 'Success' ) { + $sessionId = $checkoutSessionResponse->SessionId; + } + } catch ( \Exception $e ) { + $logger = wc_get_logger(); + $logger->warning( 'CheckoutSession failed: ' . $e->getMessage(), array( 'source' => 'altapay' ) ); + } + $request = new PaymentRequest( $auth ); + if ( $sessionId ) { + $request->setSessionId( $sessionId ); + } $request->setTerminal( $terminal ) ->setShopOrderId( $order_id ) ->setAmount( round( $amount, 2 ) ) From 6c42af8d677535af09fa97f116bc38617f033eb3 Mon Sep 17 00:00:00 2001 From: Shahbaz Date: Tue, 12 May 2026 14:08:18 +0500 Subject: [PATCH 2/8] Update altapay/api-php dependency to version ^3.5.9 in composer.json and composer.lock --- composer.json | 2 +- composer.lock | 168 ++++++++++++++++++++++++-------------------------- 2 files changed, 83 insertions(+), 87 deletions(-) diff --git a/composer.json b/composer.json index a014c0f3..0b28f80a 100755 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ }, "require": { "php": "^7.4 || ^8.0", - "altapay/api-php":"^3.0", + "altapay/api-php":"^3.5.9", "eftec/bladeone":"^4.4", "humbug/php-scoper": "0.17.5" }, diff --git a/composer.lock b/composer.lock index 76050be7..927d68a8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3f67a16268f5f038d34d2e85f46d0c18", + "content-hash": "7aef1851ad280240ea498159f57c12ac", "packages": [ { "name": "altapay/api-php", - "version": "3.5.5", + "version": "3.5.9", "source": { "type": "git", "url": "https://github.com/AltaPay/api-php.git", - "reference": "b1e1b06e9645a52a462e6b88ba7209feba8dfdae" + "reference": "9459d5f5f2d0a1bbed07d88328f67130a5d39b62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/AltaPay/api-php/zipball/b1e1b06e9645a52a462e6b88ba7209feba8dfdae", - "reference": "b1e1b06e9645a52a462e6b88ba7209feba8dfdae", + "url": "https://api.github.com/repos/AltaPay/api-php/zipball/9459d5f5f2d0a1bbed07d88328f67130a5d39b62", + "reference": "9459d5f5f2d0a1bbed07d88328f67130a5d39b62", "shasum": "" }, "require": { @@ -58,9 +58,9 @@ ], "support": { "issues": "https://github.com/AltaPay/api-php/issues", - "source": "https://github.com/AltaPay/api-php/tree/3.5.5" + "source": "https://github.com/AltaPay/api-php/tree/3.5.9" }, - "time": "2025-10-10T14:59:05+00:00" + "time": "2026-05-12T08:50:55+00:00" }, { "name": "composer/package-versions-deprecated", @@ -489,16 +489,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "2.8.0", + "version": "2.9.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "21dc724a0583619cd1652f673303492272778051" + "reference": "7d0ed42f28e42d61352a7a79de682e5e67fec884" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/21dc724a0583619cd1652f673303492272778051", - "reference": "21dc724a0583619cd1652f673303492272778051", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/7d0ed42f28e42d61352a7a79de682e5e67fec884", + "reference": "7d0ed42f28e42d61352a7a79de682e5e67fec884", "shasum": "" }, "require": { @@ -514,6 +514,7 @@ "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", "http-interop/http-factory-tests": "0.9.0", + "jshttp/mime-db": "1.54.0.1", "phpunit/phpunit": "^8.5.44 || ^9.6.25" }, "suggest": { @@ -585,7 +586,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.8.0" + "source": "https://github.com/guzzle/psr7/tree/2.9.0" }, "funding": [ { @@ -601,7 +602,7 @@ "type": "tidelift" } ], - "time": "2025-08-23T21:21:41+00:00" + "time": "2026-03-10T16:41:02+00:00" }, { "name": "humbug/php-scoper", @@ -734,16 +735,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.19.4", + "version": "v4.19.5", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2" + "reference": "51bd93cc741b7fc3d63d20b6bdcd99fdaa359837" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/715f4d25e225bc47b293a8b997fe6ce99bf987d2", - "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/51bd93cc741b7fc3d63d20b6bdcd99fdaa359837", + "reference": "51bd93cc741b7fc3d63d20b6bdcd99fdaa359837", "shasum": "" }, "require": { @@ -758,11 +759,6 @@ "bin/php-parse" ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.9-dev" - } - }, "autoload": { "psr-4": { "PhpParser\\": "lib/PhpParser" @@ -784,9 +780,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.4" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.5" }, - "time": "2024-09-29T15:01:53+00:00" + "time": "2025-12-06T11:45:25+00:00" }, { "name": "psr/container", @@ -1621,16 +1617,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.33.0", + "version": "v1.37.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" + "reference": "141046a8f9477948ff284fa65be2095baafb94f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", - "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/141046a8f9477948ff284fa65be2095baafb94f2", + "reference": "141046a8f9477948ff284fa65be2095baafb94f2", "shasum": "" }, "require": { @@ -1680,7 +1676,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.33.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.37.0" }, "funding": [ { @@ -1700,20 +1696,20 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2026-04-10T16:19:22+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.33.0", + "version": "v1.37.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "380872130d3a5dd3ace2f4010d95125fde5d5c70" + "reference": "4864388bfbd3001ce88e234fab652acd91fdc57e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/380872130d3a5dd3ace2f4010d95125fde5d5c70", - "reference": "380872130d3a5dd3ace2f4010d95125fde5d5c70", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/4864388bfbd3001ce88e234fab652acd91fdc57e", + "reference": "4864388bfbd3001ce88e234fab652acd91fdc57e", "shasum": "" }, "require": { @@ -1762,7 +1758,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.33.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.37.0" }, "funding": [ { @@ -1782,11 +1778,11 @@ "type": "tidelift" } ], - "time": "2025-06-27T09:58:17+00:00" + "time": "2026-04-26T13:13:48+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.33.0", + "version": "v1.37.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", @@ -1847,7 +1843,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.33.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.37.0" }, "funding": [ { @@ -1871,16 +1867,16 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.33.0", + "version": "v1.37.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493" + "reference": "6a21eb99c6973357967f6ce3708cd55a6bec6315" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493", - "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6a21eb99c6973357967f6ce3708cd55a6bec6315", + "reference": "6a21eb99c6973357967f6ce3708cd55a6bec6315", "shasum": "" }, "require": { @@ -1932,7 +1928,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.33.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.37.0" }, "funding": [ { @@ -1952,20 +1948,20 @@ "type": "tidelift" } ], - "time": "2024-12-23T08:48:59+00:00" + "time": "2026-04-10T17:25:58+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.33.0", + "version": "v1.37.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608" + "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608", - "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dfb55726c3a76ea3b6459fcfda1ec2d80a682411", + "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411", "shasum": "" }, "require": { @@ -2016,7 +2012,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.33.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.37.0" }, "funding": [ { @@ -2036,11 +2032,11 @@ "type": "tidelift" } ], - "time": "2025-01-02T08:10:11+00:00" + "time": "2026-04-10T16:19:22+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.33.0", + "version": "v1.37.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", @@ -2096,7 +2092,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.33.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.37.0" }, "funding": [ { @@ -2428,28 +2424,28 @@ }, { "name": "webmozart/assert", - "version": "1.11.0", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/webmozarts/assert.git", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" + "reference": "9be6926d8b485f55b9229203f962b51ed377ba68" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/9be6926d8b485f55b9229203f962b51ed377ba68", + "reference": "9be6926d8b485f55b9229203f962b51ed377ba68", "shasum": "" }, "require": { "ext-ctype": "*", + "ext-date": "*", + "ext-filter": "*", "php": "^7.2 || ^8.0" }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" + "suggest": { + "ext-intl": "", + "ext-simplexml": "", + "ext-spl": "" }, "type": "library", "extra": { @@ -2480,9 +2476,9 @@ ], "support": { "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.11.0" + "source": "https://github.com/webmozarts/assert/tree/1.12.1" }, - "time": "2022-06-03T18:03:27+00:00" + "time": "2025-10-29T15:56:20+00:00" } ], "packages-dev": [ @@ -3185,16 +3181,16 @@ }, { "name": "phpunit/phpunit", - "version": "8.5.48", + "version": "8.5.52", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "75f469c1948b91aa566206f88412c88f08090b32" + "reference": "1015741814413c156abb0f53d7db7bbd03c6e858" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/75f469c1948b91aa566206f88412c88f08090b32", - "reference": "75f469c1948b91aa566206f88412c88f08090b32", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1015741814413c156abb0f53d7db7bbd03c6e858", + "reference": "1015741814413c156abb0f53d7db7bbd03c6e858", "shasum": "" }, "require": { @@ -3213,7 +3209,7 @@ "phpunit/php-file-iterator": "^2.0.6", "phpunit/php-text-template": "^1.2.1", "phpunit/php-timer": "^2.1.4", - "sebastian/comparator": "^3.0.6", + "sebastian/comparator": "^3.0.7", "sebastian/diff": "^3.0.6", "sebastian/environment": "^4.2.5", "sebastian/exporter": "^3.1.8", @@ -3263,7 +3259,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.48" + "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.52" }, "funding": [ { @@ -3287,7 +3283,7 @@ "type": "tidelift" } ], - "time": "2025-09-24T06:27:39+00:00" + "time": "2026-01-27T05:20:18+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -3346,16 +3342,16 @@ }, { "name": "sebastian/comparator", - "version": "3.0.6", + "version": "3.0.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "4b3c947888c81708b20fb081bb653a2ba68f989a" + "reference": "bc7d8ac2fe1cce229bff9b5fd4efe65918a1ff52" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/4b3c947888c81708b20fb081bb653a2ba68f989a", - "reference": "4b3c947888c81708b20fb081bb653a2ba68f989a", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/bc7d8ac2fe1cce229bff9b5fd4efe65918a1ff52", + "reference": "bc7d8ac2fe1cce229bff9b5fd4efe65918a1ff52", "shasum": "" }, "require": { @@ -3408,7 +3404,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/3.0.6" + "source": "https://github.com/sebastianbergmann/comparator/tree/3.0.7" }, "funding": [ { @@ -3428,7 +3424,7 @@ "type": "tidelift" } ], - "time": "2025-08-10T05:29:24+00:00" + "time": "2026-01-24T09:20:25+00:00" }, { "name": "sebastian/diff", @@ -4131,16 +4127,16 @@ }, { "name": "theseer/tokenizer", - "version": "1.2.3", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" + "reference": "b7489ce515e168639d17feec34b8847c326b0b3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", - "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b7489ce515e168639d17feec34b8847c326b0b3c", + "reference": "b7489ce515e168639d17feec34b8847c326b0b3c", "shasum": "" }, "require": { @@ -4169,7 +4165,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.3" + "source": "https://github.com/theseer/tokenizer/tree/1.3.1" }, "funding": [ { @@ -4177,17 +4173,17 @@ "type": "github" } ], - "time": "2024-03-03T12:36:25+00:00" + "time": "2025-11-17T20:03:58+00:00" } ], "aliases": [], "minimum-stability": "dev", - "stability-flags": {}, + "stability-flags": [], "prefer-stable": true, "prefer-lowest": false, "platform": { "php": "^7.4 || ^8.0" }, - "platform-dev": {}, - "plugin-api-version": "2.6.0" + "platform-dev": [], + "plugin-api-version": "2.2.0" } From 6b3136ae40ab0446f4c8788725a39c3324aa6e0b Mon Sep 17 00:00:00 2001 From: Shahbaz Date: Tue, 12 May 2026 14:15:16 +0500 Subject: [PATCH 3/8] Update supported versions and release notes --- CHANGELOG.md | 3 +++ altapay.php | 6 +++--- readme.txt | 9 ++++++--- wiki.md | 4 ++-- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e64f5db5..a67eae63 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.8.7] +- Add support for MarketPay payment methods. + ## [3.8.6] - Fix: Apple Pay orders are marked as Processing even when the payment fails. diff --git a/altapay.php b/altapay.php index 41473219..3b5a6883 100755 --- a/altapay.php +++ b/altapay.php @@ -7,10 +7,10 @@ * Author URI: https://altapay.com * Text Domain: altapay * Domain Path: /languages - * Version: 3.8.6 + * Version: 3.8.7 * Name: SDM_Altapay * WC requires at least: 3.9.0 - * WC tested up to: 10.4.3 + * WC tested up to: 10.7.0 * * @package Altapay */ @@ -41,7 +41,7 @@ } if ( ! defined( 'ALTAPAY_PLUGIN_VERSION' ) ) { - define( 'ALTAPAY_PLUGIN_VERSION', '3.8.6' ); + define( 'ALTAPAY_PLUGIN_VERSION', '3.8.7' ); } // Include the autoloader, so we can dynamically include the rest of the classes. diff --git a/readme.txt b/readme.txt index f2af7453..f783843e 100644 --- a/readme.txt +++ b/readme.txt @@ -3,11 +3,11 @@ Contributors: altapay_integrations Tags: AltaPay, Gateway, Payments, WooCommerce, Payment Card Industry Requires PHP: 7.4 Requires at least: 5.0 -Tested up to: 6.8.2 -Stable tag: 3.8.6 +Tested up to: 6.9.4 +Stable tag: 3.8.7 License: MIT WC requires at least: 3.9.0 -WC tested up to: 10.4.3 +WC tested up to: 10.7.0 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.8.7 = +* Add support for MarketPay payment methods. + = 3.8.6 = * Fix: Apple Pay orders are marked as Processing even when the payment fails. diff --git a/wiki.md b/wiki.md index a3654076..c5278ac0 100644 --- a/wiki.md +++ b/wiki.md @@ -317,13 +317,13 @@ The new credentials can now be used as the API Username and API Password in your Minimum system requirements are: - WordPress min. 5.0 – max. 6.9 -- WooCommerce min. 3.9.0 – max. 10.4.3 +- WooCommerce min. 3.9.0 – max. 10.7.0 - PHP 7.4 and above - PHP-bcmath library installed. - PHP-curl MUST be enabled. The latest tested version is: -- WordPress 6.9, WooCommerce 10.4.3 and PHP 8.4 +- WordPress 6.9, WooCommerce 10.7.0 and PHP 8.4 ## Troubleshooting From 36ed9002c5ba64008621e222312a5808d961549d Mon Sep 17 00:00:00 2001 From: Shahbaz Date: Tue, 12 May 2026 14:37:24 +0500 Subject: [PATCH 4/8] Update supported WordPress version to 6.9.4 --- wiki.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wiki.md b/wiki.md index c5278ac0..f095fe74 100644 --- a/wiki.md +++ b/wiki.md @@ -316,14 +316,14 @@ The new credentials can now be used as the API Username and API Password in your ## Supported versions Minimum system requirements are: -- WordPress min. 5.0 – max. 6.9 +- WordPress min. 5.0 – max. 6.9.4 - WooCommerce min. 3.9.0 – max. 10.7.0 - PHP 7.4 and above - PHP-bcmath library installed. - PHP-curl MUST be enabled. The latest tested version is: -- WordPress 6.9, WooCommerce 10.7.0 and PHP 8.4 +- WordPress 6.9.4, WooCommerce 10.7.0 and PHP 8.4 ## Troubleshooting From c56d06cf14fb8f762274dc5cd5a3b7127ad074ee Mon Sep 17 00:00:00 2001 From: Shahbaz Date: Wed, 13 May 2026 11:50:24 +0500 Subject: [PATCH 5/8] Fix session ID retrieval in CheckoutSession response handling --- views/paymentClass.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/views/paymentClass.tpl b/views/paymentClass.tpl index dceaa6e0..f467eb46 100644 --- a/views/paymentClass.tpl +++ b/views/paymentClass.tpl @@ -295,8 +295,8 @@ class WC_Gateway_{key} extends WC_Payment_Gateway { ->setCurrency( $currency ); $checkoutSessionResponse = $checkoutSession->call(); - if ( $checkoutSessionResponse->Result === 'Success' ) { - $sessionId = $checkoutSessionResponse->SessionId; + if ( isset($checkoutSessionResponse->Session->Id ) && !empty( $checkoutSessionResponse->Session->Id ) ) { + $sessionId = $checkoutSessionResponse->Session->Id; } } catch ( \Exception $e ) { $logger = wc_get_logger(); From f66d10c901ac349a6bdcb0e747d3bbdd91ea5ccc Mon Sep 17 00:00:00 2001 From: Shahbaz Date: Wed, 13 May 2026 19:36:11 +0500 Subject: [PATCH 6/8] Refactor active terminal retrieval in payment gateway to use enabled gateways --- views/paymentClass.tpl | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/views/paymentClass.tpl b/views/paymentClass.tpl index f467eb46..aeda2675 100644 --- a/views/paymentClass.tpl +++ b/views/paymentClass.tpl @@ -275,14 +275,10 @@ class WC_Gateway_{key} extends WC_Payment_Gateway { $sessionId = null; $active_terminals = [ $terminal ]; - $enabled_keys = json_decode( get_option( 'altapay_terminals_enabled', '[]' ), true ) ?: []; - $all_terminals = json_decode( get_option( 'altapay_terminals', '[]' ), true ) ?: []; - - if ( ! empty( $all_terminals ) && ! empty( $enabled_keys ) ) { - foreach ( $all_terminals as $t ) { - if ( isset( $t['key'], $t['name'] ) && in_array( $t['key'], $enabled_keys, true ) && $t['name'] !== $terminal ) { - $active_terminals[] = $t['name']; - } + $all_gateways = WC()->payment_gateways()->payment_gateways(); + foreach ( $all_gateways as $gateway ) { + if ( strpos( $gateway->id, 'altapay_' ) === 0 && property_exists( $gateway, 'terminal' ) && isset( $gateway->enabled ) && $gateway->enabled === 'yes' && ! empty( trim( (string) $gateway->terminal ) ) && $gateway->terminal !== $terminal ) { + $active_terminals[] = $gateway->terminal; } } From 45af6d4839a536963457a4fff793f0155d48ed54 Mon Sep 17 00:00:00 2001 From: Shahbaz Date: Thu, 14 May 2026 15:29:51 +0500 Subject: [PATCH 7/8] Do not mark payment as completed if subscription is not charged --- helpers/traits/AltapayMaster.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/helpers/traits/AltapayMaster.php b/helpers/traits/AltapayMaster.php index 1bfe806e..bf32fda2 100644 --- a/helpers/traits/AltapayMaster.php +++ b/helpers/traits/AltapayMaster.php @@ -95,7 +95,7 @@ public function scheduledSubscriptionsPayment( $amount, $renewal_order ) { $api = new ChargeSubscription( $this->getAuth() ); $api->setTransaction( $agreement_id ); $api->setAmount( round( $amount, 2 ) ); - $api->setReconciliationIdentifier( wp_generate_uuid4() ); + $api->setReconciliationIdentifier( $reconciliationId ); $response = $api->call(); @@ -119,8 +119,6 @@ public function scheduledSubscriptionsPayment( $amount, $renewal_order ) { sprintf( __( 'AltaPay payment declined: %s', 'altapay' ), $response->MerchantErrorMessage ) ); } - } else { - $renewal_order->payment_complete(); } $renewal_order->update_meta_data( '_agreement_id', $agreement_id ); From bf06ad00c278c5217fc391feabb115cb0d2bcb3d Mon Sep 17 00:00:00 2001 From: Shahbaz Date: Thu, 14 May 2026 15:36:26 +0500 Subject: [PATCH 8/8] Update release notes --- CHANGELOG.md | 1 + readme.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a67eae63..61ab08d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. ## [3.8.7] - Add support for MarketPay payment methods. +- Fix: Renewal/Recurring order status automatically changed to Processing. ## [3.8.6] - Fix: Apple Pay orders are marked as Processing even when the payment fails. diff --git a/readme.txt b/readme.txt index f783843e..c041dbe5 100644 --- a/readme.txt +++ b/readme.txt @@ -41,6 +41,7 @@ AltaPay's Payment Gateway for WooCommerce provides merchants with access to a fu = 3.8.7 = * Add support for MarketPay payment methods. +* Fix: Renewal/Recurring order status automatically changed to Processing. = 3.8.6 = * Fix: Apple Pay orders are marked as Processing even when the payment fails.