stripe-cli 1.6.1 → 1.6.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fef5bc5cbf9b0b6f8eb7c97f0f3241c54d1ec13e
4
- data.tar.gz: 6f876a9808d867a0b722a11742ba02fc5f2387d0
3
+ metadata.gz: 2e85eab0abb136dbc6ef72c9ed499f50a2038d16
4
+ data.tar.gz: 57da9beb0081b703c4003af7871d114a53757a93
5
5
  SHA512:
6
- metadata.gz: 240faef52c21585845df05f217aa5db285cd139a6f6795ceea363ae85ad7fa62f5f218d43087d0ae9fe9e4eb9516e533283f3907ad5a546b20ec86f25e6eae1b
7
- data.tar.gz: 643c7e5db02ae8fd1bdd72112a50caf1992b5aaab17b6eb4a7cd008742deef4f28db23e331ce655f714e12397e37fd23fde44cb3aa02f2a9af2e9e0eaafce572
6
+ metadata.gz: 9af565dab61af8ddbb01b83d294b19a79d5c804928d47424c8b684baeef5d1005fa265c77553d132473b7c9b5ece90953fbbc2932ec91287028046f8081bfcc5
7
+ data.tar.gz: 4c5d119ec40a3f89daba2817dcdbb66c856e275a49542d0e07b11b7fa29e2b810744b8a692a92498eea1f5e99648c725d27c6e94fcb22aee69769a8c59dee65c
data/README.md CHANGED
@@ -22,21 +22,25 @@ Note that Date/Time stamps are converted automatically. No more Epoch/Unix time
22
22
 
23
23
  For authentication, pass your secret key using the `-k` or `--key` option
24
24
 
25
- $ stripe events list -k XXXXXXXXXXXXXXXXXXXXXX
25
+ $ stripe events list -k sk_test_abcdef123456
26
26
 
27
27
  To use a specific api version, pass in the `-v` or `--version` option
28
28
 
29
29
  $ stripe balance_transactions list -v "2014-08-04"
30
30
 
