Class: Stripe::CLI::Commands::Customers

Inherits:
Stripe::CLI::Command show all
Includes:
Utils
Defined in:
lib/stripe/cli/commands/customers.rb

Instance Method Summary collapse

Methods inherited from Stripe::CLI::Command

#inspect

Instance Method Details

#createObject



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/stripe/cli/commands/customers.rb', line 43

def create
  options[:email]       ||= ask('Customer\'s Email:')
  options[:description] ||= ask('Provide a description:')
  options[:plan]        ||= ask('Assign a plan:')
  if options[:plan] == ""
    options.delete :plan
  else
    options[:coupon]    ||= ask('Apply a coupon:')
  end
  options.delete( :coupon ) if options[:coupon] == ""

  if options[:plan]
    options[:card] ||= credit_card( options )
    options[:trial_end] = Chronic.parse(options[:trial_end]).to_i.to_s if options[:trial_end]
  end

  super Stripe::Customer, options
end

#delete(customer_id) ⇒ Object



24
25
26
# File 'lib/stripe/cli/commands/customers.rb', line 24

def delete customer_id
  super Stripe::Customer, customer_id
end

#find(customer_id) ⇒ Object



19
20
21
# File 'lib/stripe/cli/commands/customers.rb', line 19

def find customer_id
  super Stripe::Customer, customer_id
end

#listObject



14
15
16
# File 'lib/stripe/cli/commands/customers.rb', line 14

def list
  super Stripe::Customer, options
end