Skip to content

Commit

Permalink
Merge pull request #371 from enupal/develop
Browse files Browse the repository at this point in the history
Adds v5.5.0
  • Loading branch information
andrelopez authored Oct 30, 2023
2 parents 409352c + 5051fd0 commit df7de24
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 4 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Stripe Payments Changelog

## 5.5.0 - 2023.10.30
### Added
- Added Craft CMS requirement `^4.5.0`

### Fixed
- Fixed issue when adding subscription plan on customer chooses plan only on Craft CMS `^4.5.0` and for new installations ([#369])

[#369]: https://github.com/enupal/stripe/issues/369

## 5.4.0 - 2023.09.28
### Updated
- Updated Stripe lib to v10
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "enupal/stripe",
"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",
"type": "craft-plugin",
"version": "5.4.0",
"version": "5.5.0",
"keywords": [
"craft",
"cms",
Expand Down Expand Up @@ -42,7 +42,7 @@
"docs": "https://docs.enupal.com/stripe-payments/"
},
"require": {
"craftcms/cms": "^4.0.0",
"craftcms/cms": "^4.5.0",
"stripe/stripe-php": "^10.0",
"phpoffice/phpspreadsheet": "^1.16"
},
Expand Down
2 changes: 1 addition & 1 deletion src/Stripe.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class Stripe extends Plugin
public static $app;
public bool $hasCpSection = true;
public bool $hasCpSettings = true;
public string $schemaVersion = '5.1.0';
public string $schemaVersion = '5.5.0';

public function init()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php

namespace enupal\stripe\migrations;

use craft\db\Migration;
use craft\db\Query;
use Craft;

/**
* m231030_000000_update_enupalmultipleplans_selectplan migration.
*/
class m231030_000000_update_enupalmultipleplans_selectplan extends Migration
{
/**
* @return bool
* @throws \yii\base\Exception
*/
public function safeUp()
{
$matrixTable = '{{%matrixcontent_enupalmultipleplans}}';

$field = (new Query())
->select(['*'])
->from('{{%fields}}')
->where(["name" => 'Select Plan', 'handle' => 'selectPlan', 'type' => 'craft\fields\Dropdown'])
->andWhere(['like', 'context', 'matrixBlockType:%', false])
->one();

if (empty($field)) {
Craft::error('Unable to find Stripe Payment field selectPlan', __METHOD__);
return null;
}

$column = 'field_subscriptionPlan_selectPlan_'.$field['columnSuffix'];

if ($this->db->columnExists($matrixTable, $column)) {
$this->alterColumn($matrixTable, $column, $this->string(255));
} else {
Craft::error('Unable to find Stripe Payment select plan column: '.$column, __METHOD__);
}

return true;
}

/**
* @inheritdoc
*/
public function safeDown()
{
echo "m230208_000000_add_adjustable_quantity cannot be reverted.\n";

return false;
}
}
2 changes: 1 addition & 1 deletion src/services/PaymentForms.php
Original file line number Diff line number Diff line change
Expand Up @@ -1496,7 +1496,7 @@ private function createMultiplePlansMatrixField()
'handle' => 'selectPlan',
'instructions' => "Can't see your plans? Go to [Subscriptions]($subscriptionUrl) and click on Refresh Plans",
'required' => 1,
'typesettings' => '{"options":[{"label":"Select Plan...","value":"","default":""}]}',
'typesettings' => '{"columnType":"string", "options":[{"label":"Select Plan...","value":"","default":""}]}',
'translationMethod' => Field::TRANSLATION_METHOD_SITE,
],
'new2' => [
Expand Down

0 comments on commit df7de24

Please sign in to comment.