From 6297864b078d13dbc74dce2c77f514585e104cd6 Mon Sep 17 00:00:00 2001 From: Ryan Ray Date: Tue, 22 Apr 2025 09:44:42 -0400 Subject: [PATCH 1/8] Update class-wc-gateway-payfast.php Adds the required `multiple_subscriptions` feature support, so merchants can purchase multiple subscriptions in one order via PayFast. --- includes/class-wc-gateway-payfast.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/class-wc-gateway-payfast.php b/includes/class-wc-gateway-payfast.php index 8292a42..ce48085 100644 --- a/includes/class-wc-gateway-payfast.php +++ b/includes/class-wc-gateway-payfast.php @@ -145,6 +145,7 @@ public function __construct() { 'subscription_date_changes', 'subscription_payment_method_change', // Subs 1.x support. 'subscription_payment_method_change_customer', // Enabled for https://github.com/woocommerce/woocommerce-gateway-payfast/issues/32. + 'multiple_subscriptions', ); $this->init_form_fields(); From e8a32e08c32f9a8d2991c034fd2a87c7a90b633e Mon Sep 17 00:00:00 2001 From: Ryan Ray Date: Tue, 22 Apr 2025 09:47:21 -0400 Subject: [PATCH 2/8] Update changelog.txt Recorded a new potential version with support for multiple subscriptions. --- changelog.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/changelog.txt b/changelog.txt index 9acb573..134a5fe 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ *** PayFast Changelog *** += 1.7.1 - 2025-mm-dd = +* Add - Added support for multiple subscriptions purchased in one order. + = 1.7.0 - 2025-03-17 = * Update - Refresh copy and brand assets. * Dev - Bump WooCommerce "tested up to" version 9.7. From 8af843b559ff2739fd1da418d394d7ac839ee8c5 Mon Sep 17 00:00:00 2001 From: Ryan Ray Date: Tue, 22 Apr 2025 09:47:40 -0400 Subject: [PATCH 3/8] Update woocommerce-gateway-payfast.php Version bump --- woocommerce-gateway-payfast.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/woocommerce-gateway-payfast.php b/woocommerce-gateway-payfast.php index efd05a7..d10f7c9 100644 --- a/woocommerce-gateway-payfast.php +++ b/woocommerce-gateway-payfast.php @@ -6,7 +6,7 @@ * Description: Receive payments using the South African Payfast payments provider. * Author: WooCommerce * Author URI: https://woocommerce.com/ - * Version: 1.7.0 + * Version: 1.7.1 * Requires at least: 6.6 * Tested up to: 6.8 * WC requires at least: 9.6 From d54defcc59f7d73275937fafe790e201223b538e Mon Sep 17 00:00:00 2001 From: Ryan Ray Date: Wed, 7 May 2025 07:16:24 -0400 Subject: [PATCH 4/8] Delete changelog.txt I had manually updated the changelog, not needed as the release process takes care of this. --- changelog.txt | 280 -------------------------------------------------- 1 file changed, 280 deletions(-) delete mode 100644 changelog.txt diff --git a/changelog.txt b/changelog.txt deleted file mode 100644 index 134a5fe..0000000 --- a/changelog.txt +++ /dev/null @@ -1,280 +0,0 @@ -*** PayFast Changelog *** - -= 1.7.1 - 2025-mm-dd = -* Add - Added support for multiple subscriptions purchased in one order. - -= 1.7.0 - 2025-03-17 = -* Update - Refresh copy and brand assets. -* Dev - Bump WooCommerce "tested up to" version 9.7. -* Dev - Bump WooCommerce minimum supported version to 9.5. -* Dev - Bump WordPress minimum supported version to 6.6. -* Dev - Add the WordPress Plugin Check GitHub Action and fix all issues it found. - -= 1.6.10 - 2025-01-13 = -* Dev - Bump WooCommerce "tested up to" version 9.6. -* Dev - Bump WooCommerce minimum supported version to 9.4. -* Dev - Use the `@woocommerce/e2e-utils-playwright` NPM package for E2E tests. - -= 1.6.9 - 2024-11-18 = -* Dev - Bump WordPress "tested up to" version 6.7. - -= 1.6.8 - 2024-11-04 = -* Add - Credentials validation and required field notice for PayFast in the sandbox environment. -* Dev - Bump WooCommerce "tested up to" version 9.4. -* Dev - Bump WooCommerce minimum supported version to 9.2. -* Dev - Bump WordPress minimum supported version to 6.5. - -= 1.6.7 - 2024-09-09 = -* Dev - Bump WooCommerce "tested up to" version 9.3. -* Dev - Bump WooCommerce minimum supported version to 9.1. -* Dev - Update E2E tests to accommodate changes in WooCommerce. - -= 1.6.6 - 2024-07-29 = -* Dev - Bump WooCommerce "tested up to" version 9.1. -* Dev - Bump WooCommerce minimum supported version to 8.9. -* Dev - Bump WordPress "tested up to" version 6.6. -* Dev - Bump WordPress minimum supported version to 6.4. -* Dev - Update NPM packages and node version to v20 to modernize developer experience. -* Dev - Exclude the Woo Comment Hook `@since` sniff. -* Dev - Fix QIT E2E tests and add support for a few new test types. -* Tweak - Update WordPress.org plugin assets. - -= 1.6.5 - 2024-05-14 = -* Fix - Use `rawurlencode` around the call to `get_site_url` to ensure things are encoded properly. - -= 1.6.4 - 2024-05-07 = -* Fix - Resolved signature mismatch error caused by HTML entity encoding in site/blog name. -* Dev - Bump WooCommerce "tested up to" version 8.8. -* Dev - Bump WooCommerce minimum supported version to 8.6. - -= 1.6.3 - 2024-05-02 = -* Fix - Enforce amount match check for all payments in the Payfast ITN handler. -* Dev - Bump WooCommerce "tested up to" version 8.7. -* Dev - Bump WooCommerce minimum supported version to 8.5. -* Dev - Bump WordPress "tested up to" version 6.5. -* Dev - Bump WordPress minimum supported version to 6.3. - -= 1.6.2 - 2024-03-25 = -* Dev - Bump WooCommerce "tested up to" version 8.6. -* Dev - Bump WooCommerce minimum supported version to 8.4. -* Dev - Bump WordPress minimum supported version to 6.3. -* Fix - Payfast gateway not visible on Checkout when ZAR currency is set via WooPayments multi-currency feature. -* Fix - Allow navigation back from PayFast gateway payment page. - -= 1.6.1 - 2024-01-08 = -* Add - Readme.md file for e2e tests. -* Dev - Declare compatibility with WooCommerce Blocks. -* Dev - Declare compatibility with Product Editor. -* Dev - Updated the main file of the plugin to match the plugin's slug. -* Dev - Bump PHP minimum supported version to 7.4. -* Dev - Bump WooCommerce "tested up to" version 8.4. -* Dev - Bump WooCommerce minimum supported version to 8.2. -* Dev - Resolve coding standards issues. -* Tweak - Bump PHP "tested up to" version 8.3. - -= 1.6.0 - 2023-11-22 = -* Dev - Add Playwright end-to-end tests. -* Dev - Update default behavior to use a block-based cart and checkout in E2E tests. -* Dev - Bump WooCommerce "tested up to" version 8.3. -* Dev - Bump WooCommerce minimum supported version to 8.1. -* Dev - Bump WordPress minimum supported version to 6.2. -* Dev - Bump WordPress "tested up to" version 6.4. -* Dev - Bump WordPress minimum supported version to 6.2. -* Dev - Update PHPCS and PHPCompatibility GitHub Actions. - -= 1.5.9 - 2023-09-18 = -* Dev - Bump WordPress "tested up to" version from 6.2 to 6.3. -* Dev - Bump WooCommerce "tested up to" version 7.9. -* Dev - Bump WooCommerce minimum supported version to 7.7. -* Dev - Bump PHP minimum supported version to 7.3. - -= 1.5.8 - 2023-08-29 = -* Add - Admin notice if this extension is activated without WooCommerce. - -= 1.5.7 - 2023-07-25 = -* Fix - Handle WP_Error object when return from wp_remote_request. - -= 1.5.6 - 2023-07-19 = -* Fix - Include build directory. - -= 1.5.5 - 2023-07-04 = -* Dev - Bump WooCommerce "tested up to" version 7.8. -* Dev - Bump WooCommerce minimum supported version from 6.8 to 7.2. -* Dev - Bump WordPress minimum supported version from 5.8 to 6.1. -* Fix - Replace escaping of order total price elements on the edit order admin screen. - -= 1.5.4 - 2023-06-13 = -* Fix - Escaped strings. - -= 1.5.3 - 2023-05-25 = -* Dev – Bump WooCommerce “tested up to” version 7.6. -* Dev – Bump WordPress minimum supported version from 5.6 to 5.8. -* Dev – Bump WordPress “tested up to” version 6.2. - -= 1.5.2 - 2023-03-16 = -* Tweak - Bump PHP minimum supported version from 7.0 to 7.2. -* Tweak - Bump WooCommerce minimum supported version from 6.0 to 6.8. -* Tweak - Bump WooCommerce "tested up to" version 7.4. - -= 1.5.1 - 2023-02-28 = -* Update – Payfast logo and text references to meet their new branding guidelines. -* Tweak – Bump WooCommerce “Tested up to” to 7.3. -* Tweak – Bump WooCommerce tested up to 7.3.0. -* Dev – Bump @sideway/formula from 3.0.0 to 3.0.1. -* Dev – Resolved linting issues. -* Dev – Bump json5 from 1.0.1 to 1.0.2. -* Dev – Bump loader-utils from 1.4.0 to 1.4.2. - -= 1.5.0 - 2022-12-06 = -* Add – Support for High-performance Order Storage (“HPOS”) (formerly known as Custom Order Tables, “COT”). -* Dev – Update node version from 12.0.0 to 16.13.0. -* Dev – Update npm version from 6.9.0 to 8.0.0. -* Tweak – Bump minimum PHP version from 5.6 to 7.0. -* Tweak – Bump minimum WP version from 4.4 to 5.6. -* Tweak – Bump minimum WC version from 2.6 to 6.0. - -= 1.4.25 - 2022-09-07 = -* Fix - Add support for Transaction ID. - -= 1.4.24 - 2022-07-19 = -* Fix - Subscription renewal payment failed issue in the production environment. - -= 1.4.23 - 2022-07-05 = - * Add - Allow setup PayFast during onboarding. - * Add - Added support for customer subscription payment method change. - -= 1.4.22 - 2022-05-12 = - * Tweak - WP tested up to 6.0 - -= 1.4.21 - 2022-05-03 = - * Tweak - Bump tested up to WordPress version 5.9. - -= 1.4.20 - 2022-01-18 = - * Fix - Status toggle button not working as expected - -= 1.4.19 - 2021-05-04 = - * Add - support for the Cart and Checkout blocks included - * Fix - Error notice from direct access to the order id property. - -= 1.4.18 - 2021-02-04 = - * Add fees to order - * Add signature to the request to PayFast - * Tweak - WC 4.9.2 compatibility. - * Tweak - WP 5.6 compatibility. - -= 1.4.17 - 2020-11-25 = - * Fix - Fix Object could not be converted to string when renewing a subscription. - * Tweak - WC tested up to 4.7 - * Tweak - WP tested up to 5.6 - * Tweak - PHP 8.0 compatibility. - -= 1.4.15 - 2020-03-30 = - * Tweak - WC tested up to 4.0 - * Tweak - WP tested up to 5.4 - -= 1.4.14 - 2019-10-24 = - * Fix - Incorrect API response handling for subscription renewal payments. - * Tweak - WC tested up to 3.8 - * Tweak - WP tested up to 5.3 - -= 1.4.13 - 2019-08-06 = - * Tweak - WC tested up to 3.7 - -= 1.4.12 - 2019-04-16 = - * Tweak - WC tested up to 3.6 - -= 1.4.11 - 2018-11-19 = - * Update - WP tested up to 5.0 - -= 1.4.10 - 2018-09-26 = - * Update - WC tested up to 3.5 - -= 1.4.9 - 2018-05-22 = - * Update - WC tested up to 3.4 - * Update - Privacy policy notification. - * Update - Export/erasure hooks added. - -= 1.4.8 - 2018-05-01 = - * Tweak - Add support for X-Forwarded-For header. - -= 1.4.7 - 2017-12-13 = - * Tweak - Adjusts the headers to indicate WooCommerce 3.3 compatibility. - * New - Adds a filter around the supported currencies. - * Tweak - Replaces "Pricing Options" with "General Settings" in the "disabled" admin notice. - -= 1.4.6 - 2017-11-23 = - * Fix - Error on admin setting pages due to wrong static method call. - -= 1.4.5 - 2017-11-22 = - * Tweak - Remove unneeded order information from the plugin log. - * Tweak - Passphrase now required. - * New - filter to override the is valid ip check. - -= 1.4.4 - 2017-06-14 = - * Fix - Add additional error handling on the PayFast API. - * Add - Option to enable logging. - -= 1.4.3 - 2017-05-03 = - * Fix - Allow users to update card details when paying manually for a failed subscription - * Fix - Renewal orders on new subscriptions are stuck in Pending status even though the payment went through - * Fix - ITN debug emails are slightly messed up wrt new line characters - -= 1.4.2 - 2017-04-19 = - * Fix - Fatal error on renewing subscription. - * Fix - Additional updates for WooCommerce 3.0 compatibility. - -= 1.4.1 - 2017-04-03 = - * Fix - Update for WooCommerce 3.0 compatibility - -= 1.4.0 - 2016-09-02 = - * Add - Support for Subscriptions - * Add - Support for Pre-Orders - -= 1.3.1 - 2016-01-14 = - * Fix - Description field use on the checkout page - * Add - Helpful links on the plugin page - -= 1.3.0 - 2015-10-23 = - * New - Add email_address to the transaction information sent through to PayFast. - -= 1.2.9 - 2015-08-07 = - * Fix - Removes "empty()" call when outputting the description field. - -= 1.2.8 - 2015-08-04 = - * Fix - Fixes the notices displayed in admin when defining constants. - * Fix - Ensures the gateway displays correctly on checkout when in sandbox mode, even if no merchant credentials are yet present. - * Code tidy. - * Removed legacy code. - * Switched to WC logging class. - -= 1.2.7 - 2015-04-20 = - * Fix - Corrects the plugin textdomain. - * Fix - Corrects the incorrect use of the non-existent sanitize() function. - -= 1.2.6 - 2014-01-13 = - * WC 2.1 Compatibility - -= 1.2.5 - 2013-09-06 = - * Update PayFast Logo - -= 1.2.4 - 2013-08-29 = - * Sequential Order Numbers support - * Better WooCommerce version tracking for PayFast - -= 1.2.3 - 2013-06-26 = - * Track WooCommerce version - -= 1.2.2 - 2013-01-21 = - * WC 2.0 Compat - -= 1.2.1 - 2012-12-05 = - * Updater - -= 1.2 - 2012-10-23 = - * Class names - -= 1.1 - 2012-06-18 = - * Patched release with new class names and Woo updater - -= 1.0 - 2011-10-06 = - * First Release From acdc0880cccd10d686275e18f9513cb70feb71fd Mon Sep 17 00:00:00 2001 From: Ryan Ray Date: Wed, 7 May 2025 07:16:58 -0400 Subject: [PATCH 5/8] Delete woocommerce-gateway-payfast.php The version number increase is handled during the release process, I don't need to manually change that. --- woocommerce-gateway-payfast.php | 147 -------------------------------- 1 file changed, 147 deletions(-) delete mode 100644 woocommerce-gateway-payfast.php diff --git a/woocommerce-gateway-payfast.php b/woocommerce-gateway-payfast.php deleted file mode 100644 index d10f7c9..0000000 --- a/woocommerce-gateway-payfast.php +++ /dev/null @@ -1,147 +0,0 @@ - 'wc-settings', - 'tab' => 'checkout', - 'section' => 'wc_gateway_payfast', - ), - admin_url( 'admin.php' ) - ); - - $plugin_links = array( - '' . esc_html__( 'Settings', 'woocommerce-gateway-payfast' ) . '', - '' . esc_html__( 'Support', 'woocommerce-gateway-payfast' ) . '', - '' . esc_html__( 'Docs', 'woocommerce-gateway-payfast' ) . '', - ); - - return array_merge( $plugin_links, $links ); -} -add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'woocommerce_payfast_plugin_links' ); - -/** - * Add the gateway to WooCommerce - * - * @since 1.0.0 - * - * @param string[] $methods WooCommerce payment methods. - * @return string[] Modified payment methods to include Payfast. - */ -function woocommerce_payfast_add_gateway( $methods ) { - $methods[] = 'WC_Gateway_PayFast'; - return $methods; -} - -add_action( 'woocommerce_blocks_loaded', 'woocommerce_payfast_woocommerce_blocks_support' ); - -/** - * Add the gateway to WooCommerce Blocks. - * - * @since 1.4.19 - */ -function woocommerce_payfast_woocommerce_blocks_support() { - if ( class_exists( 'Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType' ) ) { - require_once WC_GATEWAY_PAYFAST_PATH . '/includes/class-wc-gateway-payfast-blocks-support.php'; - add_action( - 'woocommerce_blocks_payment_method_type_registration', - function ( Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry $payment_method_registry ) { - $payment_method_registry->register( new WC_PayFast_Blocks_Support() ); - } - ); - } -} - -/** - * Declares compatibility with Woocommerce features. - * - * List of features: - * - custom_order_tables - * - product_block_editor - * - * @since 1.6.1 Rename function - * @return void - */ -function woocommerce_payfast_declare_feature_compatibility() { - if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { - \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( - 'custom_order_tables', - __FILE__ - ); - - \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( - 'product_block_editor', - __FILE__ - ); - } -} -add_action( 'before_woocommerce_init', 'woocommerce_payfast_declare_feature_compatibility' ); - -/** - * Display notice if WooCommerce is not installed. - * - * @since 1.5.8 - */ -function woocommerce_payfast_missing_wc_notice() { - if ( class_exists( 'WooCommerce' ) ) { - // Display nothing if WooCommerce is installed and activated. - return; - } - - echo '

'; - printf( - /* translators: %s WooCommerce download URL link. */ - esc_html__( 'WooCommerce Payfast Gateway requires WooCommerce to be installed and active. You can download %s here.', 'woocommerce-gateway-payfast' ), - 'WooCommerce' - ); - echo '

'; -} -add_action( 'admin_notices', 'woocommerce_payfast_missing_wc_notice' ); From f6245bd01a7b06cd6fc0e56a2810fb85a749afc3 Mon Sep 17 00:00:00 2001 From: Ryan Ray Date: Thu, 8 May 2025 02:16:53 -0400 Subject: [PATCH 6/8] Updating files in my pull request to remove unneeded changes. No need to add changelog entries or change the plugin version number. This is all handled by the release process. --- changelog.txt | 288 ++++++++++++++++++++++++++++++++ woocommerce-gateway-payfast.php | 147 ++++++++++++++++ 2 files changed, 435 insertions(+) create mode 100644 changelog.txt create mode 100644 woocommerce-gateway-payfast.php diff --git a/changelog.txt b/changelog.txt new file mode 100644 index 0000000..c0ab496 --- /dev/null +++ b/changelog.txt @@ -0,0 +1,288 @@ +*** PayFast Changelog *** + +<<<<<<< HEAD += 1.7.1 - 2025-05-05 = +* Fix - PHP warning for undefined variable when running alongside WooPayments. +* Dev - Bump WooCommerce "tested up to" version 9.8. +* Dev - Bump WooCommerce minimum supported version to 9.6. +* Dev - Bump WordPress "tested up to" version 6.8. +* Dev - Bump WordPress minimum supported version to 6.6. +* Dev - Update all third-party actions our workflows rely on to use versions based on specific commit hashes. + +======= +>>>>>>> parent of e8a32e0 (Update changelog.txt) += 1.7.0 - 2025-03-17 = +* Update - Refresh copy and brand assets. +* Dev - Bump WooCommerce "tested up to" version 9.7. +* Dev - Bump WooCommerce minimum supported version to 9.5. +* Dev - Bump WordPress minimum supported version to 6.6. +* Dev - Add the WordPress Plugin Check GitHub Action and fix all issues it found. + += 1.6.10 - 2025-01-13 = +* Dev - Bump WooCommerce "tested up to" version 9.6. +* Dev - Bump WooCommerce minimum supported version to 9.4. +* Dev - Use the `@woocommerce/e2e-utils-playwright` NPM package for E2E tests. + += 1.6.9 - 2024-11-18 = +* Dev - Bump WordPress "tested up to" version 6.7. + += 1.6.8 - 2024-11-04 = +* Add - Credentials validation and required field notice for PayFast in the sandbox environment. +* Dev - Bump WooCommerce "tested up to" version 9.4. +* Dev - Bump WooCommerce minimum supported version to 9.2. +* Dev - Bump WordPress minimum supported version to 6.5. + += 1.6.7 - 2024-09-09 = +* Dev - Bump WooCommerce "tested up to" version 9.3. +* Dev - Bump WooCommerce minimum supported version to 9.1. +* Dev - Update E2E tests to accommodate changes in WooCommerce. + += 1.6.6 - 2024-07-29 = +* Dev - Bump WooCommerce "tested up to" version 9.1. +* Dev - Bump WooCommerce minimum supported version to 8.9. +* Dev - Bump WordPress "tested up to" version 6.6. +* Dev - Bump WordPress minimum supported version to 6.4. +* Dev - Update NPM packages and node version to v20 to modernize developer experience. +* Dev - Exclude the Woo Comment Hook `@since` sniff. +* Dev - Fix QIT E2E tests and add support for a few new test types. +* Tweak - Update WordPress.org plugin assets. + += 1.6.5 - 2024-05-14 = +* Fix - Use `rawurlencode` around the call to `get_site_url` to ensure things are encoded properly. + += 1.6.4 - 2024-05-07 = +* Fix - Resolved signature mismatch error caused by HTML entity encoding in site/blog name. +* Dev - Bump WooCommerce "tested up to" version 8.8. +* Dev - Bump WooCommerce minimum supported version to 8.6. + += 1.6.3 - 2024-05-02 = +* Fix - Enforce amount match check for all payments in the Payfast ITN handler. +* Dev - Bump WooCommerce "tested up to" version 8.7. +* Dev - Bump WooCommerce minimum supported version to 8.5. +* Dev - Bump WordPress "tested up to" version 6.5. +* Dev - Bump WordPress minimum supported version to 6.3. + += 1.6.2 - 2024-03-25 = +* Dev - Bump WooCommerce "tested up to" version 8.6. +* Dev - Bump WooCommerce minimum supported version to 8.4. +* Dev - Bump WordPress minimum supported version to 6.3. +* Fix - Payfast gateway not visible on Checkout when ZAR currency is set via WooPayments multi-currency feature. +* Fix - Allow navigation back from PayFast gateway payment page. + += 1.6.1 - 2024-01-08 = +* Add - Readme.md file for e2e tests. +* Dev - Declare compatibility with WooCommerce Blocks. +* Dev - Declare compatibility with Product Editor. +* Dev - Updated the main file of the plugin to match the plugin's slug. +* Dev - Bump PHP minimum supported version to 7.4. +* Dev - Bump WooCommerce "tested up to" version 8.4. +* Dev - Bump WooCommerce minimum supported version to 8.2. +* Dev - Resolve coding standards issues. +* Tweak - Bump PHP "tested up to" version 8.3. + += 1.6.0 - 2023-11-22 = +* Dev - Add Playwright end-to-end tests. +* Dev - Update default behavior to use a block-based cart and checkout in E2E tests. +* Dev - Bump WooCommerce "tested up to" version 8.3. +* Dev - Bump WooCommerce minimum supported version to 8.1. +* Dev - Bump WordPress minimum supported version to 6.2. +* Dev - Bump WordPress "tested up to" version 6.4. +* Dev - Bump WordPress minimum supported version to 6.2. +* Dev - Update PHPCS and PHPCompatibility GitHub Actions. + += 1.5.9 - 2023-09-18 = +* Dev - Bump WordPress "tested up to" version from 6.2 to 6.3. +* Dev - Bump WooCommerce "tested up to" version 7.9. +* Dev - Bump WooCommerce minimum supported version to 7.7. +* Dev - Bump PHP minimum supported version to 7.3. + += 1.5.8 - 2023-08-29 = +* Add - Admin notice if this extension is activated without WooCommerce. + += 1.5.7 - 2023-07-25 = +* Fix - Handle WP_Error object when return from wp_remote_request. + += 1.5.6 - 2023-07-19 = +* Fix - Include build directory. + += 1.5.5 - 2023-07-04 = +* Dev - Bump WooCommerce "tested up to" version 7.8. +* Dev - Bump WooCommerce minimum supported version from 6.8 to 7.2. +* Dev - Bump WordPress minimum supported version from 5.8 to 6.1. +* Fix - Replace escaping of order total price elements on the edit order admin screen. + += 1.5.4 - 2023-06-13 = +* Fix - Escaped strings. + += 1.5.3 - 2023-05-25 = +* Dev – Bump WooCommerce “tested up to” version 7.6. +* Dev – Bump WordPress minimum supported version from 5.6 to 5.8. +* Dev – Bump WordPress “tested up to” version 6.2. + += 1.5.2 - 2023-03-16 = +* Tweak - Bump PHP minimum supported version from 7.0 to 7.2. +* Tweak - Bump WooCommerce minimum supported version from 6.0 to 6.8. +* Tweak - Bump WooCommerce "tested up to" version 7.4. + += 1.5.1 - 2023-02-28 = +* Update – Payfast logo and text references to meet their new branding guidelines. +* Tweak – Bump WooCommerce “Tested up to” to 7.3. +* Tweak – Bump WooCommerce tested up to 7.3.0. +* Dev – Bump @sideway/formula from 3.0.0 to 3.0.1. +* Dev – Resolved linting issues. +* Dev – Bump json5 from 1.0.1 to 1.0.2. +* Dev – Bump loader-utils from 1.4.0 to 1.4.2. + += 1.5.0 - 2022-12-06 = +* Add – Support for High-performance Order Storage (“HPOS”) (formerly known as Custom Order Tables, “COT”). +* Dev – Update node version from 12.0.0 to 16.13.0. +* Dev – Update npm version from 6.9.0 to 8.0.0. +* Tweak – Bump minimum PHP version from 5.6 to 7.0. +* Tweak – Bump minimum WP version from 4.4 to 5.6. +* Tweak – Bump minimum WC version from 2.6 to 6.0. + += 1.4.25 - 2022-09-07 = +* Fix - Add support for Transaction ID. + += 1.4.24 - 2022-07-19 = +* Fix - Subscription renewal payment failed issue in the production environment. + += 1.4.23 - 2022-07-05 = + * Add - Allow setup PayFast during onboarding. + * Add - Added support for customer subscription payment method change. + += 1.4.22 - 2022-05-12 = + * Tweak - WP tested up to 6.0 + += 1.4.21 - 2022-05-03 = + * Tweak - Bump tested up to WordPress version 5.9. + += 1.4.20 - 2022-01-18 = + * Fix - Status toggle button not working as expected + += 1.4.19 - 2021-05-04 = + * Add - support for the Cart and Checkout blocks included + * Fix - Error notice from direct access to the order id property. + += 1.4.18 - 2021-02-04 = + * Add fees to order + * Add signature to the request to PayFast + * Tweak - WC 4.9.2 compatibility. + * Tweak - WP 5.6 compatibility. + += 1.4.17 - 2020-11-25 = + * Fix - Fix Object could not be converted to string when renewing a subscription. + * Tweak - WC tested up to 4.7 + * Tweak - WP tested up to 5.6 + * Tweak - PHP 8.0 compatibility. + += 1.4.15 - 2020-03-30 = + * Tweak - WC tested up to 4.0 + * Tweak - WP tested up to 5.4 + += 1.4.14 - 2019-10-24 = + * Fix - Incorrect API response handling for subscription renewal payments. + * Tweak - WC tested up to 3.8 + * Tweak - WP tested up to 5.3 + += 1.4.13 - 2019-08-06 = + * Tweak - WC tested up to 3.7 + += 1.4.12 - 2019-04-16 = + * Tweak - WC tested up to 3.6 + += 1.4.11 - 2018-11-19 = + * Update - WP tested up to 5.0 + += 1.4.10 - 2018-09-26 = + * Update - WC tested up to 3.5 + += 1.4.9 - 2018-05-22 = + * Update - WC tested up to 3.4 + * Update - Privacy policy notification. + * Update - Export/erasure hooks added. + += 1.4.8 - 2018-05-01 = + * Tweak - Add support for X-Forwarded-For header. + += 1.4.7 - 2017-12-13 = + * Tweak - Adjusts the headers to indicate WooCommerce 3.3 compatibility. + * New - Adds a filter around the supported currencies. + * Tweak - Replaces "Pricing Options" with "General Settings" in the "disabled" admin notice. + += 1.4.6 - 2017-11-23 = + * Fix - Error on admin setting pages due to wrong static method call. + += 1.4.5 - 2017-11-22 = + * Tweak - Remove unneeded order information from the plugin log. + * Tweak - Passphrase now required. + * New - filter to override the is valid ip check. + += 1.4.4 - 2017-06-14 = + * Fix - Add additional error handling on the PayFast API. + * Add - Option to enable logging. + += 1.4.3 - 2017-05-03 = + * Fix - Allow users to update card details when paying manually for a failed subscription + * Fix - Renewal orders on new subscriptions are stuck in Pending status even though the payment went through + * Fix - ITN debug emails are slightly messed up wrt new line characters + += 1.4.2 - 2017-04-19 = + * Fix - Fatal error on renewing subscription. + * Fix - Additional updates for WooCommerce 3.0 compatibility. + += 1.4.1 - 2017-04-03 = + * Fix - Update for WooCommerce 3.0 compatibility + += 1.4.0 - 2016-09-02 = + * Add - Support for Subscriptions + * Add - Support for Pre-Orders + += 1.3.1 - 2016-01-14 = + * Fix - Description field use on the checkout page + * Add - Helpful links on the plugin page + += 1.3.0 - 2015-10-23 = + * New - Add email_address to the transaction information sent through to PayFast. + += 1.2.9 - 2015-08-07 = + * Fix - Removes "empty()" call when outputting the description field. + += 1.2.8 - 2015-08-04 = + * Fix - Fixes the notices displayed in admin when defining constants. + * Fix - Ensures the gateway displays correctly on checkout when in sandbox mode, even if no merchant credentials are yet present. + * Code tidy. + * Removed legacy code. + * Switched to WC logging class. + += 1.2.7 - 2015-04-20 = + * Fix - Corrects the plugin textdomain. + * Fix - Corrects the incorrect use of the non-existent sanitize() function. + += 1.2.6 - 2014-01-13 = + * WC 2.1 Compatibility + += 1.2.5 - 2013-09-06 = + * Update PayFast Logo + += 1.2.4 - 2013-08-29 = + * Sequential Order Numbers support + * Better WooCommerce version tracking for PayFast + += 1.2.3 - 2013-06-26 = + * Track WooCommerce version + += 1.2.2 - 2013-01-21 = + * WC 2.0 Compat + += 1.2.1 - 2012-12-05 = + * Updater + += 1.2 - 2012-10-23 = + * Class names + += 1.1 - 2012-06-18 = + * Patched release with new class names and Woo updater + += 1.0 - 2011-10-06 = + * First Release diff --git a/woocommerce-gateway-payfast.php b/woocommerce-gateway-payfast.php new file mode 100644 index 0000000..237041e --- /dev/null +++ b/woocommerce-gateway-payfast.php @@ -0,0 +1,147 @@ + 'wc-settings', + 'tab' => 'checkout', + 'section' => 'wc_gateway_payfast', + ), + admin_url( 'admin.php' ) + ); + + $plugin_links = array( + '' . esc_html__( 'Settings', 'woocommerce-gateway-payfast' ) . '', + '' . esc_html__( 'Support', 'woocommerce-gateway-payfast' ) . '', + '' . esc_html__( 'Docs', 'woocommerce-gateway-payfast' ) . '', + ); + + return array_merge( $plugin_links, $links ); +} +add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'woocommerce_payfast_plugin_links' ); + +/** + * Add the gateway to WooCommerce + * + * @since 1.0.0 + * + * @param string[] $methods WooCommerce payment methods. + * @return string[] Modified payment methods to include Payfast. + */ +function woocommerce_payfast_add_gateway( $methods ) { + $methods[] = 'WC_Gateway_PayFast'; + return $methods; +} + +add_action( 'woocommerce_blocks_loaded', 'woocommerce_payfast_woocommerce_blocks_support' ); + +/** + * Add the gateway to WooCommerce Blocks. + * + * @since 1.4.19 + */ +function woocommerce_payfast_woocommerce_blocks_support() { + if ( class_exists( 'Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType' ) ) { + require_once WC_GATEWAY_PAYFAST_PATH . '/includes/class-wc-gateway-payfast-blocks-support.php'; + add_action( + 'woocommerce_blocks_payment_method_type_registration', + function ( Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry $payment_method_registry ) { + $payment_method_registry->register( new WC_PayFast_Blocks_Support() ); + } + ); + } +} + +/** + * Declares compatibility with Woocommerce features. + * + * List of features: + * - custom_order_tables + * - product_block_editor + * + * @since 1.6.1 Rename function + * @return void + */ +function woocommerce_payfast_declare_feature_compatibility() { + if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { + \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( + 'custom_order_tables', + __FILE__ + ); + + \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( + 'product_block_editor', + __FILE__ + ); + } +} +add_action( 'before_woocommerce_init', 'woocommerce_payfast_declare_feature_compatibility' ); + +/** + * Display notice if WooCommerce is not installed. + * + * @since 1.5.8 + */ +function woocommerce_payfast_missing_wc_notice() { + if ( class_exists( 'WooCommerce' ) ) { + // Display nothing if WooCommerce is installed and activated. + return; + } + + echo '

'; + printf( + /* translators: %s WooCommerce download URL link. */ + esc_html__( 'WooCommerce Payfast Gateway requires WooCommerce to be installed and active. You can download %s here.', 'woocommerce-gateway-payfast' ), + 'WooCommerce' + ); + echo '

'; +} +add_action( 'admin_notices', 'woocommerce_payfast_missing_wc_notice' ); From c494c050d8fdaea817b4f7db14dbf3657bcd9e9d Mon Sep 17 00:00:00 2001 From: Ryan Ray Date: Thu, 8 May 2025 02:19:28 -0400 Subject: [PATCH 7/8] Update changelog.txt --- changelog.txt | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/changelog.txt b/changelog.txt index c0ab496..9acb573 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,16 +1,5 @@ *** PayFast Changelog *** -<<<<<<< HEAD -= 1.7.1 - 2025-05-05 = -* Fix - PHP warning for undefined variable when running alongside WooPayments. -* Dev - Bump WooCommerce "tested up to" version 9.8. -* Dev - Bump WooCommerce minimum supported version to 9.6. -* Dev - Bump WordPress "tested up to" version 6.8. -* Dev - Bump WordPress minimum supported version to 6.6. -* Dev - Update all third-party actions our workflows rely on to use versions based on specific commit hashes. - -======= ->>>>>>> parent of e8a32e0 (Update changelog.txt) = 1.7.0 - 2025-03-17 = * Update - Refresh copy and brand assets. * Dev - Bump WooCommerce "tested up to" version 9.7. From c7590ff96e3dd1d740cb463297ed6129e75da204 Mon Sep 17 00:00:00 2001 From: Ryan Ray Date: Thu, 8 May 2025 02:20:40 -0400 Subject: [PATCH 8/8] Update woocommerce-gateway-payfast.php --- woocommerce-gateway-payfast.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/woocommerce-gateway-payfast.php b/woocommerce-gateway-payfast.php index 237041e..efd05a7 100644 --- a/woocommerce-gateway-payfast.php +++ b/woocommerce-gateway-payfast.php @@ -6,7 +6,7 @@ * Description: Receive payments using the South African Payfast payments provider. * Author: WooCommerce * Author URI: https://woocommerce.com/ - * Version: 1.7.1 + * Version: 1.7.0 * Requires at least: 6.6 * Tested up to: 6.8 * WC requires at least: 9.6 @@ -19,7 +19,7 @@ defined( 'ABSPATH' ) || exit; -define( 'WC_GATEWAY_PAYFAST_VERSION', '1.7.1' ); // WRCS: DEFINED_VERSION. +define( 'WC_GATEWAY_PAYFAST_VERSION', '1.7.0' ); // WRCS: DEFINED_VERSION. define( 'WC_GATEWAY_PAYFAST_URL', untrailingslashit( plugins_url( '/', __FILE__ ) ) ); define( 'WC_GATEWAY_PAYFAST_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) );