Skip to content

Commit

Permalink
Merge pull request #72 from craftcms/bugfix/createUserIfMissing-only-…
Browse files Browse the repository at this point in the history
…for-pro-and-up

`createUserIfMissing` should only be available for cms pro and up
  • Loading branch information
i-just authored Jan 15, 2025
2 parents 38e97d3 + 591be1a commit 3600d20
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes for Stripe

## Unreleased

- Fixed a bug where the plugin was attempting to create missing users when `createUserIfMissing` was `true` but the Craft edition didn’t allow for multiple users. ([#72](https://github.com/craftcms/stripe/pull/72))

## 1.3.2 - 2024-12-11

- Fixed an error that occurred on Edit Entry screens if Stripe wasn’t configured with an API key. ([#66](https://github.com/craftcms/stripe/pull/66))
Expand Down
3 changes: 2 additions & 1 deletion src/services/Subscriptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

use Craft;
use craft\elements\User;
use craft\enums\CmsEdition;
use craft\events\ConfigEvent;
use craft\helpers\Json;
use craft\helpers\ProjectConfig;
Expand Down Expand Up @@ -154,7 +155,7 @@ public function createOrUpdateSubscriptionElement(StripeSubscription $subscripti
}

$settings = Plugin::getInstance()->getSettings();
if ($settings->createUserIfMissing) {
if ($settings->createUserIfMissing && Craft::$app->edition->value >= CmsEdition::Pro->value) {
$this->ensureUser($subscription, $subscriptionElement);
}

Expand Down

0 comments on commit 3600d20

Please sign in to comment.