diff --git a/CHANGELOG.md b/CHANGELOG.md index f72cdbbf..01fb321f 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.5] +- Support gateway form independent of the plugin/theme styling. + ## [3.8.4] - Add support for Checkout Design v2. diff --git a/altapay.php b/altapay.php index 7e1318e8..bad7344e 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.4 + * Version: 3.8.5 * Name: SDM_Altapay * WC requires at least: 3.9.0 - * WC tested up to: 10.2.1 + * WC tested up to: 10.2.2 * * @package Altapay */ @@ -41,7 +41,7 @@ } if ( ! defined( 'ALTAPAY_PLUGIN_VERSION' ) ) { - define( 'ALTAPAY_PLUGIN_VERSION', '3.8.4' ); + define( 'ALTAPAY_PLUGIN_VERSION', '3.8.5' ); } // Include the autoloader, so we can dynamically include the rest of the classes. @@ -227,6 +227,7 @@ function altapay_page_template( $template ) { $callbackPages = array( 'altapay_payment_page' => 'altapay-payment-form.php', 'altapay_callback_redirect_page' => 'altapay-callback-redirect.php', + 'altapay_external_payment_page' => 'altapay-payment-form-external.php', ); foreach ( $callbackPages as $optionKey => $templateFile ) { diff --git a/classes/core/AltapayPluginInstall.php b/classes/core/AltapayPluginInstall.php index 1e9c4fa7..0fff58a1 100644 --- a/classes/core/AltapayPluginInstall.php +++ b/classes/core/AltapayPluginInstall.php @@ -99,5 +99,29 @@ public static function createCallbackRedirectPage() { update_option( 'altapay_callback_redirect_page', $page_id ); } } + + /** + * Create new page for external checkout. + * + * @return void + */ + public static function createExternalPaymentPage() { + + if ( empty( trim( get_option( 'altapay_external_payment_page' ) ) ) ) { + $page_data = array( + 'post_status' => 'publish', + 'post_type' => 'page', + 'post_author' => 1, + 'post_title' => 'AltaPay Payment Form External', + 'post_content' => '', + 'post_parent' => 0, + 'comment_status' => 'closed', + ); + + $page_id = wp_insert_post( $page_data ); + + update_option( 'altapay_external_payment_page', $page_id ); + } + } } diff --git a/classes/core/AltapaySettings.php b/classes/core/AltapaySettings.php index 612a55df..77cd4c05 100644 --- a/classes/core/AltapaySettings.php +++ b/classes/core/AltapaySettings.php @@ -297,6 +297,7 @@ public function altapayRegisterSettings() { register_setting( 'altapay-settings-group', 'altapay_fraud_detection_action' ); register_setting( 'altapay-settings-group', 'altapay_payment_page' ); register_setting( 'altapay-settings-group', 'altapay_cc_form_styling' ); + register_setting( 'altapay-settings-group', 'altapay_payment_page_layout' ); register_setting( 'altapay-settings-group', 'altapay_terminals_enabled', @@ -338,6 +339,7 @@ public function altapaySettings() { $altapay_fraud_detection = get_option( 'altapay_fraud_detection' ); $altapay_fraud_detection_action = get_option( 'altapay_fraud_detection_action' ); $cc_form_styling = get_option( 'altapay_cc_form_styling' ); + $payment_page_layout = get_option( 'altapay_payment_page_layout' ); if ( $terminalDetails ) { $terminals = json_decode( get_option( 'altapay_terminals' ) ); @@ -398,6 +400,7 @@ public function altapaySettings() { 'altapay_fraud_detection' => $altapay_fraud_detection, 'altapay_fraud_detection_action' => $altapay_fraud_detection_action, 'cc_form_styling' => $cc_form_styling, + 'payment_page_layout' => $payment_page_layout, ) ); @@ -614,6 +617,12 @@ function altapayCapturesPostInit() { if ( empty( $callback_redirect_page ) ) { Core\AltapayPluginInstall::createCallbackRedirectPage(); } + + $external_payment_page = get_option( 'altapay_external_payment_page' ); + + if ( empty( $external_payment_page ) ) { + Core\AltapayPluginInstall::createExternalPaymentPage(); + } } /** diff --git a/composer.lock b/composer.lock index 27e68692..76050be7 100644 --- a/composer.lock +++ b/composer.lock @@ -8,16 +8,16 @@ "packages": [ { "name": "altapay/api-php", - "version": "3.5.4", + "version": "3.5.5", "source": { "type": "git", "url": "https://github.com/AltaPay/api-php.git", - "reference": "6fd4457ebb66a83c0995ad86764db40207ad5f53" + "reference": "b1e1b06e9645a52a462e6b88ba7209feba8dfdae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/AltaPay/api-php/zipball/6fd4457ebb66a83c0995ad86764db40207ad5f53", - "reference": "6fd4457ebb66a83c0995ad86764db40207ad5f53", + "url": "https://api.github.com/repos/AltaPay/api-php/zipball/b1e1b06e9645a52a462e6b88ba7209feba8dfdae", + "reference": "b1e1b06e9645a52a462e6b88ba7209feba8dfdae", "shasum": "" }, "require": { @@ -29,7 +29,7 @@ "ext-simplexml": "*", "ext-spl": "*", "guzzlehttp/guzzle": "^6.0 || ^7.0", - "php": "^7.0 || ^8.0", + "php": "^7.1 || ^8.0", "symfony/event-dispatcher": "^2.1 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0", "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0" }, @@ -58,9 +58,9 @@ ], "support": { "issues": "https://github.com/AltaPay/api-php/issues", - "source": "https://github.com/AltaPay/api-php/tree/3.5.4" + "source": "https://github.com/AltaPay/api-php/tree/3.5.5" }, - "time": "2025-09-15T05:02:36+00:00" + "time": "2025-10-10T14:59:05+00:00" }, { "name": "composer/package-versions-deprecated", @@ -3185,16 +3185,16 @@ }, { "name": "phpunit/phpunit", - "version": "8.5.47", + "version": "8.5.48", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "c0134803429af3aef9c5fd2fbb41a1f1340fe20d" + "reference": "75f469c1948b91aa566206f88412c88f08090b32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c0134803429af3aef9c5fd2fbb41a1f1340fe20d", - "reference": "c0134803429af3aef9c5fd2fbb41a1f1340fe20d", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/75f469c1948b91aa566206f88412c88f08090b32", + "reference": "75f469c1948b91aa566206f88412c88f08090b32", "shasum": "" }, "require": { @@ -3216,7 +3216,7 @@ "sebastian/comparator": "^3.0.6", "sebastian/diff": "^3.0.6", "sebastian/environment": "^4.2.5", - "sebastian/exporter": "^3.1.7", + "sebastian/exporter": "^3.1.8", "sebastian/global-state": "^3.0.6", "sebastian/object-enumerator": "^3.0.5", "sebastian/resource-operations": "^2.0.3", @@ -3263,7 +3263,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.47" + "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.48" }, "funding": [ { @@ -3287,7 +3287,7 @@ "type": "tidelift" } ], - "time": "2025-09-23T06:18:09+00:00" + "time": "2025-09-24T06:27:39+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -3561,16 +3561,16 @@ }, { "name": "sebastian/exporter", - "version": "3.1.7", + "version": "3.1.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "8c86ae3e84f69acff53b9d4b96614a68e3572901" + "reference": "64cfeaa341951ceb2019d7b98232399d57bb2296" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/8c86ae3e84f69acff53b9d4b96614a68e3572901", - "reference": "8c86ae3e84f69acff53b9d4b96614a68e3572901", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/64cfeaa341951ceb2019d7b98232399d57bb2296", + "reference": "64cfeaa341951ceb2019d7b98232399d57bb2296", "shasum": "" }, "require": { @@ -3626,7 +3626,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.7" + "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.8" }, "funding": [ { @@ -3646,7 +3646,7 @@ "type": "tidelift" } ], - "time": "2025-09-22T05:03:57+00:00" + "time": "2025-09-24T05:55:14+00:00" }, { "name": "sebastian/global-state", @@ -4182,12 +4182,12 @@ ], "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.2.0" + "platform-dev": {}, + "plugin-api-version": "2.6.0" } diff --git a/docs/independent_payment_page_layout.png b/docs/independent_payment_page_layout.png new file mode 100644 index 00000000..17ae0b0a Binary files /dev/null and b/docs/independent_payment_page_layout.png differ diff --git a/docs/payment_page_layout.png b/docs/payment_page_layout.png new file mode 100644 index 00000000..85412a6e Binary files /dev/null and b/docs/payment_page_layout.png differ diff --git a/readme.txt b/readme.txt index e4c46ec6..09d60eb3 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.8.2 -Stable tag: 3.8.4 +Stable tag: 3.8.5 License: MIT WC requires at least: 3.9.0 -WC tested up to: 10.2.1 +WC tested up to: 10.2.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.8.5 = +* Support gateway form independent of the plugin/theme styling. + = 3.8.4 = * Add support for Checkout Design v2. diff --git a/sonar-project.properties b/sonar-project.properties index 52c75428..8f681adf 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1 +1,2 @@ sonar.projectKey=AltaPay_plugin-wordpress_d5aaa0f0-8a2d-473b-86fd-f0ef752035ce +sonar.coverage.exclusions=** \ No newline at end of file diff --git a/views/altapay-payment-form-external.php b/views/altapay-payment-form-external.php new file mode 100755 index 00000000..c8efad4d --- /dev/null +++ b/views/altapay-payment-form-external.php @@ -0,0 +1,859 @@ + + + +
+ + + + + +|
{{__('e.g. https://testgateway.altapaysecure.com', 'altapay')}} |
|
| @php // Validate if payment page exists by looping through the pages @@ -62,7 +62,7 @@ | |
| + |
+
+ The default option follows the theme styling, |
+
| {{$terminal->name}} | get_page_link($form_page_id), 'callback_ok' => add_query_arg( diff --git a/wiki.md b/wiki.md index 876599f3..9b567b7f 100644 --- a/wiki.md +++ b/wiki.md @@ -23,6 +23,8 @@ Installing this plug-in will enable the web shop to handle card transactions thr * [Checkout form styling](#checkout-form-styling) +* [Payment page layout](#payment-page-layout) + * [Configure fraud detection](#configure-fraud-detection) * [Synchronize payment methods](#synchronize-payment-methods) @@ -120,6 +122,20 @@ Choose one of the below options from `Checkout form style` dropdown to change th > Follow [Customize the checkout page](#customize-the-checkout-page) section for more information on payment page styling. +### Payment page layout + +Choose one of the below options from **Payment page layout** dropdown to select the layout type for payment page. + + + +- `Default` This will use the styling from the checkout/theme. + +  + +- `Checkout Independent` This will show the payment page independent from the theme styling. This will provide a visually appealing appearance seamlessly, without conflicting with the theme styling. + +  + ### Configure fraud detection If you wish to enable fraud detection service and release/refund if fraud is detected then refer to the below screenshot. @@ -301,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.8.2 -- WooCommerce min. 3.9.0 – max. 10.2.1 +- WooCommerce min. 3.9.0 – max. 10.2.2 - PHP 7.4 and above - PHP-bcmath library installed. - PHP-curl MUST be enabled. The latest tested version is: -- WordPress 6.8.2, WooCommerce 10.2.1 and PHP 8.2 +- WordPress 6.8.2, WooCommerce 10.2.2 and PHP 8.4 ## Troubleshooting |