stripe 1.12.0 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,8 @@
1
+ === 1.13.0 2014-05-28
2
+
3
+ * 1 major enhancement:
4
+ * Support for canceling transfers
5
+
1
6
  === 1.12.0 2014-05-21
2
7
 
3
8
  * 1 major enhancement:
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.12.0
1
+ 1.13.0
@@ -3,5 +3,16 @@ module Stripe
3
3
  include Stripe::APIOperations::List
4
4
  include Stripe::APIOperations::Create
5
5
  include Stripe::APIOperations::Update
6
+
7
+ def cancel
8
+ response, api_key = Stripe.request(:post, cancel_url, @api_key)
9
+ refresh_from(response, api_key)
10
+ self
11
+ end
12
+
13
+ def cancel_url
14
+ url + '/cancel'
15
+ end
16
+
6
17
  end
7
18
  end
@@ -1,3 +1,3 @@
1
1
  module Stripe
2
- VERSION = '1.12.0'
2
+ VERSION = '1.13.0'
3
3
  end
@@ -0,0 +1,25 @@
1
+ require File.expand_path('../../test_helper', __FILE__)
2
+
3
+ module Stripe
4
+ class TransferTest < Test::Unit::TestCase
5
+ should "retrieve should retrieve transfer" do
6
+ @mock.expects(:get).once.returns(test_response(test_transfer))
7
+ transfer = Stripe::Transfer.retrieve('tr_test_transfer')
8
+ assert_equal 'tr_test_transfer', transfer.id
9
+ end
10
+
11
+ should "create should create a transfer" do
12
+ @mock.expects(:post).once.returns(test_response(test_transfer))
13
+ transfer = Stripe::Transfer.create
14
+ assert_equal "tr_test_transfer", transfer.id
15
+ end
16
+
17
+ should "cancel should cancel a transfer" do
18
+ @mock.expects(:get).once.returns(test_response(test_transfer))
19
+ transfer = Stripe::Transfer.retrieve('tr_test_transfer')
20
+
21
+ @mock.expects(:post).once.with('https://api.stripe.com/v1/transfers/tr_test_transfer/cancel', nil, '').returns(test_response(test_canceled_transfer))
22
+ transfer.cancel
23
+ end
24
+ end
25
+ end
@@ -332,6 +332,12 @@ def test_transfer_array
332
332
  }
333
333
  end
334
334
 
335
+ def test_canceled_transfer
336
+ test_transfer.merge({
337
+ :status => 'canceled'
338
+ })
339
+ end
340
+
335
341
  def test_invalid_api_key_error
336
342
  {
337
343
  "error" => {
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.12.0
4
+ version: 1.13.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-05-21 00:00:00.000000000 Z
13
+ date: 2014-05-28 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rest-client
@@ -197,6 +197,7 @@ files:
197
197
  - test/stripe/recipient_card_test.rb
198
198
  - test/stripe/stripe_object_test.rb
199
199
  - test/stripe/subscription_test.rb
200
+ - test/stripe/transfer_test.rb
200
201
  - test/stripe/util_test.rb
201
202
  - test/test_helper.rb
202
203
  homepage: https://stripe.com/api
@@ -239,6 +240,7 @@ test_files:
239
240
  - test/stripe/recipient_card_test.rb
240
241
  - test/stripe/stripe_object_test.rb
241
242
  - test/stripe/subscription_test.rb
243
+ - test/stripe/transfer_test.rb
242
244
  - test/stripe/util_test.rb
243
245
  - test/test_helper.rb
244
246
  has_rdoc: