core_merchant 0.10.1 → 0.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/core_merchant/version.rb +1 -1
- data/lib/generators/core_merchant/install_generator.rb +4 -8
- data/lib/generators/core_merchant/templates/core_merchant.rb +2 -2
- data/lib/generators/core_merchant/templates/migrate/create_core_merchant_tables.erb +47 -0
- metadata +2 -4
- data/lib/generators/core_merchant/templates/migrate/create_core_merchant_subscription_events.erb +0 -14
- data/lib/generators/core_merchant/templates/migrate/create_core_merchant_subscription_plans.erb +0 -16
- data/lib/generators/core_merchant/templates/migrate/create_core_merchant_subscriptions.erb +0 -26
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 2fadff8a1997d56c7aeaed293ac6e675dfb7b2bd310abc209607d20ef87ca336
         | 
| 4 | 
            +
              data.tar.gz: c36ba36b69437b96fd0e14bb230e8a08cea03db802fdb2492ab5af7eb8eab594
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: bec0145aec16c30230e2f756de3ba843bf487d5861128b7417ce3643192b7c0d67fa7cadbb20e642eccc6015f5b67c779339399e3a298b4eb1c1e597c11be53b
         | 
| 7 | 
            +
              data.tar.gz: 7b7fc60c7e21840887603f2fc0a223f0394d6b73b7a3ec2e49b17dd4cfeafd663a335ec6408c379ba2e94a184abb5d45b5f4e6982d566a474b1180661d93c446
         | 
    
        data/Gemfile.lock
    CHANGED
    
    
| @@ -23,14 +23,10 @@ module CoreMerchant | |
| 23 23 | 
             
                  end
         | 
| 24 24 |  | 
| 25 25 | 
             
                  def create_migration_file
         | 
| 26 | 
            -
                    migration_template | 
| 27 | 
            -
             | 
| 28 | 
            -
             | 
| 29 | 
            -
                     | 
| 30 | 
            -
                                       "db/migrate/create_core_merchant_subscriptions.rb"
         | 
| 31 | 
            -
             | 
| 32 | 
            -
                    migration_template "migrate/create_core_merchant_subscription_events.erb",
         | 
| 33 | 
            -
                                       "db/migrate/create_core_merchant_subscription_events.rb"
         | 
| 26 | 
            +
                    migration_template(
         | 
| 27 | 
            +
                      "migrate/create_core_merchant_tables.erb",
         | 
| 28 | 
            +
                      "db/migrate/create_core_merchant_tables.rb"
         | 
| 29 | 
            +
                    )
         | 
| 34 30 | 
             
                  end
         | 
| 35 31 |  | 
| 36 32 | 
             
                  def show_post_install
         | 
| @@ -7,7 +7,7 @@ CoreMerchant.configure do |config| | |
| 7 7 | 
             
              #   include CoreMerchant::CustomerBehavior
         | 
| 8 8 | 
             
              #   ...
         | 
| 9 9 | 
             
              # end
         | 
| 10 | 
            -
               | 
| 10 | 
            +
              config.customer_class = "User"
         | 
| 11 11 |  | 
| 12 12 | 
             
              # Set the class that will receive subscription notifications/
         | 
| 13 13 | 
             
              # This class must include the CoreMerchant::SubscriptionListener module.
         | 
| @@ -22,5 +22,5 @@ CoreMerchant.configure do |config| | |
| 22 22 | 
             
              #
         | 
| 23 23 | 
             
              # To test notifications to this class, you can override `on_test_event_received` method
         | 
| 24 24 | 
             
              # and call `CoreMerchant.subscription_manager.notify_test_event`.
         | 
| 25 | 
            -
               | 
| 25 | 
            +
              config.subscription_listener_class = "SubscriptionListener"
         | 
| 26 26 | 
             
            end
         | 
| @@ -0,0 +1,47 @@ | |
| 1 | 
            +
            class CreateCoreMerchantTables < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
         | 
| 2 | 
            +
              def change
         | 
| 3 | 
            +
                create_table :core_merchant_subscription_plans do |t|
         | 
| 4 | 
            +
                  t.string :name_key, null: false
         | 
| 5 | 
            +
                  t.integer :price_cents, null: false, default: 0
         | 
| 6 | 
            +
                  t.string :duration, null: false
         | 
| 7 | 
            +
                  t.integer :introductory_price_cents
         | 
| 8 | 
            +
                  t.string :introductory_duration
         | 
| 9 | 
            +
             | 
| 10 | 
            +
                  t.timestamps
         | 
| 11 | 
            +
             | 
| 12 | 
            +
                  t.index :name_key, unique: true
         | 
| 13 | 
            +
                end
         | 
| 14 | 
            +
             | 
| 15 | 
            +
                create_table :core_merchant_subscriptions do |t|
         | 
| 16 | 
            +
                  t.references :customer, polymorphic: true, null: false
         | 
| 17 | 
            +
                  t.references :subscription_plan, null: false
         | 
| 18 | 
            +
                  t.integer :status, null: false, default: 0
         | 
| 19 | 
            +
                  t.datetime :canceled_at
         | 
| 20 | 
            +
                  t.string :cancellation_reason
         | 
| 21 | 
            +
             | 
| 22 | 
            +
                  t.datetime :start_date, null: false
         | 
| 23 | 
            +
                  t.datetime :trial_end_date
         | 
| 24 | 
            +
                  t.datetime :end_date
         | 
| 25 | 
            +
                  t.datetime :current_period_start_date
         | 
| 26 | 
            +
                  t.datetime :current_period_end_date
         | 
| 27 | 
            +
                  t.datetime :pause_start_date
         | 
| 28 | 
            +
                  t.datetime :pause_end_date
         | 
| 29 | 
            +
             | 
| 30 | 
            +
                  t.integer :current_period_price_cents
         | 
| 31 | 
            +
             | 
| 32 | 
            +
                  t.timestamps
         | 
| 33 | 
            +
             | 
| 34 | 
            +
                  t.index :status
         | 
| 35 | 
            +
                end
         | 
| 36 | 
            +
             | 
| 37 | 
            +
                create_table :core_merchant_subscription_events do |t|
         | 
| 38 | 
            +
                  t.references :subscription, null: false
         | 
| 39 | 
            +
                  t.string :event_type, null: false
         | 
| 40 | 
            +
                  t.json :metadata
         | 
| 41 | 
            +
             | 
| 42 | 
            +
                  t.timestamps
         | 
| 43 | 
            +
             | 
| 44 | 
            +
                  t.index :event_type
         | 
| 45 | 
            +
                end
         | 
| 46 | 
            +
              end
         | 
| 47 | 
            +
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: core_merchant
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.10. | 
| 4 | 
            +
              version: 0.10.2
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Seyithan Teymur
         | 
| @@ -158,9 +158,7 @@ files: | |
| 158 158 | 
             
            - lib/generators/core_merchant/install_generator.rb
         | 
| 159 159 | 
             
            - lib/generators/core_merchant/templates/core_merchant.en.yml
         | 
| 160 160 | 
             
            - lib/generators/core_merchant/templates/core_merchant.rb
         | 
| 161 | 
            -
            - lib/generators/core_merchant/templates/migrate/ | 
| 162 | 
            -
            - lib/generators/core_merchant/templates/migrate/create_core_merchant_subscription_plans.erb
         | 
| 163 | 
            -
            - lib/generators/core_merchant/templates/migrate/create_core_merchant_subscriptions.erb
         | 
| 161 | 
            +
            - lib/generators/core_merchant/templates/migrate/create_core_merchant_tables.erb
         | 
| 164 162 | 
             
            - sig/core_merchant.rbs
         | 
| 165 163 | 
             
            homepage: https://github.com/theseyithan/core_merchant
         | 
