class Stripe::CLI::Commands::Transfers

Public Instance Methods

create() click to toggle source
Calls superclass method Stripe::CLI::Command#create
# File lib/stripe/cli/commands/transfers.rb, line 33
def create
  if options.delete(:balance) == true
    options[:amount] = Stripe::Balance.retrieve(api_key).available.first.amount
  else
    options[:amount] = convert_amount(options[:amount])
  end

  if options.delete(:self) == true
    options[:recipient] = 'self'
  else
    options[:recipient] ||= ask('Recipient ID or self:')
    options[:recipient] = create_recipient[:id] if options[:recipient] == ""
  end

  super Stripe::Transfer, options
end
find(transfer_id) click to toggle source
Calls superclass method Stripe::CLI::Command#find
# File lib/stripe/cli/commands/transfers.rb, line 20
def find transfer_id
  super Stripe::Transfer, transfer_id
end
list() click to toggle source
Calls superclass method Stripe::CLI::Command#list
# File lib/stripe/cli/commands/transfers.rb, line 15
def list
  super Stripe::Transfer, options
end

Private Instance Methods

create_recipient() click to toggle source
# File lib/stripe/cli/commands/transfers.rb, line 52
def create_recipient
  Stripe::CLI::Runner.start [ "recipients", "create" ]
end