stripe 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +4 -0
- data/README.md +5 -1
- data/Rakefile +2 -2
- data/VERSION +1 -1
- data/lib/stripe.rb +2 -0
- data/lib/stripe/payout.rb +16 -0
- data/lib/stripe/recipient_transfer.rb +4 -0
- data/lib/stripe/util.rb +2 -0
- data/lib/stripe/version.rb +1 -1
- data/openapi/fixtures.json +1363 -1292
- data/openapi/fixtures.yaml +1160 -1096
- data/openapi/{spec.json → spec2.json} +1037 -608
- data/openapi/{spec.yaml → spec2.yaml} +1266 -648
- data/test/api_fixtures.rb +1 -1
- data/test/api_stub_helpers.rb +1 -1
- data/test/stripe/payout_test.rb +50 -0
- metadata +8 -4
data/test/api_fixtures.rb
CHANGED
data/test/api_stub_helpers.rb
CHANGED
@@ -98,7 +98,7 @@ module APIStubHelpers
|
|
98
98
|
# Finds the latest OpenAPI specification in ROOT/openapi/ and parses it for
|
99
99
|
# use with Committee.
|
100
100
|
def self.initialize_spec
|
101
|
-
spec_data = ::JSON.parse(File.read("#{PROJECT_ROOT}/openapi/
|
101
|
+
spec_data = ::JSON.parse(File.read("#{PROJECT_ROOT}/openapi/spec2.json"))
|
102
102
|
|
103
103
|
driver = Committee::Drivers::OpenAPI2.new
|
104
104
|
driver.parse(spec_data)
|
@@ -0,0 +1,50 @@
|
|
1
|
+
require File.expand_path('../../test_helper', __FILE__)
|
2
|
+
|
3
|
+
module Stripe
|
4
|
+
class PayoutTest < Test::Unit::TestCase
|
5
|
+
FIXTURE = API_FIXTURES.fetch(:payout)
|
6
|
+
|
7
|
+
should "be listable" do
|
8
|
+
payouts = Stripe::Payout.list
|
9
|
+
assert_requested :get, "#{Stripe.api_base}/v1/payouts"
|
10
|
+
assert payouts.data.kind_of?(Array)
|
11
|
+
assert payouts.data[0].kind_of?(Stripe::Payout)
|
12
|
+
end
|
13
|
+
|
14
|
+
should "be retrievable" do
|
15
|
+
payout = Stripe::Payout.retrieve(FIXTURE[:id])
|
16
|
+
assert_requested :get, "#{Stripe.api_base}/v1/payouts/#{FIXTURE[:id]}"
|
17
|
+
assert payout.kind_of?(Stripe::Payout)
|
18
|
+
end
|
19
|
+
|
20
|
+
should "be creatable" do
|
21
|
+
payout = Stripe::Payout.create(
|
22
|
+
amount: 100,
|
23
|
+
currency: "USD"
|
24
|
+
)
|
25
|
+
assert_requested :post, "#{Stripe.api_base}/v1/payouts"
|
26
|
+
assert payout.kind_of?(Stripe::Payout)
|
27
|
+
end
|
28
|
+
|
29
|
+
should "be saveable" do
|
30
|
+
payout = Stripe::Payout.retrieve(FIXTURE[:id])
|
31
|
+
payout.metadata['key'] = 'value'
|
32
|
+
payout.save
|
33
|
+
assert_requested :post, "#{Stripe.api_base}/v1/payouts/#{FIXTURE[:id]}"
|
34
|
+
end
|
35
|
+
|
36
|
+
should "be updateable" do
|
37
|
+
payout = Stripe::Payout.update(FIXTURE[:id], metadata: {foo: 'bar'})
|
38
|
+
assert_requested :post, "#{Stripe.api_base}/v1/payouts/#{FIXTURE[:id]}"
|
39
|
+
assert payout.kind_of?(Stripe::Payout)
|
40
|
+
end
|
41
|
+
|
42
|
+
context "#cancel" do
|
43
|
+
should "cancel a payout" do
|
44
|
+
payout = Stripe::Payout.retrieve(FIXTURE[:id])
|
45
|
+
payout = payout.cancel
|
46
|
+
assert payout.kind_of?(Stripe::Payout)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stripe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stripe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -76,9 +76,11 @@ files:
|
|
76
76
|
- lib/stripe/list_object.rb
|
77
77
|
- lib/stripe/order.rb
|
78
78
|
- lib/stripe/order_return.rb
|
79
|
+
- lib/stripe/payout.rb
|
79
80
|
- lib/stripe/plan.rb
|
80
81
|
- lib/stripe/product.rb
|
81
82
|
- lib/stripe/recipient.rb
|
83
|
+
- lib/stripe/recipient_transfer.rb
|
82
84
|
- lib/stripe/refund.rb
|
83
85
|
- lib/stripe/reversal.rb
|
84
86
|
- lib/stripe/singleton_api_resource.rb
|
@@ -96,8 +98,8 @@ files:
|
|
96
98
|
- lib/stripe/version.rb
|
97
99
|
- openapi/fixtures.json
|
98
100
|
- openapi/fixtures.yaml
|
99
|
-
- openapi/
|
100
|
-
- openapi/
|
101
|
+
- openapi/spec2.json
|
102
|
+
- openapi/spec2.yaml
|
101
103
|
- stripe.gemspec
|
102
104
|
- test/api_fixtures.rb
|
103
105
|
- test/api_stub_helpers.rb
|
@@ -125,6 +127,7 @@ files:
|
|
125
127
|
- test/stripe/list_object_test.rb
|
126
128
|
- test/stripe/order_return_test.rb
|
127
129
|
- test/stripe/order_test.rb
|
130
|
+
- test/stripe/payout_test.rb
|
128
131
|
- test/stripe/plan_test.rb
|
129
132
|
- test/stripe/product_test.rb
|
130
133
|
- test/stripe/recipient_card_test.rb
|
@@ -195,6 +198,7 @@ test_files:
|
|
195
198
|
- test/stripe/list_object_test.rb
|
196
199
|
- test/stripe/order_return_test.rb
|
197
200
|
- test/stripe/order_test.rb
|
201
|
+
- test/stripe/payout_test.rb
|
198
202
|
- test/stripe/plan_test.rb
|
199
203
|
- test/stripe/product_test.rb
|
200
204
|
- test/stripe/recipient_card_test.rb
|