stripe 1.35.1 → 1.36.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.rb +1 -0
- data/lib/stripe/country_spec.rb +9 -0
- data/lib/stripe/util.rb +1 -0
- data/lib/stripe/version.rb +1 -1
- data/test/stripe/country_spec_test.rb +43 -0
- data/test/test_data.rb +57 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f34746bb3a826f64477e8dff5c616665144fe56d
|
4
|
+
data.tar.gz: 82e4663d7d8b3392ed36b19969d1ada2afb05115
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bae160dd906dcd1e27be1aae953c53e39697ecf17c61baf75637a3e3b725ebc96cdadabc5c5c2025b5f940aff1f1e8952dff9314adc185754557101795a0f691
|
7
|
+
data.tar.gz: ffa399f6f15e8e166995855c370629969986ddfee49b8a36b8126248be40b01a04c8135a83bc23b284f0b279b416f7676a731e08b498c206aadf037996d593d8
|
data/History.txt
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.36.0
|
data/lib/stripe.rb
CHANGED
data/lib/stripe/util.rb
CHANGED
data/lib/stripe/version.rb
CHANGED
@@ -0,0 +1,43 @@
|
|
1
|
+
require File.expand_path('../../test_helper', __FILE__)
|
2
|
+
|
3
|
+
module Stripe
|
4
|
+
class CountrySpecTest < Test::Unit::TestCase
|
5
|
+
should "be listable" do
|
6
|
+
@mock.expects(:get).once.
|
7
|
+
returns(make_response(country_spec_array))
|
8
|
+
c = Stripe::CountrySpec.list
|
9
|
+
|
10
|
+
assert_equal('/v1/country_specs', c.url)
|
11
|
+
assert_equal('list', c.object)
|
12
|
+
assert(c.data.kind_of?(Array))
|
13
|
+
assert_equal('US', c.data[0].id)
|
14
|
+
assert(c.data[0].kind_of?(Stripe::CountrySpec))
|
15
|
+
end
|
16
|
+
|
17
|
+
should "be retrievable" do
|
18
|
+
resp = make_country_spec
|
19
|
+
@mock.expects(:get).once.
|
20
|
+
with('https://api.stripe.com/v1/country_specs/US', nil, nil).
|
21
|
+
returns(make_response(resp))
|
22
|
+
s = Stripe::CountrySpec.retrieve('US')
|
23
|
+
|
24
|
+
assert_equal('/v1/country_specs/US', s.url)
|
25
|
+
assert_equal('country_spec', s.object)
|
26
|
+
assert(s.kind_of?(Stripe::CountrySpec))
|
27
|
+
|
28
|
+
s.supported_bank_account_currencies.map{ |k,v| assert v.kind_of?(Array) }
|
29
|
+
assert_equal(['US'], s.supported_bank_account_currencies['usd'])
|
30
|
+
assert(s.supported_payment_currencies.include?('usd'))
|
31
|
+
assert s.supported_payment_currencies.kind_of?(Array)
|
32
|
+
assert s.supported_payment_methods.kind_of?(Array)
|
33
|
+
|
34
|
+
['individual', 'company'].map{ |type|
|
35
|
+
item = s.verification_fields[type]
|
36
|
+
assert item.minimum.include?('external_account')
|
37
|
+
assert item.additional.include?('legal_entity.verification.document')
|
38
|
+
assert item.additional.kind_of?(Array)
|
39
|
+
assert item.minimum.kind_of?(Array)
|
40
|
+
}
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
data/test/test_data.rb
CHANGED
@@ -164,7 +164,6 @@ module Stripe
|
|
164
164
|
}
|
165
165
|
end
|
166
166
|
|
167
|
-
|
168
167
|
def make_dispute(params={})
|
169
168
|
id = params[:id] || 'dp_test_dispute'
|
170
169
|
{
|
@@ -672,5 +671,62 @@ module Stripe
|
|
672
671
|
:charge => make_charge,
|
673
672
|
}).merge(params)
|
674
673
|
end
|
674
|
+
|
675
|
+
def country_spec_array
|
676
|
+
{
|
677
|
+
:object => "list",
|
678
|
+
:url => "/v1/country_specs",
|
679
|
+
:data => [
|
680
|
+
make_country_spec,
|
681
|
+
make_country_spec,
|
682
|
+
make_country_spec,
|
683
|
+
]
|
684
|
+
}
|
685
|
+
end
|
686
|
+
|
687
|
+
def make_country_spec(params={})
|
688
|
+
{
|
689
|
+
:id => "US",
|
690
|
+
:object => "country_spec",
|
691
|
+
:supported_bank_account_currencies => {
|
692
|
+
:usd => ["US"]
|
693
|
+
},
|
694
|
+
:supported_payment_currencies => [
|
695
|
+
"usd", "aed", "afn", "all"
|
696
|
+
],
|
697
|
+
:supported_payment_methods => [
|
698
|
+
"alipay",
|
699
|
+
"card",
|
700
|
+
"stripe"
|
701
|
+
],
|
702
|
+
:verification_fields =>
|
703
|
+
{
|
704
|
+
:individual => {
|
705
|
+
:minimum => [
|
706
|
+
"external_account",
|
707
|
+
"legal_entity.address.city",
|
708
|
+
"tos_acceptance.date",
|
709
|
+
"tos_acceptance.ip"
|
710
|
+
],
|
711
|
+
:additional => [
|
712
|
+
"legal_entity.personal_id_number",
|
713
|
+
"legal_entity.verification.document"
|
714
|
+
]
|
715
|
+
},
|
716
|
+
:company => {
|
717
|
+
:minimum => [
|
718
|
+
"external_account",
|
719
|
+
"legal_entity.address.city",
|
720
|
+
"legal_entity.address.line1",
|
721
|
+
"tos_acceptance.ip"
|
722
|
+
],
|
723
|
+
:additional => [
|
724
|
+
"legal_entity.personal_id_number",
|
725
|
+
"legal_entity.verification.document"
|
726
|
+
]
|
727
|
+
}
|
728
|
+
}
|
729
|
+
}.merge(params)
|
730
|
+
end
|
675
731
|
end
|
676
732
|
end
|
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.36.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-02-
|
12
|
+
date: 2016-02-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|
@@ -178,6 +178,7 @@ files:
|
|
178
178
|
- lib/stripe/bitcoin_transaction.rb
|
179
179
|
- lib/stripe/card.rb
|
180
180
|
- lib/stripe/charge.rb
|
181
|
+
- lib/stripe/country_spec.rb
|
181
182
|
- lib/stripe/coupon.rb
|
182
183
|
- lib/stripe/customer.rb
|
183
184
|
- lib/stripe/dispute.rb
|
@@ -218,6 +219,7 @@ files:
|
|
218
219
|
- test/stripe/bitcoin_transaction_test.rb
|
219
220
|
- test/stripe/charge_refund_test.rb
|
220
221
|
- test/stripe/charge_test.rb
|
222
|
+
- test/stripe/country_spec_test.rb
|
221
223
|
- test/stripe/coupon_test.rb
|
222
224
|
- test/stripe/customer_card_test.rb
|
223
225
|
- test/stripe/customer_test.rb
|
@@ -274,6 +276,7 @@ test_files:
|
|
274
276
|
- test/stripe/bitcoin_transaction_test.rb
|
275
277
|
- test/stripe/charge_refund_test.rb
|
276
278
|
- test/stripe/charge_test.rb
|
279
|
+
- test/stripe/country_spec_test.rb
|
277
280
|
- test/stripe/coupon_test.rb
|
278
281
|
- test/stripe/customer_card_test.rb
|
279
282
|
- test/stripe/customer_test.rb
|