stripe 1.12.0 → 1.13.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/VERSION +1 -1
- data/lib/stripe/transfer.rb +11 -0
- data/lib/stripe/version.rb +1 -1
- data/test/stripe/transfer_test.rb +25 -0
- data/test/test_helper.rb +6 -0
- metadata +4 -2
data/History.txt
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.13.0
|
data/lib/stripe/transfer.rb
CHANGED
@@ -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
|
data/lib/stripe/version.rb
CHANGED
@@ -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
|
data/test/test_helper.rb
CHANGED
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.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-
|
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:
|