| 166 164 | 
             
            licenses:
         | 
    
        data/lib/generators/core_merchant/templates/migrate/create_core_merchant_subscription_events.erb
    DELETED
    
    | @@ -1,14 +0,0 @@ | |
| 1 | 
            -
            # Created by: rails generate core_merchant:install
         | 
| 2 | 
            -
            class CreateCoreMerchantSubscriptionEvents < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
         | 
| 3 | 
            -
              def change
         | 
| 4 | 
            -
                create_table :core_merchant_subscription_events do |t|
         | 
| 5 | 
            -
                  t.references :subscription, null: false, foreign_key: { to_table: :core_merchant_subscriptions }
         | 
| 6 | 
            -
                  t.string :event_type, null: false
         | 
| 7 | 
            -
                  t.jsonb :metadata, default: {}, null: false
         | 
| 8 | 
            -
             | 
| 9 | 
            -
                  t.timestamps
         | 
| 10 | 
            -
             | 
| 11 | 
            -
                  t.index :event_type
         | 
| 12 | 
            -
                end
         | 
| 13 | 
            -
              end
         | 
| 14 | 
            -
            end
         | 
    
        data/lib/generators/core_merchant/templates/migrate/create_core_merchant_subscription_plans.erb
    DELETED
    
    | @@ -1,16 +0,0 @@ | |
| 1 | 
            -
            # Created by: rails generate core_merchant:install
         | 
| 2 | 
            -
            class CreateCoreMerchantSubscriptionPlans < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
         | 
| 3 | 
            -
              def change
         | 
| 4 | 
            -
                create_table :core_merchant_subscription_plans do |t|
         | 
| 5 | 
            -
                  t.string :name_key, null: false
         | 
| 6 | 
            -
                  t.integer :price_cents, null: false, default: 0
         | 
| 7 | 
            -
                  t.string :duration, null: false
         | 
| 8 | 
            -
                  t.integer :introductory_price_cents
         | 
| 9 | 
            -
                  t.string :introductory_duration
         | 
| 10 | 
            -
             | 
| 11 | 
            -
                  t.timestamps
         | 
| 12 | 
            -
             | 
| 13 | 
            -
                  t.index :name_key, unique: true
         | 
| 14 | 
            -
                end
         | 
| 15 | 
            -
              end
         | 
| 16 | 
            -
            end
         | 
| @@ -1,26 +0,0 @@ | |
| 1 | 
            -
            # Created by: rails generate core_merchant:install
         | 
| 2 | 
            -
            class CreateCoreMerchantSubscriptions < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
         | 
| 3 | 
            -
              def change
         | 
| 4 | 
            -
                create_table :core_merchant_subscriptions do |t|
         | 
| 5 | 
            -
                  t.references :customer, polymorphic: true, null: false
         | 
| 6 | 
            -
                  t.references :subscription_plan, null: false
         | 
| 7 | 
            -
                  t.integer :status, null: false, default: 0
         | 
| 8 | 
            -
                  t.datetime :canceled_at
         | 
| 9 | 
            -
                  t.string :cancellation_reason
         | 
| 10 | 
            -
             | 
| 11 | 
            -
                  t.datetime :start_date, null: false
         | 
| 12 | 
            -
                  t.datetime :trial_end_date
         | 
| 13 | 
            -
                  t.datetime :end_date
         | 
| 14 | 
            -
                  t.datetime :current_period_start_date
         | 
| 15 | 
            -
                  t.datetime :current_period_end_date
         | 
| 16 | 
            -
                  t.datetime :pause_start_date
         | 
| 17 | 
            -
                  t.datetime :pause_end_date
         | 
| 18 | 
            -
             | 
| 19 | 
            -
                  t.integer :current_period_price_cents
         | 
| 20 | 
            -
             | 
| 21 | 
            -
                  t.timestamps
         | 
| 22 | 
            -
             | 
| 23 | 
            -
                  t.index :status
         | 
| 24 | 
            -
                end
         | 
| 25 | 
            -
              end
         | 
| 26 | 
            -
            end
         |