47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
# File 'lib/stripe/cli/commands/recipients.rb', line 47
def create
options[:type] ||= recipient_type(options)
case options[:type]
when 'individual'
options[:name] ||= ask('Recipient\'s full, legal name:')
options[:tax_id] ||= ask('Tax ID (SSN):')
when 'corporation'
options[:name] ||= ask('Full Incorporated Name:')
options[:tax_id] ||= ask('Tax ID (EIN):')
end unless options[:name] && options[:tax_id]
options[:tax_id].gsub!(/[^\d]/,"")
options[:email] ||= ask('Email Address:')
unless options[:card] || no?('add a Debit Card? [yN]',:yellow)
options[:card_name] ||= options[:name] if yes?('Name on card same as recipient name? [yN]')
options[:card] = credit_card( options )
end
unless options[:bank_account] || no?('add a Bank Account? [yN]',:yellow)
options[:bank_account] = bank_account( options )
end
options.delete_if {|option,_| strip_list.include? option }
super Stripe::Recipient, options
end
|