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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d2d2a6395d80bde7fc0021ce5774016af214c990
4
- data.tar.gz: 71f7a568f9e60ae0a696c2e43a31ba963ca05ae6
3
+ metadata.gz: e065dd2aa5986f505bf2c5497a7c759db6da997c
4
+ data.tar.gz: ba93ff1df77a7f3d89bc620dbcb0a5e574283c41
5
5
  SHA512:
6
- metadata.gz: 6e2a2dc5678a605a941e28c2332383c8cebb1be58406881db0d0d1ed47a47f692be87868eb917aedd6ff8f231c4a7b92889c33b65e37bdb459e8fd8f827d8cfe
7
- data.tar.gz: 20ce1c2d6be1316ef740ab3ad469fa676e1ada2e5d92cd7bd4587d4b3f0c574284e6b3392d29ed8b8bace956d9ea16c420495de373cebe3b3f00b4b2662a006a
6
+ metadata.gz: e6a4dc266b606ddff15e281c34da35d61fe16b73bb4d7ffd9d3c1300427bb7353d53b9d2f3ced2e8a3faa6de5beb6b40fdc82089dabc93a5cb93b2e917f52faa
7
+ data.tar.gz: 8f63334bc9c727b3dca16085019a6525ebf33a253788f74858fb8a5821d3ff162c8a254b493a296d7de03386eda684422aaa7641ea6e8cf15f97dd5194433e19
@@ -1,3 +1,7 @@
1
+ === 1.33.0 2016-01-19
2
+
3
+ * Re-implement `Charge#refund` helper to use the modern endpoint suggested by docs
4
+
1
5
  === 1.32.1 2016-01-07
2
6
 
3
7
  * Fix bug where ivar left uninitialized in StripeObject could error on serialization
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.32.1
1
+ 1.33.0
@@ -5,8 +5,12 @@ module Stripe
5
5
  include Stripe::APIOperations::Update
6
6
 
7
7
  def refund(params={}, opts={})
8
- response, opts = request(:post, refund_url, params, opts)
9
- initialize_from(response, opts)
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={})
@@ -1,3 +1,3 @@
1
1
  module Stripe
2
- VERSION = '1.32.1'
2
+ VERSION = '1.33.0'
3
3
  end
@@ -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/refund" &&
209
+ opts[:url] == "#{Stripe.api_base}/v1/charges/ch_test_charge/refunds" &&
210
210
  opts[:headers][:authorization] == 'Bearer local'
211
- end.returns(make_response(make_charge))
211
+ end.returns(make_response(make_refund))
212
212
 
213
213
  ch = Stripe::Charge.retrieve('ch_test_charge', 'local')
214
- ch.refund
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
- # then a get to refresh the current object
23
- @mock.expects(:get).once.
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
@@ -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({:id => "ch_test_charge", :refunded => true}))
17
- c = Stripe::Charge.new("test_charge")
18
- c.refund
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.32.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-07 00:00:00.000000000 Z
12
+ date: 2016-01-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client