31
- You may also store default configurations in a `~/.stripecli` file that conforms to the following example
31
+ Explicitly passing in configuration every time is tedious. Avoid it by creating a configuration file that contains this data.
32
+
33
+ Stripe-CLI will check your home folder (**~/**) for the existance of a `.stripecli` file that conforms to the following example
32
34
 
33
35
  ![example config file](./example.png)
34
36
 
35
- If this file exists, the specified default key is picked up and used automatically.
37
+ If this file exists, the specified default configuration is picked up and used automatically.
36
38
 
37
39
  The current directory is now also checked for the existance of a `.stripecli` file. In which case, that file is used instead.
38
40
 
39
- You may also overide the default environment setting in your config file by passing in the `-e` or `--env` option
41
+ As shown in the above example, you may set multiple configuration **environments** in a single file. Just make sure to specify a default.
42
+
43
+ The default **environment** may be overridden by passing in the `-e` or `--env` option to any command
40
44
 
41
45
  $ stripe customers find cust_123 --env=live
42
46
 
@@ -57,53 +61,65 @@ or, if you'd rather:
57
61
 
58
62
  If you choose to go this route, make sure to add `.stripecli` to your `.gitignore` files.
59
63
 
60
- ## Usage
64
+ ### Dollars vs. Cents
61
65
 
62
- Commands:
63
- stripe balance # show currently available & pending balance amounts
64
- stripe cards # find, list, create, & delete cards for both customers & recipients
65
- stripe charges # find, list, create, capture, & refund charges
66
- stripe coupons # find, list, create, & delete coupons
67
- stripe customers # find, list, create, & delete customers
68
- stripe events # find & list events
69
- stripe help [COMMAND] # Describe available commands or one specific command
70
- stripe invoices # find, list, pay, & close invoices
71
- stripe plans # find, list, create, & delete plans
72
- stripe recipients # find, list, create, & delete recipients
73
- stripe refunds # find, list, & create refunds
74
- stripe subscriptions # find, list, create, cancel, & reactivate multiple subscriptions per customer
75
- stripe tokens # find & create tokens for bank accounts & credit cards
76
- stripe transactions # find & list balance transactions
77
- stripe transfers # find, list, & create transfers
66
+ By default stripe-cli expects currency amounts to be specified in **dollars**. This behavior maybe unexpected to veteran Stripe users since the raw API expects **cents**.
67
+
68
+ To change the expected currency units from **dollars** to **cents**, set the config option `dollar_amounts` to `false` in your `.stripecli` file
69
+
70
+ dollar_amounts = false
71
+
72
+ or
73
+
74
+ [test]
75
+ dollar_amounts = false
76
+
77
+ If not set, this option defaults to **true** meaning that `amounts` should be in **dollars**
78
+
79
+ If you need to adjust this setting temporarily, there are global flags which maybe passed to any command
80
+
81
+ $ stripe charge create --no-dollar-amounts
82
+ Amount In Cents: __
83
+
84
+ $ stripe charge create --dollar-amounts
85
+ Amount In Dollars: __
78
86
 
79
87
 
88
+
89
+ ## General Features & Flexibility
90
+
80
91
  Any parameters accepted by the [stripe api](https://stripe.com/docs/api) are acceptable options to pass into commands, including metadata.
81
92
 
82
- $ stripe charges create [--amount=AMOUNT][--description=DESC][--card-number=NUM][--card-cvc=CVC][--card-exp-month=MM][--card-exp-year=YYYY]
93
+ $ stripe charges create --amount=9.98 --description=a\ must\ have --number=4242424242424242 --cvc=123 --exp-month=10 --exp-year=2020
83
94
 
84
95
  or
85
96
 
86
- $ stripe charges create [--amount=AMOUNT][--card=TOKEN_ID][--metadata=foo:bar details:"product# 4369"]
97
+ $ stripe charges create --amount=16.72 --token=tok_abc123 --metadata=foo:bar meta:really\ meta\ data
87
98
 
88
99
  or
89
100
 
90
- $ stripe charges create [--amount=AMOUNT][--customer=CUST_ID]
101
+ $ stripe charges create --amount=1 --customer=cus_def456 --no-capture
91
102
 
92
103
  ### Interactive Menus
93
104
 
94
105
  Passing NO (or partial) arguments to any operation, will trigger an interactive menu
95
106
 
96
- $ stripe charges create
97
- Amount in dollars: __
107
+ $ stripe charge create
108
+ Amount In Dollars: __
98
109
 
99
110
  or
100
111
 
101
- $ stripe charges create [--amount=AMOUNT]
112
+ $ stripe charge create --amount=99
102
113
  Name on Card: __
103
114
 
115
+ or
116
+
117
+ $ stripe token create card --card=number:4242424242424242 name:Uther\ Pendragon cvc:911 exp-month:02
118
+ Expiration Year: __
119
+
104
120
  ### cursor-based pagination
105
121
 
106
- for all ```list``` operations
122
+ for all `list` operations
107
123
 
108
124
  Options:
109
125
  [--starting-after=OBJECT_ID] # The ID of the last object in the previous paged result set.
@@ -119,10 +135,95 @@ e.g. fetching a second page
119
135
 
120
136
  ### Exception Recovery
121
137
 
122
- Api errors are rescued and their messages displayed for you to read. No more ```barfing``` to ```stdout```
138
+ Api errors are rescued and their messages displayed for you to read. No more `barfing` to `stdout`
123
139
 
124
140
  ![error rescue example](./error_message_display.png)
125
141
 
142
+ ## Usage
143
+
144
+ Commands:
145
+ stripe balance # show currently available & pending balance amounts
146
+ stripe cards # find, list, create, & delete cards for both customers & recipients
147
+ stripe charges # find, list, create, capture, & refund charges
148
+ stripe coupons # find, list, create, & delete coupons
149
+ stripe customers # find, list, create, & delete customers
150
+ stripe events # find & list events
151
+ stripe help [COMMAND] # Describe available commands or one specific command
152
+ stripe invoices # find, list, pay, & close invoices
153
+ stripe plans # find, list, create, & delete plans
154
+ stripe recipients # find, list, create, & delete recipients
155
+ stripe refunds # find, list, & create refunds
156
+ stripe subscriptions # find, list, create, cancel, & reactivate multiple subscriptions per customer
157
+ stripe tokens # find & create tokens for bank accounts & credit cards
158
+ stripe transactions # find & list balance transactions
159
+ stripe transfers # find, list, & create transfers
160
+
161
+ ## Command Documentation
162
+
163
+ - [Charges](#charges)
164
+ - [Capture](#charge-capture)
165
+ - [Create](#charge-create)
166
+ - [Find](#charge-find)
167
+ - [List](#charges-list)
168
+ - [Refund](#charge-refund)
169
+ - [Tokens](#tokens)
170
+ - [Create](#token-create)
171
+ - [Find](#token-find)
172
+ - [Cards](#cards)
173
+ - [Create](#card-create)
174
+ - [Delete](#card-delete)
175
+ - [Find](#card-find)
176
+ - [List](#cards-list)
177
+ - [Customers](#customers)
178
+ - [Create](#customer-create)
179
+ - [Delete](#customer-delete)
180
+ - [Find](#customer-find)
181
+ - [List](#customers-list)
182
+ - [Subscriptions](#subscriptions)
183
+ - [Cancel](#subscription-cancel)
184
+ - [Create](#subscription-create)
185
+ - [Find](#subscription-find)
186
+ - [List](#subscriptions-list)
187
+ - [Reactivate](#subscription-reactivate)
188
+ - [Invoices](#invoices)
189
+ - [Close](#invoice-close)
190
+ - [Find](#invoice-find)
191
+ - [List](#invoices-list)
192
+ - [Pay](#invoice-pay)
193
+ - [Upcoming](#invoice-upcoming)
194
+ - [Plans](#plans)
195
+ - [Create](#plan-create)
196
+ - [Delete](#plan-delete)
197
+ - [Find](#plan-find)
198
+ - [List](#plans-list)
199
+ - [Coupons](#coupons)
200
+ - [Create](#coupon-create)
201
+ - [Delete](#coupon-delete)
202
+ - [Find](#coupon-find)
203
+ - [List](#coupons-list)
204
+ - [Events](#events)
205
+ - [Find](#event-find)
206
+ - [List](#events-list)
207
+ - [BalanceTransactions](#balancetransactions)
208
+ - [Find](#transaction-find)
209
+ - [List](#transactions-list)
210
+ - [Recipients](#recipients)
211
+ - [Create](#recipient-create)
212
+ - [Delete](#recipient-delete)
213
+ - [Find](#recipient-find)
214
+ - [List](#recipients-list)
215
+ - [Refunds](#refunds)
216
+ - [Create](#refund-create)
217
+ - [Find](#refund-find)
218
+ - [List](#refunds-list)
219
+ - [Transfers](#transfers)
220
+ - [Create](#transfer-create)
221
+ - [Find](#transfer-find)
222
+ - [List](#transfers-list)
223
+
224
+ <!-- end toc -->
225
+
226
+
126
227
  ### Charges
127
228
 
128
229
  Commands:
@@ -133,6 +234,63 @@ Api errors are rescued and their messages displayed for you to read. No more ``
133
234
  stripe charges list # List charges (optionally by customer_id)
134
235
  stripe charges refund ID # Refund a charge
135
236
 
237
+ #### Charge Capture
238
+
239
+ Usage:
240
+ stripe charges capture ID
241
+
242
+ #### Charge Create
243
+
244
+ Usage:
245
+ stripe charges create
246
+
247
+ Options:
248
+ [--customer=CUSTOMER] # The ID of an existing customer to charge
249
+ [--token | --card=CARD] # credit card Token or ID. May also be created interactively.
250
+ [--number | --card-number=CARD_NUMBER] # credit card number. usually 16 digits long
251
+ [--exp-month | --card-exp-month=CARD_EXP_MONTH] # Two digit expiration month of card
252
+ [--exp-year | --card-exp-year=CARD_EXP_YEAR] # Four digit expiration year of card
253
+ [--cvc | --card-cvc=CARD_CVC] # Three or four digit security code located on the back of card
254
+ [--name | --card-name=CARD_NAME] # Cardholder's full name as displayed on card
255
+ [--amount=N] # Charge amount in dollars
256
+ [--currency=CURRENCY] # 3-letter ISO code for currency
257
+ # Default: usd
258
+ [--description=DESCRIPTION] # Arbitrary description of charge
259
+ [--capture], [--no-capture] # Whether or not to immediately capture the charge. Uncaptured charges expire in 7 days
260
+ # Default: true
261
+ [--metadata=key:value] # A key/value store of additional user-defined data
262
+ [--statement-description=STATEMENT_DESCRIPTION] # Displayed alongside your company name on your customer's card statement (15 character max)
263
+ [--receipt-email=RECEIPT_EMAIL] # Email address to send receipt to. Overrides default email settings.
264
+
265
+ #### Charge Find
266
+
267
+ Usage:
268
+ stripe charges find ID
269
+
270
+ #### Charges List
271
+
272
+ Usage:
273
+ stripe charges list
274
+
275
+ Options:
276
+ [--starting-after=STARTING_AFTER] # The ID of the last object in the previous paged result set. For cursor-based pagination.
277
+ [--ending-before=ENDING_BEFORE] # The ID of the first object in the previous paged result set, when paging backwards through the list.
278
+ [--limit=LIMIT] # a limit on the number of resources returned, between 1 and 100
279
+ [--offset=OFFSET] # the starting index to be used, relative to the entire list
280
+ [--count=COUNT] # depricated: use limit
281
+ [--customer=CUSTOMER] # a customer ID to filter results by
282
+
283
+ #### Charge Refund
284
+
285
+ Usage:
286
+ stripe charges refund ID
287
+
288
+ Options:
289
+ [--amount=N] # Refund amount in dollars. (Entire charge by default)
290
+ [--metadata=key:value] # a key/value store of additional user-defined data
291
+ [--refund-application-fee], [--no-refund-application-fee] # Whether or not to refund the application fee
292
+
293
+
136
294
  ### Tokens
137
295
 
138
296
  Commands:
@@ -140,6 +298,29 @@ Api errors are rescued and their messages displayed for you to read. No more ``
140
298
  stripe tokens find ID # Find a Token
141
299
  stripe tokens help [COMMAND] # Describe subcommands or one specific subcommand
142
300
 
301
+ #### Token Create
302
+
303
+ Usage:
304
+ stripe token create TYPE
305
+
306
+ Options:
307
+ [--card=key:value] # hash of card params. params may also be provided individually or added interactively.
308
+ [--number | --card-number=CARD_NUMBER] # credit card number. usually 16 digits long
309
+ [--exp-month | --card-exp-month=CARD_EXP_MONTH] # Two digit expiration month of card
310
+ [--exp-year | --card-exp-year=CARD_EXP_YEAR] # Four digit expiration year of card
311
+ [--cvc | --card-cvc=CARD_CVC] # Three or four digit security code located on the back of card
312
+ [--name | --card-name=CARD_NAME] # Cardholder's full name as displayed on card
313
+ [--account | --bank-account=key:value] # hash of account params. params may also be provided individually or added interactively.
314
+ [--country=COUNTRY]
315
+ [--routing-number=ROUTING_NUMBER]
316
+ [--account-number=ACCOUNT_NUMBER]
317
+
318
+ #### Token Find
319
+
320
+ Usage:
321
+ stripe token find ID
322
+
323
+
143
324
  ### Cards
144
325
 
145
326
  Commands:
@@ -149,6 +330,49 @@ Api errors are rescued and their messages displayed for you to read. No more ``
149
330
  stripe cards help [COMMAND] # Describe subcommands or one specific subcommand
150
331
  stripe cards list --owner=OWNER # List cards for OWNER (customer or recipient)
151
332
 
333
+ #### Card Create
334
+
335
+ Usage:
336
+ stripe card create --customer, --recipient, --owner=OWNER
337
+
338
+ Options:
339
+ [--token | --card=CARD] # credit card Token or ID. May also be created interactively.
340
+ [--number | --card-number=CARD_NUMBER]
341
+ [--exp-month | --card-exp-month=EXP_MONTH] # Two digit expiration month of card
342
+ [--exp-year | --card-exp-year=EXP_YEAR] # Four digit expiration year of card
343
+ [--cvc | --card-cvc=CARD_CVC] # Three or four digit security code located on the back of card
344
+ [--name | --card-name=CARD_NAME] # Cardholder's full name as displayed on card
345
+ --customer, --recipient, --owner=OWNER # id of customer or recipient receiving new card
346
+
347
+ #### Card Delete
348
+
349
+ Usage:
350
+ stripe card delete ID --owner=OWNER
351
+
352
+ Options:
353
+ --owner=OWNER # id of customer or recipient to search within
354
+
355
+ #### Card Find
356
+
357
+ Usage:
358
+ stripe card find ID --owner=OWNER
359
+
360
+ Options:
361
+ --owner=OWNER # id of customer or recipient to search within
362
+
363
+ #### Cards List
364
+
365
+ Usage:
366
+ stripe cards list --owner=OWNER
367
+
368
+ Options:
369
+ [--starting-after=STARTING_AFTER] # The ID of the last object in the previous paged result set. For cursor-based pagination.
370
+ [--ending-before=ENDING_BEFORE] # The ID of the first object in the previous paged result set, when paging backwards through the list.
371
+ [--limit=LIMIT] # a limit on the number of resources returned, between 1 and 100
372
+ [--offset=OFFSET] # the starting index to be used, relative to the entire list
373
+ [--count=COUNT] # depricated: use limit
374
+ --owner=OWNER # id of customer or recipient to search within
375
+
152
376
  ### Customers
153
377
 
154
378
  Commands:
@@ -158,6 +382,50 @@ Api errors are rescued and their messages displayed for you to read. No more ``
158
382
  stripe customers help [COMMAND] # Describe subcommands or one specific subcommand
159
383
  stripe customers list # List customers
160
384
 
385
+ #### Customer Create
386
+
387
+ Usage:
388
+ stripe customer create
389
+
390
+ Options:
391
+ [--description=DESCRIPTION] # Arbitrary description to be displayed in Stripe Dashboard.
392
+ [--email=EMAIL] # Customer's email address. Will be displayed in Stripe Dashboard.
393
+ [--plan=PLAN] # The ID of a Plan this customer should be subscribed to. Requires a credit card.
394
+ [--coupon=COUPON] # The ID of a Coupon to be applied to all of Customer's recurring charges
395
+ [--quantity=QUANTITY] # A multiplier for the plan option. defaults to `1'
396
+ [--trial-end=TRIAL_END] # apply a trial period until this date. Override plan's trial period.
397
+ [--account-balance=ACCOUNT_BALANCE] # 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.
398
+ [--token | --card=CARD] # credit card Token or ID. May also be created interactively.
399
+ [--number | --card-number=CARD_NUMBER] # credit card number. usually 16 digits long
400
+ [--exp-month | --card-exp-month=CARD_EXP_MONTH] # Two digit expiration month of card
401
+ [--exp-year | --card-exp-year=CARD_EXP_YEAR] # Four digit expiration year of card
402
+ [--cvc | --card-cvc=CARD_CVC] # Three or four digit security code located on the back of card
403
+ [--name | --card-name=CARD_NAME] # Cardholder's full name as displayed on card
404
+ [--metadata=key:value] # a key/value store of additional user-defined data
405
+
406
+ #### Customer Delete
407
+
408
+ Usage:
409
+ stripe customer delete ID
410
+
411
+ #### Customer Find
412
+
413
+ Usage:
414
+ stripe customer find ID
415
+
416
+ #### Customers List
417
+
418
+ Usage:
419
+ stripe customers list
420
+
421
+ Options:
422
+ [--starting-after=STARTING_AFTER] # The ID of the last object in the previous paged result set. For cursor-based pagination.
423
+ [--ending-before=ENDING_BEFORE] # The ID of the first object in the previous paged result set, when paging backwards through the list.
424
+ [--limit=LIMIT] # a limit on the number of resources returned, between 1 and 100
425
+ [--offset=OFFSET] # the starting index to be used, relative to the entire list
426
+ [--count=COUNT] # depricated: use limit
427
+
428
+
161
429
  ### Subscriptions
162
430
 
163
431
  Commands:
@@ -168,6 +436,63 @@ Api errors are rescued and their messages displayed for you to read. No more ``
168
436
  stripe subscriptions list --customer=CUSTOMER # List subscriptions for CUSTOMER customer
169
437
  stripe subscriptions reactivate ID --customer=CUSTOMER # reactivate auto-renewal if `cancel-at-period-end` was set to true
170
438
 
439
+ #### Subscription Cancel
440
+
441
+ Usage:
442
+ stripe subscription cancel ID c, --customer=CUSTOMER
443
+
444
+ Options:
445
+ [--at-period-end], [--no-at-period-end] # delay cancellation until end of current period
446
+ # default: false
447
+ c, --customer=CUSTOMER # id of customer to search within
448
+
449
+ #### Subscription Create
450
+
451
+ Usage:
452
+ stripe subscription create c, --customer=CUSTOMER
453
+
454
+ Options:
455
+ [--plan=PLAN] # the plan to assign to CUSTOMER customer
456
+ [--coupon=COUPON] # id of a coupon to apply
457
+ [--trial-end=TRIAL_END] # apply a trial period until this date. Override plan's trial period.
458
+ [--token | --card=CARD] # credit card Token or ID. May also be created interactively.
459
+ [--number | --card-number=CARD_NUMBER] # credit card number. usually 16 digits long
460
+ [--exp-month | --card-exp-month=CARD_EXP_MONTH] # Two digit expiration month of card
461
+ [--exp-year | --card-exp-year=CARD_EXP_YEAR] # Four digit expiration year of card
462
+ [--cvc | --card-cvc=CARD_CVC] # Three or four digit security code located on the back of card
463
+ [--name | --card-name=CARD_NAME] # Cardholder's full name as displayed on card
464
+ [--metadata=key:value] # a key/value store of additional user-defined data
465
+ c, --customer=CUSTOMER # ID of customer receiving the new subscription
466
+
467
+ #### Subscription Find
468
+
469
+ Usage:
470
+ stripe subscription find ID c, --customer=CUSTOMER
471
+
472
+ Options:
473
+ c, --customer=CUSTOMER # ID of customer to search within
474
+
475
+ #### Subscriptions List
476
+
477
+ Usage:
478
+ stripe subscriptions list c, --customer=CUSTOMER
479
+
480
+ Options:
481
+ [--starting-after=STARTING_AFTER] # The ID of the last object in the previous paged result set. For cursor-based pagination.
482
+ [--ending-before=ENDING_BEFORE] # The ID of the first object in the previous paged result set, when paging backwards through the list.
483
+ [--limit=LIMIT] # a limit on the number of resources returned, between 1 and 100
484
+ [--offset=OFFSET] # the starting index to be used, relative to the entire list
485
+ [--count=COUNT] # depricated: use limit
486
+ c, --customer=CUSTOMER # ID of customer to search within
487
+
488
+ #### Subscription Reactivate
489
+
490
+ Usage:
491
+ stripe subscription reactivate ID c, --customer=CUSTOMER
492
+
493
+ Options:
494
+ c, --customer=CUSTOMER # id of customer to search within
495
+
171
496
  ### Invoices
172
497
 
173
498
  Commands:
@@ -178,6 +503,40 @@ Api errors are rescued and their messages displayed for you to read. No more ``
178
503
  stripe invoices pay ID # trigger an open invoice to be paid immediately
179
504
  stripe invoices upcoming CUSTOMER # find the upcoming invoice for CUSTOMER
180
505
 
506
+ #### Invoice Close
507
+
508
+ Usage:
509
+ stripe invoice close ID
510
+
511
+ #### Invoice Find
512
+
513
+ Usage:
514
+ stripe invoice find ID
515
+
516
+ #### Invoices List
517
+
518
+ Usage:
519
+ stripe invoice list
520
+
521
+ Options:
522
+ [--starting-after=STARTING_AFTER] # The ID of the last object in the previous paged result set. For cursor-based pagination.
523
+ [--ending-before=ENDING_BEFORE] # The ID of the first object in the previous paged result set, when paging backwards through the list.
524
+ [--limit=LIMIT] # a limit on the number of resources returned, between 1 and 100
525
+ [--offset=OFFSET] # the starting index to be used, relative to the entire list
526
+ [--count=COUNT] # depricated: use limit
527
+ [--customer=CUSTOMER] # a customer ID to filter results by
528
+
529
+ #### Invoice Pay
530
+
531
+ Usage:
532
+ stripe invoice pay ID
533
+
534
+ #### Invoice Upcoming
535
+
536
+ Usage:
537
+ stripe invoice upcoming CUSTOMER
538
+
539
+
181
540
  ### Plans
182
541
 
183
542
  Commands:
@@ -187,6 +546,19 @@ Api errors are rescued and their messages displayed for you to read. No more ``
187
546
  stripe plans help [COMMAND] # Describe subcommands or one specific subcommand
188
547
  stripe plans list # List plans
189
548
 
549
+ #### Plan Create
550
+
551
+
552
+ #### Plan Delete
553
+
554
+
555
+ #### Plan Find
556
+
557
+
558
+ #### Plans List
559
+
560
+
561
+
190
562
  ### Coupons
191
563
 
192
564
  Commands:
@@ -196,6 +568,19 @@ Api errors are rescued and their messages displayed for you to read. No more ``
196
568
  stripe coupons help [COMMAND] # Describe subcommands or one specific subcommand
197
569
  stripe coupons list # List coupons
198
570
 
571
+ #### Coupon Create
572
+
573
+
574
+ #### Coupon Delete
575
+
576
+
577
+ #### Coupon Find
578
+
579
+
580
+ #### Coupons List
581
+
582
+
583
+
199
584
  ### Events
200
585
 
201
586
  Commands:
@@ -203,6 +588,13 @@ Api errors are rescued and their messages displayed for you to read. No more ``
203
588
  stripe events help [COMMAND] # Describe subcommands or one specific subcommand
204
589
  stripe events list # List events
205
590
 
591
+ #### Event Find
592
+
593
+
594
+ #### Events List
595
+
596
+
597
+
206
598
  ### BalanceTransactions
207
599
 
208
600
  Commands:
@@ -210,6 +602,13 @@ Api errors are rescued and their messages displayed for you to read. No more ``
210
602
  stripe transactions help [COMMAND] # Describe subcommands or one specific subcommand
211
603
  stripe transactions list [TYPE] # List transactions, optionaly filter by type:(charge refund adjustment application_fee application_fee_refund transfer transfer_failure)
212
604
 
605
+ #### Transaction Find
606
+
607
+
608
+ #### Transactions List
609
+
610
+
611
+
213
612
  ### Recipients
214
613
 
215
614
  Commands:
@@ -219,6 +618,19 @@ Api errors are rescued and their messages displayed for you to read. No more ``
219
618
  stripe recipients help [COMMAND] # Describe subcommands or one specific subcommand
220
619
  stripe recipients list # List recipients
221
620
 
621
+ #### Recipient Create
622
+
623
+
624
+ #### Recipient Delete
625
+
626
+
627
+ #### Recipient Find
628
+
629
+
630
+ #### Recipients List
631
+
632
+
633
+
222
634
  ### Refunds
223
635
 
224
636
  Though ```refund``` is still a supported operation of the ```charges``` command. The ```refunds``` command offers additional functionality.
@@ -229,6 +641,16 @@ Though ```refund``` is still a supported operation of the ```charges``` command
229
641
  stripe refunds help [COMMAND] # Describe subcommands or one specific subcommand
230
642
  stripe refunds list --charge=CHARGE # List refunds for CHARGE charge
231
643
 
644
+ #### Refund Create
645
+
646
+
647
+ #### Refund Find
648
+
649
+
650
+ #### Refunds List
651
+
652
+
653
+
232
654
  ### Transfers
233
655
 
234
656
  Commands:
@@ -237,7 +659,13 @@ Though ```refund``` is still a supported operation of the ```charges``` command
237
659
  stripe transfers help [COMMAND] # Describe subcommands or one specific subcommand
238
660
  stripe transfers list # List transfers, optionaly filter by recipient or transfer status: ( pending paid failed )
239
661
 
240
- #### Easter Egg Alert!
662
+ #### Transfer Create
663
+
664
+ #### Transfer Find
665
+
666
+ #### Transfers List
667
+
668
+ #### Easter Egg
241
669
 
242
670
  You can pass the `--balance` flag into `transfer create` to automatically set transfer `amount` equal to your currently available balance.
243
671
 
@@ -245,10 +673,10 @@ example:
245
673
 
246
674
  $ stripe transfer create --balance --recipient=self
247
675
 
248
- > No, its not magic. The `--balance` flag just triggers a 'preflight' api call to retrieve your current balance and assigns that to the `--amount` option
249
676
 
250
677
  ## Road Map
251
678
 
679
+ 1. complete command documentation in this readme
252
680
  1. `update` command operations
253
681
  1. support for `disputes` & dispute handling
254
682
  1. support creating/updating config file through cli
@@ -258,4 +686,4 @@ example:
258
686
 
259
687
  Pull requests are always welcome and appriciated.
260
688
 
261
- Please report issues, offer suggestions, and voice concerns in the issues tracker.
689
+ Please report issues, offer suggestions, and voice concerns in the issues tracker.
@@ -0,0 +1,75 @@
1
+ # Stripe-CLI Project Change Log
2
+
3
+ ## 1.6.3
4
+
5
+ - new `dollar_amounts` config setting for toggling expected currency units between **dollars** and **cents**
6
+ - `--no-dollar-amounts` global option flag
7
+ - `--dollar-amounts` global option flag
8
+
9
+ ## 1.6.1
10
+
11
+ - extensive option alias support throughout, with more on the way
12
+ - more extensive documentation in README, including subcommand descriptions. (still incomplete)
13
+ - add TOC in README
14
+
15
+ ## 1.6.0
16
+
17
+ - token creation correctly handles credit card params in any combination of individual options and --card=key:value pairs and still collects any missing params via interactive menu.
18
+ - any operation that accepts a credit card ID or token also accepts credit card parameters directly and incorporates the credit card interactive menu.
19
+ - improved option descriptions in all operations of all commands
20
+
21
+ ## 1.5.2
22
+
23
+ - tack **'/Stripe-CLI vX.X.X'** onto user-agent header of every api request
24
+ - **Disclaimer:** though I believe it to be completely harmless in this instance, this feature involves monkey-patching the `Stripe` module with an `alias_method_chain` style wrapper around `Stripe#request_headers`
25
+ - The Stripe Dashboard depends on the user-agent to distinguish the **source** of each api request
26
+ - this helps differentiate between requests made by application code and those made using the Stripe-CLI gem
27
+
28
+
29
+ ## 1.5.1
30
+
31
+ - fix unreported bug where Stripe::ListObjects were not displayed as simple arrays by awesome_print
32
+ - only present in conjunction with stripe-ruby version 1.14 and up
33
+ - due to a change in stripe-ruby by which `Stripe::StripeObject#to_hash` now calls itself recursivly
34
+ - resort to using `Object#instance_variable_get` to peek at a StripeObject's `@values` variable which already contains a hash of its attributes
35
+ - I am open to suggestions for a less brittle solution
36
+
37
+ ## 1.5.0
38
+
39
+ - Refunds as a top-level command
40
+
41
+ ## 1.4.6
42
+
43
+ - subscriptions `reactivate` subcommand
44
+ - `--at-period-end` flag added to `subscriptions cancel`
45
+ - `--refund-application-fee` flag added to `charges refund`
46
+ - add `--metadata` to the remaining subcommands that need it
47
+
48
+ ## 1.4.4
49
+
50
+ - `--receipt_email` and `--statement_description` options added to `charges create`
51
+
52
+ ## 1.4.3
53
+
54
+ - top-level `version` command for printing current gem version
55
+ - hidden from standard `help` banner
56
+ - aliased as `-v` and `--version`
57
+
58
+ ## 1.4.1
59
+
60
+ - per project config files (.stripecli)
61
+
62
+ ## 1.4.0
63
+
64
+ - credit cards as a top-level command
65
+ - for customers and recipients
66
+ - w/ actions: find, list, create, & delete
67
+
68
+ ## 1.3.0
69
+
70
+ - introduce multiple subscriptions per customer
71
+ - w/ actions: cancel, create, find, & list
72
+
73
+ ## 1.2.2
74
+
75
+ - introduce optional cursor-based pagination options to all `list` operations
@@ -0,0 +1,14 @@
1
+ default = test
2
+ version = "2014-07-22"
3
+ dollar_amounts = false
4
+
5
+ [test]
6
+ key = sk_test_abc123def456ghi789jklmno
7
+
8
+ [live]
9
+ key = sk_live_onmlkj987ihg654fed321cba
10
+
11
+ [new-api]
12
+ key = sk_test_abc123def456ghi789jklmno
13
+ version = "2014-09-08"
14
+ dollar_amounts = true
@@ -13,14 +13,14 @@ module Stripe
13
13
 
14
14
  # `alias_method_chain' style patch to tweek the user-agent header sent with every API request
15
15
  # Doing this adds context to request data that can be viewed using the Stripe Dashboard
16
- # Differentiating requests made by application code from those made using the Stripe-CLI gem
16
+ # differentiating requests made by application code from those made using the Stripe-CLI gem
17
17
  class<<self
18
- def add_stripe_cli_to_user_agent_string api_key
18
+ def cat_user_agent_string api_key
19
19
  user_agent = original_request_headers(api_key)[:user_agent]
20
20
  original_request_headers(api_key).update(:user_agent => user_agent<<"/Stripe-CLI v#{Stripe::CLI::VERSION}")
21
21
  end
22
22
  alias_method :original_request_headers, :request_headers
23
- alias_method :request_headers, :add_stripe_cli_to_user_agent_string
24
- private :request_headers
23
+ alias_method :request_headers, :cat_user_agent_string
24
+ private :cat_user_agent_string
25
25
  end
26
26
  end
@@ -9,6 +9,7 @@ module Stripe
9
9
  class_option :key, :aliases => :k
10
10
  class_option :env, :aliases => :e
11
11
  class_option :version, :aliases => :v
12
+ class_option :dollar_amounts, :type => :boolean
12
13
 
13
14
  protected
14
15
 
@@ -24,6 +25,13 @@ module Stripe
24
25
  @env ||= options.delete(:env) || config['default']
25
26
  end
26
27
 
28
+ def dollar_amounts
29
+ convert_amount_to_dollars = options.delete(:dollar_amounts)
30
+ convert_amount_to_dollars.nil? ?
31
+ stored_api_option('dollar_amounts') == 'false' ?
32
+ false : true : convert_amount_to_dollars
33
+ end
34
+
27
35
  def stored_api_option option
28
36
  if File.exists?(config_file)
29
37
  if environment
@@ -28,7 +28,7 @@ module Stripe
28
28
 
29
29
  desc "create", "create a new card for OWNER (customer or recipient)"
30
30
  option :card, :aliases => "--token", :desc => "credit card Token or ID. May also be created interactively."
31
- option :card_number, :aliases => "--number"
31
+ option :card_number, :aliases => "--number", :desc => "credit card number. usually 16 digits long"
32
32
  option :card_exp_month, :aliases => "--exp-month", :desc => "Two digit expiration month of card"
33
33
  option :card_exp_year, :aliases => "--exp-year", :desc => "Four digit expiration year of card"
34
34
  option :card_cvc, :aliases => "--cvc", :desc => "Three or four digit security code located on the back of card"
@@ -25,7 +25,7 @@ module Stripe
25
25
  option :metadata, :type => :hash, :desc => "a key/value store of additional user-defined data"
26
26
  option :refund_application_fee, :type => :boolean, :default => false, :desc => "Whether or not to refund the application fee"
27
27
  def refund charge_id
28
- options[:amount] = (Float(options[:amount]) * 100).to_i if options[:amount]
28
+ options[:amount] = convert_amount(options[:amount]) if options[:amount]
29
29
  if charge = retrieve_charge(charge_id)
30
30
  request charge.refunds, :create, options
31
31
  end
@@ -39,21 +39,20 @@ module Stripe
39
39
  desc "create", "Create a charge"
40
40
  option :customer, :desc => "The ID of an existing customer to charge"
41
41
  option :card, :aliases => "--token", :desc => "credit card Token or ID. May also be created interactively."
42
- option :card_number, :aliases => "--number"
42
+ option :card_number, :aliases => "--number", :desc => "credit card number. usually 16 digits long"
43
43
  option :card_exp_month, :aliases => "--exp-month", :desc => "Two digit expiration month of card"
44
44
  option :card_exp_year, :aliases => "--exp-year", :desc => "Four digit expiration year of card"
45
45
  option :card_cvc, :aliases => "--cvc", :desc => "Three or four digit security code located on the back of card"
46
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
- option :currency, :default => "usd"
48
+ option :currency, :default => "usd", :desc => "3-letter ISO code for currency"
49
49
  option :description, :desc => "Arbitrary description of charge"
50
50
  option :capture, :type => :boolean, :default => true, :desc => "Whether or not to immediately capture the charge. Uncaptured charges expire in 7 days"
51
51
  option :metadata, :type => :hash, :desc => "A key/value store of additional user-defined data"
52
52
  option :statement_description, :desc => "Displayed alongside your company name on your customer's card statement (15 character max)"
53
53
  option :receipt_email, :desc => "Email address to send receipt to. Overrides default email settings."
54
54
  def create
55
- options[:amount] ||= ask('Amount in dollars:')
56
- options[:amount] = (Float(options[:amount]) * 100).to_i
55
+ options[:amount] = convert_amount(options[:amount])
57
56
 
58
57
  options[:card] ||= credit_card( options ) unless options[:customer]
59
58
 
@@ -34,7 +34,7 @@ module Stripe
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
36
  option :card, :aliases => "--token", :desc => "credit card Token or ID. May also be created interactively."
37
- option :card_number, :aliases => "--number"
37
+ option :card_number, :aliases => "--number", :desc => "credit card number. usually 16 digits long"
38
38
  option :card_exp_month, :aliases => "--exp-month", :desc => "Two digit expiration month of card"
39
39
  option :card_exp_year, :aliases => "--exp-year", :desc => "Four digit expiration year of card"
40
40
  option :card_cvc, :aliases => "--cvc", :desc => "Three or four digit security code located on the back of card"
@@ -2,6 +2,7 @@ module Stripe
2
2
  module CLI
3
3
  module Commands
4
4
  class Plans < Command
5
+ include Stripe::Utils
5
6
 
6
7
  desc "list", "List plans"
7
8
  option :starting_after, :desc => "The ID of the last object in the previous paged result set. For cursor-based pagination."
@@ -33,8 +34,7 @@ module Stripe
33
34
  option :trial_period_days, :type => :numeric, :default => 0, :desc => "Number of days to delay a customer's initial bill"
34
35
  option :metadata, :type => :hash, :desc => "a key/value store of additional user-defined data"
35
36
  def create
36
- options[:amount] ||= ask('Amount in dollars:')
37
- options[:amount] = (Float(options[:amount]) * 100).to_i
37
+ options[:amount] = convert_amount(options[:amount])
38
38
  options[:name] ||= ask('Plan name:')
39
39
  options[:id] ||= ask('Plan id:')
40
40
 
@@ -38,7 +38,7 @@ module Stripe
38
38
  option :account_number
39
39
  option :routing_number
40
40
  option :card, :aliases => "--token", :desc => "credit card Token or ID. May also be created interactively."
41
- option :card_number, :aliases => "--number"
41
+ option :card_number, :aliases => "--number", :desc => "credit card number. usually 16 digits long"
42
42
  option :card_exp_month, :aliases => "--exp-month", :desc => "Two digit expiration month of card"
43
43
  option :card_exp_year, :aliases => "--exp-year", :desc => "Four digit expiration year of card"
44
44
  option :card_cvc, :aliases => "--cvc", :desc => "Three or four digit security code located on the back of card"
@@ -31,7 +31,7 @@ module Stripe
31
31
  option :refund_application_fee, :type => :boolean, :default => false, :desc => "Whether or not to refund the application fee"
32
32
  option :charge, :aliases => :c, :required => true, :desc => "Id of charge to apply refund"
33
33
  def create
34
- options[:amount] = (Float(options[:amount]) * 100).to_i if options[:amount]
34
+ options[:amount] = convert_amount(options[:amount]) if options[:amount]
35
35
  if charge = retrieve_charge(options.delete :charge)
36
36
  super charge.refunds, options
37
37
  end
@@ -31,7 +31,7 @@ module Stripe
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
33
  option :card, :aliases => "--token", :desc => "credit card Token or ID. May also be created interactively."
34
- option :card_number, :aliases => "--number"
34
+ option :card_number, :aliases => "--number", :desc => "credit card number. usually 16 digits long"
35
35
  option :card_exp_month, :aliases => "--exp-month", :desc => "Two digit expiration month of card"
36
36
  option :card_exp_year, :aliases => "--exp-year", :desc => "Four digit expiration year of card"
37
37
  option :card_cvc, :aliases => "--cvc", :desc => "Three or four digit security code located on the back of card"
@@ -11,7 +11,7 @@ module Stripe
11
11
 
12
12
  desc "create TYPE", "create a new token of type TYPE(card or account)"
13
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"
14
+ option :card_number, :aliases => "--number", :desc => "credit card number. usually 16 digits long"
15
15
  option :card_exp_month, :aliases => "--exp-month", :desc => "Two digit expiration month of card"
16
16
  option :card_exp_year, :aliases => "--exp-year", :desc => "Four digit expiration year of card"
17
17
  option :card_cvc, :aliases => "--cvc", :desc => "Three or four digit security code located on the back of card"
@@ -2,6 +2,7 @@ module Stripe
2
2
  module CLI
3
3
  module Commands
4
4
  class Transfers < Command
5
+ include Stripe::Utils
5
6
 
6
7
  desc "list", "List transfers, optionaly filter by recipient or transfer status: ( pending paid failed )"
7
8
  option :starting_after, :desc => "The ID of the last object in the previous paged result set. For cursor-based pagination."
@@ -33,8 +34,7 @@ module Stripe
33
34
  if options.delete(:balance) == true
34
35
  options[:amount] = Stripe::Balance.retrieve(api_key).available.first.amount
35
36
  else
36
- options[:amount] ||= ask('Amount in Dollars:')
37
- options[:amount] = (Float(options[:amount]) * 100).to_i
37
+ options[:amount] = convert_amount(options[:amount])
38
38
  end
39
39
 
40
40
  if options.delete(:self) == true
@@ -1,5 +1,5 @@
1
1
  module Stripe
2
2
  module CLI
3
- VERSION = "1.6.1"
3
+ VERSION = "1.6.3"
4
4
  end
5
5
  end
@@ -7,10 +7,10 @@ module Stripe
7
7
  card = options.delete(:card) || {}
8
8
  {
9
9
  :name => card["name"] || options.delete(:card_name) || ask('Name on Card:'),
10
- :number => card["number"] || options.delete(:card_number) || ask('Card number:'),
10
+ :number => card["number"] || options.delete(:card_number) || ask('Card Number:'),
11
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:')
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:')
14
14
  }
15
15
  end
16
16
 
@@ -23,6 +23,14 @@ module Stripe
23
23
  }
24
24
  end
25
25
 
26
+ def convert_amount amount
27
+ if dollar_amounts
28
+ (Float(amount||ask('Amount In Dollars:')) * 100).to_i
29
+ else
30
+ amount||ask('Amount In Cents:')
31
+ end
32
+ end
33
+
26
34
  def retrieve_customer id
27
35
  begin
28
36
  ::Stripe::Customer.retrieve(id, api_key)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stripe-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.1
4
+ version: 1.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex MacCaw
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-09-04 00:00:00.000000000 Z
12
+ date: 2014-09-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -162,7 +162,8 @@ files:
162
162
  - README.md
163
163
  - Rakefile
164
164
  - bin/stripe
165
- - example.conf
165
+ - changelog.md
166
+ - example-configuration.stripecli
166
167
  - lib/stripe/cli.rb
167
168
  - lib/stripe/cli/command.rb
168
169
  - lib/stripe/cli/commands.rb
@@ -1,9 +0,0 @@
1
- default = "test"
2
- version = "2013-08-13"
3
-
4
- [test]
5
- key = "test_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
6
-
7
- [live]
8
- key = "live_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
9
- version = "2013-02-13"