stripe-cli 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.md +7 -6
- data/lib/stripe/cli/commands/charges.rb +1 -1
- data/lib/stripe/cli/version.rb +1 -1
- data/spec/command_spec.rb +1 -6
- data/spec/commands/charges_spec.rb +23 -0
- data/spec/spec_helper.rb +12 -0
- data/stripe-cli.gemspec +1 -1
- metadata +28 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d082b9566158577cd8b5659bdca8c25fe19f352
|
4
|
+
data.tar.gz: 39493535599a3aab4ad3b995498e0f57dcaab75f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdfca4e7da24deee922ba45a6437c4c8170dce24f9e09631bb40a6817c8c86ace7215bad864002b40bb91ebae2629800c6e654aa0b614f0908e931b6fda68c54
|
7
|
+
data.tar.gz: 5a08e9a732fbe977ca753abedbbf20afef293cc26e1701ff5bda96bee5a6420626ac7d16ff7b921e5c22bfab9eb426bdb63d140f4dc05ba01a1c5c181f624329
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,12 +1,13 @@
|
|
1
|
+
<a href="http://badge.fury.io/rb/stripe-cli"><img style="float:right;" src="https://badge.fury.io/rb/stripe-cli.png" alt="Gem Version" height="18"></a>
|
2
|
+
<a href="https://codeclimate.com/repos/52773e8fc7f3a3121a004455/feed"><img style="float:right;margin-right:10px;" src="https://codeclimate.com/repos/52773e8fc7f3a3121a004455/badges/67e5d04281479d6f8cb3/gpa.png"></a>
|
1
3
|
# Stripe::CLI
|
2
|
-
|
3
4
|
stripe-cli is a command line interface to [Stripe](https://stripe.com).
|
4
5
|
|
5
6
|
Uses [AwesomePrint](https://github.com/michaeldv/awesome_print) to provide very readable output on your command line.
|
6
7
|
|
7
8
|
![example output](./output.png)
|
8
9
|
|
9
|
-
Note that all JSON-style epoch timestamps have been converted to **real life** DateTime stamps,
|
10
|
+
Note that all JSON-style epoch timestamps have been converted to **real life** DateTime stamps, you're welcome!
|
10
11
|
|
11
12
|
## Installation
|
12
13
|
|
@@ -33,7 +34,7 @@ For authentication, pass your secret key using the `-k` or `--key` option
|
|
33
34
|
|
34
35
|
To use a specific api version, pass in the `-v` or `--version` option
|
35
36
|
|
36
|
-
$ stripe balance_transactions list -v "2013-
|
37
|
+
$ stripe balance_transactions list -v "2013-10-29"
|
37
38
|
|
38
39
|
You may also store default configurations in a `~/.stripecli` file that conforms to the following example
|
39
40
|
|
@@ -61,13 +62,13 @@ You may also overide the default environment setting in your config file by pass
|
|
61
62
|
stripe transfers # find, list, & create transfers
|
62
63
|
|
63
64
|
|
64
|
-
Any parameters accepted by the [stripe api](https://stripe.com/docs/api) are acceptable options to pass into commands
|
65
|
+
Any parameters accepted by the [stripe api](https://stripe.com/docs/api) are acceptable options to pass into commands, including metadata.
|
65
66
|
|
66
67
|
$ stripe charges create [--amount=AMOUNT][--description=DESC][--card_number=NUM][--card_cvc=CVC][--card_exp_month=MM][--card_exp_year=YYYY]
|
67
68
|
|
68
69
|
or
|
69
70
|
|
70
|
-
$ stripe charges create [--amount=AMOUNT][--card=TOKEN_ID]
|
71
|
+
$ stripe charges create [--amount=AMOUNT][--card=TOKEN_ID][--metadata=foo:bar details:"product# 4369"]
|
71
72
|
|
72
73
|
or
|
73
74
|
|
@@ -189,4 +190,4 @@ example:
|
|
189
190
|
|
190
191
|
pull requests welcome
|
191
192
|
|
192
|
-
report issues in the issues tracker
|
193
|
+
report issues in the issues tracker
|
@@ -20,7 +20,7 @@ module Stripe
|
|
20
20
|
desc "refund ID", "Refund a charge"
|
21
21
|
option :amount, :type => :numeric
|
22
22
|
def refund charge_id
|
23
|
-
options[:amount] = (Float(options[:amount]) * 100).to_i
|
23
|
+
options[:amount] = (Float(options[:amount]) * 100).to_i if options[:amount]
|
24
24
|
request Stripe::Charge.new(charge_id, api_key), :refund, options
|
25
25
|
end
|
26
26
|
|
data/lib/stripe/cli/version.rb
CHANGED
data/spec/command_spec.rb
CHANGED
@@ -1,9 +1,4 @@
|
|
1
|
-
require '
|
2
|
-
require_relative '../lib/stripe/cli.rb'
|
3
|
-
|
4
|
-
f = Tempfile.new('config')
|
5
|
-
f.write "key = stripe-key" and f.rewind
|
6
|
-
Stripe::CLI::Command.class_variable_set :@@config, f
|
1
|
+
require 'spec_helper'
|
7
2
|
|
8
3
|
describe Stripe::CLI::Command do
|
9
4
|
let(:_id_) { "random-id-string" }
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Stripe::CLI::Commands::Charges do
|
4
|
+
let(:_id_){ "a-charge-id" }
|
5
|
+
|
6
|
+
|
7
|
+
describe "#refund" do
|
8
|
+
|
9
|
+
it "takes a charge_id and refunds the associated charge entirely" do
|
10
|
+
request_hash = Stripe::CLI::Runner.start ["charges", "refund", _id_]
|
11
|
+
request_hash[:url].should == "https://api.stripe.com/v1/charges/a-charge-id/refund"
|
12
|
+
request_hash[:payload].should == ""
|
13
|
+
end
|
14
|
+
|
15
|
+
it "takes a charge_id and an optional [--amount] and partially refunds the associated charge" do
|
16
|
+
request_hash = Stripe::CLI::Runner.start ["charges", "refund", _id_, "--amount=100.99"]
|
17
|
+
request_hash[:url].should == "https://api.stripe.com/v1/charges/a-charge-id/refund"
|
18
|
+
request_hash[:payload].should == "amount=10099"
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'rspec'
|
2
|
+
require_relative '../lib/stripe/cli.rb'
|
3
|
+
|
4
|
+
f = Tempfile.new('config')
|
5
|
+
f.write "key = stripe-key" and f.rewind
|
6
|
+
Stripe::CLI::Command.class_variable_set :@@config, f
|
7
|
+
|
8
|
+
module Stripe
|
9
|
+
def self.execute_request(opts)
|
10
|
+
return OpenStruct.new(body: opts.to_json)
|
11
|
+
end
|
12
|
+
end
|
data/stripe-cli.gemspec
CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.add_development_dependency "rake"
|
27
27
|
spec.add_development_dependency "rspec"
|
28
28
|
spec.add_dependency "thor", "~> 0.18.1"
|
29
|
-
spec.add_dependency "stripe", "~> 1.
|
29
|
+
spec.add_dependency "stripe", "~> 1.9.9"
|
30
30
|
spec.add_dependency "awesome_print"
|
31
31
|
spec.add_dependency "parseconfig"
|
32
32
|
spec.add_dependency "chronic"
|
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.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex MacCaw
|
@@ -9,118 +9,118 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-01-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - ~>
|
18
|
+
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '1.3'
|
21
21
|
type: :development
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - ~>
|
25
|
+
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '1.3'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rake
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- -
|
32
|
+
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: '0'
|
35
35
|
type: :development
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '0'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rspec
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- -
|
46
|
+
- - ">="
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: '0'
|
49
49
|
type: :development
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- -
|
53
|
+
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: thor
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- - ~>
|
60
|
+
- - "~>"
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: 0.18.1
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- - ~>
|
67
|
+
- - "~>"
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: 0.18.1
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: stripe
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- - ~>
|
74
|
+
- - "~>"
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: 1.
|
76
|
+
version: 1.9.9
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- - ~>
|
81
|
+
- - "~>"
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version: 1.
|
83
|
+
version: 1.9.9
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: awesome_print
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
|
-
- -
|
88
|
+
- - ">="
|
89
89
|
- !ruby/object:Gem::Version
|
90
90
|
version: '0'
|
91
91
|
type: :runtime
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
|
-
- -
|
95
|
+
- - ">="
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '0'
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
99
|
name: parseconfig
|
100
100
|
requirement: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
|
-
- -
|
102
|
+
- - ">="
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: '0'
|
105
105
|
type: :runtime
|
106
106
|
prerelease: false
|
107
107
|
version_requirements: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
|
-
- -
|
109
|
+
- - ">="
|
110
110
|
- !ruby/object:Gem::Version
|
111
111
|
version: '0'
|
112
112
|
- !ruby/object:Gem::Dependency
|
113
113
|
name: chronic
|
114
114
|
requirement: !ruby/object:Gem::Requirement
|
115
115
|
requirements:
|
116
|
-
- -
|
116
|
+
- - ">="
|
117
117
|
- !ruby/object:Gem::Version
|
118
118
|
version: '0'
|
119
119
|
type: :runtime
|
120
120
|
prerelease: false
|
121
121
|
version_requirements: !ruby/object:Gem::Requirement
|
122
122
|
requirements:
|
123
|
-
- -
|
123
|
+
- - ">="
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: '0'
|
126
126
|
description: |2
|
@@ -134,7 +134,7 @@ executables:
|
|
134
134
|
extensions: []
|
135
135
|
extra_rdoc_files: []
|
136
136
|
files:
|
137
|
-
- .gitignore
|
137
|
+
- ".gitignore"
|
138
138
|
- Gemfile
|
139
139
|
- LICENSE.txt
|
140
140
|
- README.md
|
@@ -159,6 +159,8 @@ files:
|
|
159
159
|
- lib/stripe/cli/version.rb
|
160
160
|
- lib/stripe/utils.rb
|
161
161
|
- spec/command_spec.rb
|
162
|
+
- spec/commands/charges_spec.rb
|
163
|
+
- spec/spec_helper.rb
|
162
164
|
- stripe-cli.gemspec
|
163
165
|
homepage: https://stripe.com
|
164
166
|
licenses:
|
@@ -170,19 +172,21 @@ require_paths:
|
|
170
172
|
- lib
|
171
173
|
required_ruby_version: !ruby/object:Gem::Requirement
|
172
174
|
requirements:
|
173
|
-
- -
|
175
|
+
- - ">="
|
174
176
|
- !ruby/object:Gem::Version
|
175
177
|
version: '0'
|
176
178
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
177
179
|
requirements:
|
178
|
-
- -
|
180
|
+
- - ">="
|
179
181
|
- !ruby/object:Gem::Version
|
180
182
|
version: '0'
|
181
183
|
requirements: []
|
182
184
|
rubyforge_project:
|
183
|
-
rubygems_version: 2.1
|
185
|
+
rubygems_version: 2.2.1
|
184
186
|
signing_key:
|
185
187
|
specification_version: 4
|
186
188
|
summary: Command line interface to Stripe
|
187
189
|
test_files:
|
188
190
|
- spec/command_spec.rb
|
191
|
+
- spec/commands/charges_spec.rb
|
192
|
+
- spec/spec_helper.rb
|