Skip to content

Commit df7de24

Browse files
authored
Merge pull request #371 from enupal/develop
Adds v5.5.0
2 parents 409352c + 5051fd0 commit df7de24

File tree

5 files changed

+67
-4
lines changed

5 files changed

+67
-4
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Stripe Payments Changelog
22

3+
## 5.5.0 - 2023.10.30
4+
### Added
5+
- Added Craft CMS requirement `^4.5.0`
6+
7+
### Fixed
8+
- Fixed issue when adding subscription plan on customer chooses plan only on Craft CMS `^4.5.0` and for new installations ([#369])
9+
10+
[#369]: https://github.com/enupal/stripe/issues/369
11+
312
## 5.4.0 - 2023.09.28
413
### Updated
514
- Updated Stripe lib to v10

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "enupal/stripe",
33
"description": "Allows customers sign up for recurring and one-time payments with Stripe, perfect for orders, donations, subscriptions, and events. Create simple payment forms in seconds easily without coding. For Craft CMS 3.x",
44
"type": "craft-plugin",
5-
"version": "5.4.0",
5+
"version": "5.5.0",
66
"keywords": [
77
"craft",
88
"cms",
@@ -42,7 +42,7 @@
4242
"docs": "https://docs.enupal.com/stripe-payments/"
4343
},
4444
"require": {
45-
"craftcms/cms": "^4.0.0",
45+
"craftcms/cms": "^4.5.0",
4646
"stripe/stripe-php": "^10.0",
4747
"phpoffice/phpspreadsheet": "^1.16"
4848
},

src/Stripe.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class Stripe extends Plugin
5656
public static $app;
5757
public bool $hasCpSection = true;
5858
public bool $hasCpSettings = true;
59-
public string $schemaVersion = '5.1.0';
59+
public string $schemaVersion = '5.5.0';
6060

6161
public function init()
6262
{
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?php
2+
3+
namespace enupal\stripe\migrations;
4+
5+
use craft\db\Migration;
6+
use craft\db\Query;
7+
use Craft;
8+
9+
/**
10+
* m231030_000000_update_enupalmultipleplans_selectplan migration.
11+
*/
12+
class m231030_000000_update_enupalmultipleplans_selectplan extends Migration
13+
{
14+
/**
15+
* @return bool
16+
* @throws \yii\base\Exception
17+
*/
18+
public function safeUp()
19+
{
20+
$matrixTable = '{{%matrixcontent_enupalmultipleplans}}';
21+
22+
$field = (new Query())
23+
->select(['*'])
24+
->from('{{%fields}}')
25+
->where(["name" => 'Select Plan', 'handle' => 'selectPlan', 'type' => 'craft\fields\Dropdown'])
26+
->andWhere(['like', 'context', 'matrixBlockType:%', false])
27+
->one();
28+
29+
if (empty($field)) {
30+
Craft::error('Unable to find Stripe Payment field selectPlan', __METHOD__);
31+
return null;
32+
}
33+
34+
$column = 'field_subscriptionPlan_selectPlan_'.$field['columnSuffix'];
35+
36+
if ($this->db->columnExists($matrixTable, $column)) {
37+
$this->alterColumn($matrixTable, $column, $this->string(255));
38+
} else {
39+
Craft::error('Unable to find Stripe Payment select plan column: '.$column, __METHOD__);
40+
}
41+
42+
return true;
43+
}
44+
45+
/**
46+
* @inheritdoc
47+
*/
48+
public function safeDown()
49+
{
50+
echo "m230208_000000_add_adjustable_quantity cannot be reverted.\n";
51+
52+
return false;
53+
}
54+
}

src/services/PaymentForms.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1496,7 +1496,7 @@ private function createMultiplePlansMatrixField()
14961496
'handle' => 'selectPlan',
14971497
'instructions' => "Can't see your plans? Go to [Subscriptions]($subscriptionUrl) and click on Refresh Plans",
14981498
'required' => 1,
1499-
'typesettings' => '{"options":[{"label":"Select Plan...","value":"","default":""}]}',
1499+
'typesettings' => '{"columnType":"string", "options":[{"label":"Select Plan...","value":"","default":""}]}',
15001500
'translationMethod' => Field::TRANSLATION_METHOD_SITE,
15011501
],
15021502
'new2' => [

0 commit comments

Comments
 (0)