diff --git a/.github/workflow b/.github/workflow index 7a64aeb..cbe7ed0 100644 --- a/.github/workflow +++ b/.github/workflow @@ -21,7 +21,7 @@ jobs: - name: Upload release asset uses: actions/upload-release-asset@v1 env: - GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ github.event.release.upload_url }} asset_path: ${{ steps.deploy.outputs.zip-path }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 94e7877..cbe7ed0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -21,9 +21,9 @@ jobs: - name: Upload release asset uses: actions/upload-release-asset@v1 env: - GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ github.event.release.upload_url }} asset_path: ${{ steps.deploy.outputs.zip-path }} asset_name: ${{ github.event.repository.name }}.zip - asset_content_type: application/zip \ No newline at end of file + asset_content_type: application/zip diff --git a/MeprPaystackGateway.php b/MeprPaystackGateway.php index 9074650..b881d3f 100644 --- a/MeprPaystackGateway.php +++ b/MeprPaystackGateway.php @@ -383,12 +383,30 @@ public function record_create_subscription() // If no trial or trial amount is zero then we've got to make // sure the confirmation txn lasts through the trial - if (!$sub->trial || ($sub->trial && $sub->trial_amount <= 0.00)) { - $trial_days = ($sub->trial) ? $sub->trial_days : $mepr_options->grace_init_days; + // if (!$sub->trial || ($sub->trial && $sub->trial_amount <= 0.00)) { + // $trial_days = ($sub->trial) ? $sub->trial_days : $mepr_options->grace_init_days; + // $txn->status = MeprTransaction::$confirmed_str; + // $txn->txn_type = MeprTransaction::$subscription_confirmation_str; + // $txn->expires_at = MeprUtils::ts_to_mysql_date(time() + MeprUtils::days($trial_days), 'Y-m-d 23:59:59'); + // $txn->set_subtotal(0.00); // Just a confirmation txn + // $txn->store(); + // } + + if (!$sub->trial) { + $txn->status = MeprTransaction::$confirmed_str; + $txn->txn_type = MeprTransaction::$subscription_confirmation_str; + $next_payment_date = $sdata->next_payment_date; + $txn->expires_at = MeprUtils::ts_to_mysql_date(strtotime($next_payment_date), 'Y-m-d 23:59:59'); + + $txn->store(); + } + + else if($sub->trial && $sub->trial_amount <= 0.00) { + $trial_days = $sub->trial_days; $txn->status = MeprTransaction::$confirmed_str; $txn->txn_type = MeprTransaction::$subscription_confirmation_str; $txn->expires_at = MeprUtils::ts_to_mysql_date(time() + MeprUtils::days($trial_days), 'Y-m-d 23:59:59'); - $txn->set_subtotal(0.00); // Just a confirmation txn + $txn->store(); } diff --git a/main.php b/main.php index c480fc4..8bdfd62 100644 --- a/main.php +++ b/main.php @@ -4,7 +4,7 @@ * Plugin Name: MemberPress Paystack * Plugin URI: https://wordpress.org/plugins/paystack-memberpress/ * Description: Paystack integration for MemberPress. - * Version: 1.3.2 + * Version: 1.3.7 * Author: Paystack * Author URI: https://paystack.com/ * Developer: Wisdom Ebong diff --git a/readme.txt b/readme.txt index 1a96861..0f5a341 100644 --- a/readme.txt +++ b/readme.txt @@ -2,9 +2,9 @@ Contributors: paystack, kaneahabagale Tags: paystack, billing, subscription, payment, memberpress, Requires at least: 5.1 -Tested up to: 6.3 +Tested up to: 6.8.3 Requires PHP: 7.2 and higher -Stable tag: 1.3.2 +Stable tag: 1.3.7 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -83,6 +83,18 @@ Here you can browse the source, look at open issues and keep track of developmen == Changelog == += 1.3.7 - October 10, 2025 = +* Compatibility with WordPress 6.8.3 and PHP 8.2.23 + += 1.3.6 - July 21, 2025 = +* Compatibility with WordPress 6.8.2 and PHP 8.2.23 + += 1.3.5 - August 8, 2024 = +* Compatibility with WordPress 6.6.1 and PHP 8.2.0 + += 1.3.3 = +* Fixed incorrect date set on expiredOn parameter + = 1.3.2 - Septmber 26, 2023 = * Compatibility with WordPress 6.3 and PHP 8.2.0 @@ -90,6 +102,18 @@ Here you can browse the source, look at open issues and keep track of developmen * Fix: Add support for weekly, quarterly, and yearly plans == Upgrade Notice == += 1.3.7 - October 10, 2025 = +* Compatibility with WordPress 6.8.3 and PHP 8.2.23 + += 1.3.6 - July 21, 2025 = +* Compatibility with WordPress 6.8.2 and PHP 8.2.23 + += 1.3.5 = +* Compatibility with WordPress 6.6.1 and PHP 8.2.0 + += 1.3.3 = +* Fixed incorrect date set on expiredOn parameter = 1.3.2 = * Compatibility with WordPress 6.3 and PHP 8.2.0 +