stripe-cli 1.6.0 → 1.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/stripe/cli/commands/cards.rb +9 -8
- data/lib/stripe/cli/commands/charges.rb +6 -6
- data/lib/stripe/cli/commands/customers.rb +6 -6
- data/lib/stripe/cli/commands/recipients.rb +9 -9
- data/lib/stripe/cli/commands/subscriptions.rb +6 -6
- data/lib/stripe/cli/commands/tokens.rb +9 -9
- data/lib/stripe/cli/version.rb +1 -1
- data/lib/stripe/utils.rb +10 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fef5bc5cbf9b0b6f8eb7c97f0f3241c54d1ec13e
|
4
|
+
data.tar.gz: 6f876a9808d867a0b722a11742ba02fc5f2387d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 240faef52c21585845df05f217aa5db285cd139a6f6795ceea363ae85ad7fa62f5f218d43087d0ae9fe9e4eb9516e533283f3907ad5a546b20ec86f25e6eae1b
|
7
|
+
data.tar.gz: 643c7e5db02ae8fd1bdd72112a50caf1992b5aaab17b6eb4a7cd008742deef4f28db23e331ce655f714e12397e37fd23fde44cb3aa02f2a9af2e9e0eaafce572
|
@@ -27,15 +27,16 @@ module Stripe
|
|
27
27
|
|
28
28
|
|
29
29
|
desc "create", "create a new card for OWNER (customer or recipient)"
|
30
|
-
option :card, :aliases =>
|
31
|
-
option :card_number, :aliases =>
|
32
|
-
option :card_exp_month, :aliases =>
|
33
|
-
option :card_exp_year, :aliases =>
|
34
|
-
option :card_cvc, :aliases =>
|
35
|
-
option :card_name, :aliases =>
|
36
|
-
option :owner, :required => true, :desc => "id of customer or recipient receiving new card"
|
30
|
+
option :card, :aliases => "--token", :desc => "credit card Token or ID. May also be created interactively."
|
31
|
+
option :card_number, :aliases => "--number"
|
32
|
+
option :card_exp_month, :aliases => "--exp-month", :desc => "Two digit expiration month of card"
|
33
|
+
option :card_exp_year, :aliases => "--exp-year", :desc => "Four digit expiration year of card"
|
34
|
+
option :card_cvc, :aliases => "--cvc", :desc => "Three or four digit security code located on the back of card"
|
35
|
+
option :card_name, :aliases => "--name", :desc => "Cardholder's full name as displayed on card"
|
36
|
+
option :owner, :aliases => %w( --customer --recipient ), :required => true, :desc => "id of customer or recipient receiving new card"
|
37
37
|
def create
|
38
|
-
|
38
|
+
card = options.delete(:card)
|
39
|
+
options[:card] = card || credit_card( options )
|
39
40
|
if owner = retrieve_owner(options.delete :owner)
|
40
41
|
super owner.cards, options
|
41
42
|
end
|
@@ -38,12 +38,12 @@ module Stripe
|
|
38
38
|
|
39
39
|
desc "create", "Create a charge"
|
40
40
|
option :customer, :desc => "The ID of an existing customer to charge"
|
41
|
-
option :card, :aliases =>
|
42
|
-
option :card_number, :aliases =>
|
43
|
-
option :card_exp_month, :aliases =>
|
44
|
-
option :card_exp_year, :aliases =>
|
45
|
-
option :card_cvc, :aliases =>
|
46
|
-
option :card_name, :aliases =>
|
41
|
+
option :card, :aliases => "--token", :desc => "credit card Token or ID. May also be created interactively."
|
42
|
+
option :card_number, :aliases => "--number"
|
43
|
+
option :card_exp_month, :aliases => "--exp-month", :desc => "Two digit expiration month of card"
|
44
|
+
option :card_exp_year, :aliases => "--exp-year", :desc => "Four digit expiration year of card"
|
45
|
+
option :card_cvc, :aliases => "--cvc", :desc => "Three or four digit security code located on the back of card"
|
46
|
+
option :card_name, :aliases => "--name", :desc => "Cardholder's full name as displayed on card"
|
47
47
|
option :amount, :type => :numeric, :desc => "Charge amount in dollars"
|
48
48
|
option :currency, :default => "usd"
|
49
49
|
option :description, :desc => "Arbitrary description of charge"
|
@@ -33,12 +33,12 @@ module Stripe
|
|
33
33
|
option :quantity, :desc => "A multiplier for the plan option. defaults to `1'"
|
34
34
|
option :trial_end, :desc => "apply a trial period until this date. Override plan's trial period."
|
35
35
|
option :account_balance, :desc => "customer's starting account balance in cents. A positive amount will be added to the next invoice while a negitive amount will act as a credit."
|
36
|
-
option :card, :aliases =>
|
37
|
-
option :card_number, :aliases =>
|
38
|
-
option :card_exp_month, :aliases =>
|
39
|
-
option :card_exp_year, :aliases =>
|
40
|
-
option :card_cvc, :aliases =>
|
41
|
-
option :card_name, :aliases =>
|
36
|
+
option :card, :aliases => "--token", :desc => "credit card Token or ID. May also be created interactively."
|
37
|
+
option :card_number, :aliases => "--number"
|
38
|
+
option :card_exp_month, :aliases => "--exp-month", :desc => "Two digit expiration month of card"
|
39
|
+
option :card_exp_year, :aliases => "--exp-year", :desc => "Four digit expiration year of card"
|
40
|
+
option :card_cvc, :aliases => "--cvc", :desc => "Three or four digit security code located on the back of card"
|
41
|
+
option :card_name, :aliases => "--name", :desc => "Cardholder's full name as displayed on card"
|
42
42
|
option :metadata, :type => :hash, :desc => "a key/value store of additional user-defined data"
|
43
43
|
def create
|
44
44
|
options[:email] ||= ask('Customer\'s Email:')
|
@@ -27,21 +27,21 @@ module Stripe
|
|
27
27
|
|
28
28
|
desc "create", "create a new recipient. Either an Individual or a Corporation."
|
29
29
|
option :name, :desc => "Full legal name of Individual or Corporation"
|
30
|
-
option :type, :enum => %w( individual corporation )
|
31
|
-
option :individual, :type => :boolean, :aliases => :i
|
32
|
-
option :corporation, :type => :boolean, :aliases => :c
|
30
|
+
option :type, :enum => %w( individual corporation ), :desc => "recipient type,"
|
31
|
+
option :individual, :type => :boolean, :aliases => :i, :desc => "flag specifying recipient should be of type Individual"
|
32
|
+
option :corporation, :type => :boolean, :aliases => :c, :desc => "flag specifying recipient should be of type Corporation"
|
33
33
|
option :tax_id, :type => :numeric
|
34
34
|
option :email
|
35
35
|
option :description
|
36
|
-
option :bank_account
|
36
|
+
option :bank_account, :aliases => "--account"
|
37
37
|
option :country
|
38
38
|
option :account_number
|
39
39
|
option :routing_number
|
40
|
-
option :card, :aliases =>
|
41
|
-
option :card_number, :aliases =>
|
42
|
-
option :card_exp_month, :aliases =>
|
43
|
-
option :card_exp_year, :aliases =>
|
44
|
-
option :card_cvc, :aliases =>
|
40
|
+
option :card, :aliases => "--token", :desc => "credit card Token or ID. May also be created interactively."
|
41
|
+
option :card_number, :aliases => "--number"
|
42
|
+
option :card_exp_month, :aliases => "--exp-month", :desc => "Two digit expiration month of card"
|
43
|
+
option :card_exp_year, :aliases => "--exp-year", :desc => "Four digit expiration year of card"
|
44
|
+
option :card_cvc, :aliases => "--cvc", :desc => "Three or four digit security code located on the back of card"
|
45
45
|
option :card_name, :desc => "Cardholder's full name as displayed on card"
|
46
46
|
option :metadata, :type => :hash, :desc => "a key/value store of additional user-defined data"
|
47
47
|
def create
|
@@ -30,12 +30,12 @@ module Stripe
|
|
30
30
|
option :plan, :desc => "the plan to assign to CUSTOMER customer"
|
31
31
|
option :coupon, :desc => "id of a coupon to apply"
|
32
32
|
option :trial_end, :desc => "apply a trial period until this date. Override plan's trial period."
|
33
|
-
option :card, :aliases =>
|
34
|
-
option :card_number, :aliases =>
|
35
|
-
option :card_exp_month, :aliases =>
|
36
|
-
option :card_exp_year, :aliases =>
|
37
|
-
option :card_cvc, :aliases =>
|
38
|
-
option :card_name, :aliases =>
|
33
|
+
option :card, :aliases => "--token", :desc => "credit card Token or ID. May also be created interactively."
|
34
|
+
option :card_number, :aliases => "--number"
|
35
|
+
option :card_exp_month, :aliases => "--exp-month", :desc => "Two digit expiration month of card"
|
36
|
+
option :card_exp_year, :aliases => "--exp-year", :desc => "Four digit expiration year of card"
|
37
|
+
option :card_cvc, :aliases => "--cvc", :desc => "Three or four digit security code located on the back of card"
|
38
|
+
option :card_name, :aliases => "--name", :desc => "Cardholder's full name as displayed on card"
|
39
39
|
option :metadata, :type => :hash, :desc => "a key/value store of additional user-defined data"
|
40
40
|
option :customer, :aliases => :c, :required => true, :desc => "ID of customer receiving the new subscription"
|
41
41
|
def create
|
@@ -10,24 +10,24 @@ module Stripe
|
|
10
10
|
end
|
11
11
|
|
12
12
|
desc "create TYPE", "create a new token of type TYPE(card or account)"
|
13
|
-
option :card, :type => :hash, :desc => "hash of card
|
14
|
-
option :card_number, :aliases =>
|
15
|
-
option :card_exp_month, :aliases =>
|
16
|
-
option :card_exp_year, :aliases =>
|
17
|
-
option :card_cvc, :aliases =>
|
18
|
-
option :card_name, :aliases =>
|
19
|
-
option :bank_account, :type => :hash
|
13
|
+
option :card, :type => :hash, :default => {}, :desc => "hash of card params. may also be provided individually or added interactively."
|
14
|
+
option :card_number, :aliases => "--number"
|
15
|
+
option :card_exp_month, :aliases => "--exp-month", :desc => "Two digit expiration month of card"
|
16
|
+
option :card_exp_year, :aliases => "--exp-year", :desc => "Four digit expiration year of card"
|
17
|
+
option :card_cvc, :aliases => "--cvc", :desc => "Three or four digit security code located on the back of card"
|
18
|
+
option :card_name, :aliases => "--name", :desc => "Cardholder's full name as displayed on card"
|
19
|
+
option :bank_account, :aliases => "--account", :type => :hash, :default => {}, :desc => "hash of account params. may also be provided individually or added interactively."
|
20
20
|
option :country
|
21
21
|
option :routing_number
|
22
22
|
option :account_number
|
23
23
|
def create type
|
24
24
|
case type
|
25
25
|
when 'card', 'credit_card', 'credit card'
|
26
|
-
credit_card =
|
26
|
+
credit_card = credit_card( options )
|
27
27
|
options = {}
|
28
28
|
options[:card] = credit_card
|
29
29
|
when 'account', 'bank_account', 'bank account'
|
30
|
-
bank_account =
|
30
|
+
bank_account = bank_account( options )
|
31
31
|
options = {}
|
32
32
|
options[:bank_account] = bank_account
|
33
33
|
end
|
data/lib/stripe/cli/version.rb
CHANGED
data/lib/stripe/utils.rb
CHANGED
@@ -4,20 +4,22 @@ module Stripe
|
|
4
4
|
private
|
5
5
|
|
6
6
|
def credit_card options = {}
|
7
|
+
card = options.delete(:card) || {}
|
7
8
|
{
|
8
|
-
:name => options.delete(:card_name) || ask('Name on Card:'),
|
9
|
-
:number => options.delete(:card_number) || ask('Card number:'),
|
10
|
-
:cvc => options.delete(:card_cvc) || ask('CVC code:'),
|
11
|
-
:exp_month => options.delete(:card_exp_month) || ask('expiration month:'),
|
12
|
-
:exp_year => options.delete(:card_exp_year) || ask('expiration year:')
|
9
|
+
:name => card["name"] || options.delete(:card_name) || ask('Name on Card:'),
|
10
|
+
:number => card["number"] || options.delete(:card_number) || ask('Card number:'),
|
11
|
+
:cvc => card["cvc"] || options.delete(:card_cvc) || ask('CVC code:'),
|
12
|
+
:exp_month => card["exp-month"] || options.delete(:card_exp_month) || ask('expiration month:'),
|
13
|
+
:exp_year => card["exp-year"] || options.delete(:card_exp_year) || ask('expiration year:')
|
13
14
|
}
|
14
15
|
end
|
15
16
|
|
16
17
|
def bank_account options = {}
|
18
|
+
account = options.delete(:bank_account) || {}
|
17
19
|
{
|
18
|
-
:account_number => options.delete(:account_number) || ask('Account Number:'),
|
19
|
-
:routing_number => options.delete(:routing_number) || ask('Routing Number:'),
|
20
|
-
:country => options.delete(:country) || 'US'
|
20
|
+
:account_number => account["account-number"] || options.delete(:account_number) || ask('Account Number:'),
|
21
|
+
:routing_number => account["routing-number"] || options.delete(:routing_number) || ask('Routing Number:'),
|
22
|
+
:country => account["country"] || options.delete(:country) || 'US'
|
21
23
|
}
|
22
24
|
end
|
23
25
|
|