Class: Ecko::Plugins::Stripe::PaymentIntentionGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/ecko/plugins/stripe/generators/payment_intent_generator.rb

Constant Summary collapse

DATA_TYPES =
%w(binary json jsonb).freeze

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ PaymentIntentionGenerator

Returns a new instance of PaymentIntentionGenerator.



23
24
25
26
27
28
29
# File 'lib/ecko/plugins/stripe/generators/payment_intent_generator.rb', line 23

def initialize(*args)
  super

  if DATA_TYPES.exclude?(options.fetch(:data_type))
    raise Error, "Invalid value for --data-type option. Supported for options are: #{DATA_TYPES.join(", ")}."
  end
end

Instance Method Details

#create_migrationObject



31
32
33
# File 'lib/ecko/plugins/stripe/generators/payment_intent_generator.rb', line 31

def create_migration
  template 'create_payment_intent_template.rb', "db/migrate/#{timestamp}_create_payable_intent.rb"
end