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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ba258c6ce34968c0caaadec16763905ff632084a
4
- data.tar.gz: d80c2169b9ae78b37236a3124419679c7a2a93f7
3
+ metadata.gz: f34746bb3a826f64477e8dff5c616665144fe56d
4
+ data.tar.gz: 82e4663d7d8b3392ed36b19969d1ada2afb05115
5
5
  SHA512:
6
- metadata.gz: dcf9630e2a0cf7e77bd21a933c00f91808418913a87b367ba7d4e19add2e9fda9b9632d6c111e9e9fa8ca1b575d75f1f1c44888dcf814017e14c46672b4cd67e
7
- data.tar.gz: 1e28646f0b94e1c56d7acd5440d17707b1b247e2c1a593595520ee650a6de08a402548e8c3c9f9d0866ba0d8ac2b02740f84faf4f111042604caaccd33810ee7
6
+ metadata.gz: bae160dd906dcd1e27be1aae953c53e39697ecf17c61baf75637a3e3b725ebc96cdadabc5c5c2025b5f940aff1f1e8952dff9314adc185754557101795a0f691
7
+ data.tar.gz: ffa399f6f15e8e166995855c370629969986ddfee49b8a36b8126248be40b01a04c8135a83bc23b284f0b279b416f7676a731e08b498c206aadf037996d593d8
@@ -1,3 +1,7 @@
1
+ === 1.36.0 2016-02-08
2
+
3
+ * Add `CountrySpec` model for looking up country payment information
4
+
1
5
  === 1.35.1 2016-02-03
2
6
 
3
7
  * Add compatibility layer for old API versions on `Charge#refund`
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.35.1
1
+ 1.36.0
@@ -32,6 +32,7 @@ require 'stripe/customer'
32
32
  require 'stripe/invoice'
33
33
  require 'stripe/invoice_item'
34
34
  require 'stripe/charge'
35
+ require 'stripe/country_spec'
35
36
  require 'stripe/plan'
36
37
  require 'stripe/file_upload'
37
38
  require 'stripe/coupon'
@@ -0,0 +1,9 @@
1
+ module Stripe
2
+ class CountrySpec < APIResource
3
+ extend Stripe::APIOperations::List
4
+
5
+ def self.url
6
+ '/v1/country_specs'
7
+ end
8
+ end
9
+ end
@@ -30,6 +30,7 @@ module Stripe
30
30
  'bank_account' => BankAccount,
31
31
  'card' => Card,
32
32
  'charge' => Charge,
33
+ 'country_spec' => CountrySpec,
33
34
  'coupon' => Coupon,
34
35
  'customer' => Customer,
35
36
  'event' => Event,
@@ -1,3 +1,3 @@
1
1
  module Stripe
2
- VERSION = '1.35.1'
2
+ VERSION = '1.36.0'
3
3
  end
@@ -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
@@ -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.35.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-03 00:00:00.000000000 Z
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