stripe 1.54.0 → 1.55.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: 2e8c4b76709e3ec68cbde150b1a649435e1e1f29
4
- data.tar.gz: 702b785a0995a4eb697a97ff3b6699c54e139d37
3
+ metadata.gz: acc0d005430ccecaa1ee91d83f1fa12878953539
4
+ data.tar.gz: 8e0a9f98e8931de91bda3da3f3bb6e506772c7e6
5
5
  SHA512:
6
- metadata.gz: e00542306c9b283d4a982fc5cdfce20e64f955517cca663baa0c2f6f5e9c0da7851f8895b9fa71c447e7fdfa785faa465cec2a930ec0064f3842bfbbcc9a247d
7
- data.tar.gz: 5dd42345b9e9722cb4512010f6cffa56bac39c9ddcb4acfff228135fd3d4ac44c3098ca8f25abc7f371472a377c16783fad160ca545b454f23447ef3e65d1025
6
+ metadata.gz: 9ebb54c179ef98c86a461fcd98d354faf8ffaae89e94e910fc372f12f7657ba1213dca4d035e7448a8a5231ca5836ce8d94d59a220c7aeb71b9aa2199b6b4833
7
+ data.tar.gz: 8076a031bf92dd1daba197cd4f8a8557ae1c2a1d326f4d2b7541a24ce09e323091527c0b5fb60b45757e066c022a70ca38882c7dfc3203d41658fc5813863265
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ === 1.55.0 2016-09-15
2
+
3
+ * Add support for Apple Pay domains
4
+
1
5
  === 1.54.0 2016-09-01
2
6
 
3
7
  * Whitelist errors that should be retried; scope to known socket and HTTP errors
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.54.0
1
+ 1.55.0
data/lib/stripe.rb CHANGED
@@ -57,6 +57,7 @@ require 'stripe/order_return'
57
57
  require 'stripe/alipay_account'
58
58
  require 'stripe/three_d_secure'
59
59
  require 'stripe/source'
60
+ require 'stripe/apple_pay_domain'
60
61
 
61
62
  # Errors
62
63
  require 'stripe/errors/stripe_error'
@@ -0,0 +1,12 @@
1
+ module Stripe
2
+ # Domains registered for Apple Pay on the Web
3
+ class ApplePayDomain < APIResource
4
+ extend Stripe::APIOperations::Create
5
+ include Stripe::APIOperations::Delete
6
+ extend Stripe::APIOperations::List
7
+
8
+ def self.resource_url
9
+ '/v1/apple_pay/domains'
10
+ end
11
+ end
12
+ end
data/lib/stripe/util.rb CHANGED
@@ -54,6 +54,7 @@ module Stripe
54
54
  'order' => Order,
55
55
  'order_return' => OrderReturn,
56
56
  'three_d_secure' => ThreeDSecure,
57
+ 'apple_pay_domain' => ApplePayDomain,
57
58
  }
58
59
  end
59
60
 
@@ -1,3 +1,3 @@
1
1
  module Stripe
2
- VERSION = '1.54.0'
2
+ VERSION = '1.55.0'
3
3
  end
@@ -0,0 +1,34 @@
1
+ require File.expand_path('../../test_helper', __FILE__)
2
+
3
+ module Stripe
4
+ class ApplePayDomainTest < Test::Unit::TestCase
5
+ should "create should return a new Apple Pay domain" do
6
+ @mock.expects(:post).once
7
+ .with('https://api.stripe.com/v1/apple_pay/domains', nil, '')
8
+ .returns(make_response(make_apple_pay_domain))
9
+ d = Stripe::ApplePayDomain.create
10
+ assert_equal "apwc_test_domain", d.id
11
+ end
12
+
13
+ should "domains should be deletable" do
14
+ @mock.expects(:get).once
15
+ .with('https://api.stripe.com/v1/apple_pay/domains/apwc_test_domain', nil, nil)
16
+ .returns(make_response(make_apple_pay_domain))
17
+ @mock.expects(:delete).once.returns(make_response(make_apple_pay_domain(:deleted => true)))
18
+ domain = Stripe::ApplePayDomain.retrieve('apwc_test_domain')
19
+ domain.delete
20
+ assert domain.deleted
21
+ end
22
+
23
+ should "domains should be listable" do
24
+ @mock.expects(:get).once.with('https://api.stripe.com/v1/apple_pay/domains', nil, nil)
25
+ .returns(make_response(make_apple_pay_domain_array))
26
+ domains = Stripe::ApplePayDomain.list
27
+ assert domains.data.kind_of?(Array)
28
+ assert_equal 3, domains.data.length
29
+ domains.each do |domain|
30
+ assert domain.kind_of?(Stripe::ApplePayDomain)
31
+ end
32
+ end
33
+ end
34
+ end
data/test/test_data.rb CHANGED
@@ -848,5 +848,26 @@ module Stripe
848
848
  :status => 'succeeded',
849
849
  }.merge(params)
850
850
  end
851
+
852
+ def make_apple_pay_domain(params={})
853
+ {
854
+ :id => "apwc_test_domain",
855
+ :object => "apple_pay_domain",
856
+ :domain_name => "test.com",
857
+ :livemode => false
858
+ }.merge(params)
859
+ end
860
+
861
+ def make_apple_pay_domain_array
862
+ {
863
+ :object => "list",
864
+ :resource_url => "/v1/apple_pay/domains",
865
+ :data => [
866
+ make_apple_pay_domain,
867
+ make_apple_pay_domain,
868
+ make_apple_pay_domain
869
+ ]
870
+ }
871
+ end
851
872
  end
852
873
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stripe
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.54.0
4
+ version: 1.55.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-01 00:00:00.000000000 Z
11
+ date: 2016-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -58,6 +58,7 @@ files:
58
58
  - lib/stripe/api_operations/request.rb
59
59
  - lib/stripe/api_operations/save.rb
60
60
  - lib/stripe/api_resource.rb
61
+ - lib/stripe/apple_pay_domain.rb
61
62
  - lib/stripe/application_fee.rb
62
63
  - lib/stripe/application_fee_refund.rb
63
64
  - lib/stripe/balance.rb
@@ -105,6 +106,7 @@ files:
105
106
  - test/stripe/alipay_account_test.rb
106
107
  - test/stripe/api_operations_test.rb
107
108
  - test/stripe/api_resource_test.rb
109
+ - test/stripe/apple_pay_domain_test.rb
108
110
  - test/stripe/application_fee_refund_test.rb
109
111
  - test/stripe/application_fee_test.rb
110
112
  - test/stripe/balance_test.rb
@@ -170,6 +172,7 @@ test_files:
170
172
  - test/stripe/alipay_account_test.rb
171
173
  - test/stripe/api_operations_test.rb
172
174
  - test/stripe/api_resource_test.rb
175
+ - test/stripe/apple_pay_domain_test.rb
173
176
  - test/stripe/application_fee_refund_test.rb
174
177
  - test/stripe/application_fee_test.rb
175
178
  - test/stripe/balance_test.rb