Class: Stripe::CLI::Commands::Charges
- Inherits:
-
Stripe::CLI::Command
- Object
- Thor
- Stripe::CLI::Command
- Stripe::CLI::Commands::Charges
- Includes:
- Utils
- Defined in:
- lib/stripe/cli/commands/charges.rb
Instance Method Summary collapse
- #capture(charge_id) ⇒ Object
- #create ⇒ Object
- #find(charge_id) ⇒ Object
- #list ⇒ Object
- #refund(charge_id) ⇒ Object
Methods inherited from Stripe::CLI::Command
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 |
#create ⇒ Object
54 55 56 57 58 59 60 |
# File 'lib/stripe/cli/commands/charges.rb', line 54 def create [:amount] = convert_amount([:amount]) [:card] ||= credit_card( ) unless [:customer] super Stripe::Charge, 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 |
#list ⇒ Object
14 15 16 |
# File 'lib/stripe/cli/commands/charges.rb', line 14 def list super Stripe::Charge, end |
#refund(charge_id) ⇒ Object
27 28 29 30 31 32 |
# File 'lib/stripe/cli/commands/charges.rb', line 27 def refund charge_id [:amount] = convert_amount([:amount]) if [:amount] if charge = retrieve_charge(charge_id) request charge.refunds, :create, end end |