Class: Stripe::CLI::Commands::Charges

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

Instance Method Summary collapse

Methods inherited from Stripe::CLI::Command

#inspect

Instance Method Details

#capture(charge_id) ⇒ Object



35
36
37
# File 'lib/stripe/cli/commands/charges.rb', line 35

def capture charge_id
  request Stripe::Charge.new(charge_id, api_key), :capture
end

#createObject



54
55
56
57
58
59
60
# File 'lib/stripe/cli/commands/charges.rb', line 54

def create
  options[:amount] = convert_amount(options[:amount])

  options[:card] ||= credit_card( options ) unless options[:customer]

  super Stripe::Charge, options
end

#find(charge_id) ⇒ Object



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

def find charge_id
  super Stripe::Charge, charge_id
end

#listObject



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

def list
  super Stripe::Charge, options
end

#refund(charge_id) ⇒ Object



27
28
29
30
31
32
# File 'lib/stripe/cli/commands/charges.rb', line 27

def refund charge_id
  options[:amount] = convert_amount(options[:amount]) if options[:amount]
  if charge = retrieve_charge(charge_id)
    request charge.refunds, :create, options
  end
end