stripe 1.32.1 → 1.33.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/VERSION +1 -1
- data/lib/stripe/charge.rb +6 -2
- data/lib/stripe/version.rb +1 -1
- data/test/stripe/api_resource_test.rb +3 -3
- data/test/stripe/application_fee_test.rb +2 -8
- data/test/stripe/charge_test.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e065dd2aa5986f505bf2c5497a7c759db6da997c
|
4
|
+
data.tar.gz: ba93ff1df77a7f3d89bc620dbcb0a5e574283c41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6a4dc266b606ddff15e281c34da35d61fe16b73bb4d7ffd9d3c1300427bb7353d53b9d2f3ced2e8a3faa6de5beb6b40fdc82089dabc93a5cb93b2e917f52faa
|
7
|
+
data.tar.gz: 8f63334bc9c727b3dca16085019a6525ebf33a253788f74858fb8a5821d3ff162c8a254b493a296d7de03386eda684422aaa7641ea6e8cf15f97dd5194433e19
|
data/History.txt
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.33.0
|
data/lib/stripe/charge.rb
CHANGED
@@ -5,8 +5,12 @@ module Stripe
|
|
5
5
|
include Stripe::APIOperations::Update
|
6
6
|
|
7
7
|
def refund(params={}, opts={})
|
8
|
-
|
9
|
-
|
8
|
+
self.refunds.create
|
9
|
+
|
10
|
+
# now that a refund has been created, we expect the state of this object
|
11
|
+
# to change as well (i.e. `refunded` will now be `true`) so refresh it
|
12
|
+
# from the server
|
13
|
+
self.refresh
|
10
14
|
end
|
11
15
|
|
12
16
|
def capture(params={}, opts={})
|
data/lib/stripe/version.rb
CHANGED
@@ -206,12 +206,12 @@ module Stripe
|
|
206
206
|
opts[:headers][:authorization] == 'Bearer local'
|
207
207
|
end.returns(make_response(make_charge))
|
208
208
|
Stripe.expects(:execute_request).with do |opts|
|
209
|
-
opts[:url] == "#{Stripe.api_base}/v1/charges/ch_test_charge/
|
209
|
+
opts[:url] == "#{Stripe.api_base}/v1/charges/ch_test_charge/refunds" &&
|
210
210
|
opts[:headers][:authorization] == 'Bearer local'
|
211
|
-
end.returns(make_response(
|
211
|
+
end.returns(make_response(make_refund))
|
212
212
|
|
213
213
|
ch = Stripe::Charge.retrieve('ch_test_charge', 'local')
|
214
|
-
ch.
|
214
|
+
ch.refunds.create
|
215
215
|
end
|
216
216
|
end
|
217
217
|
end
|
@@ -14,18 +14,12 @@ module Stripe
|
|
14
14
|
should "application fees should be refundable" do
|
15
15
|
fee = Stripe::ApplicationFee.construct_from(make_application_fee)
|
16
16
|
|
17
|
-
# first a post to create a refund
|
18
17
|
@mock.expects(:post).once.
|
19
18
|
with("#{Stripe.api_base}/v1/application_fees/#{fee.id}/refunds", nil, '').
|
20
19
|
returns(make_response(make_application_fee_refund))
|
21
20
|
|
22
|
-
|
23
|
-
|
24
|
-
with("#{Stripe.api_base}/v1/application_fees/#{fee.id}", nil, nil).
|
25
|
-
returns(make_response({:id => "fee_test_fee", :refunded => true}))
|
26
|
-
|
27
|
-
fee.refund
|
28
|
-
assert fee.refunded
|
21
|
+
refund = fee.refunds.create
|
22
|
+
assert refund.is_a?(Stripe::ApplicationFeeRefund)
|
29
23
|
end
|
30
24
|
end
|
31
25
|
end
|
data/test/stripe/charge_test.rb
CHANGED
@@ -12,11 +12,11 @@ module Stripe
|
|
12
12
|
end
|
13
13
|
|
14
14
|
should "charges should be refundable" do
|
15
|
+
c = Stripe::Charge.construct_from(make_charge)
|
15
16
|
@mock.expects(:get).never
|
16
|
-
@mock.expects(:post).once.returns(make_response(
|
17
|
-
|
18
|
-
|
19
|
-
assert c.refunded
|
17
|
+
@mock.expects(:post).once.returns(make_response(make_refund(:charge => c)))
|
18
|
+
r = c.refunds.create
|
19
|
+
assert r.is_a?(Stripe::Refund)
|
20
20
|
end
|
21
21
|
|
22
22
|
should "charges should not be deletable" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stripe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.33.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ross Boucher
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-01-
|
12
|
+
date: 2016-01-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|