stripe 3.9.2 → 3.10.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: f9f926c6f2c902aefeba870c1c7b3bdfac27b394a391096e17c0834d5016d3d1
4
- data.tar.gz: 3e10d1311e66dcc34c67e3c75316cf6979725e6b05f362058a8138ae05d2fc70
2
+ SHA1:
3
+ metadata.gz: 2e7b5bea101451f3c7a05b79a5b7dbad7e02d2a7
4
+ data.tar.gz: efc7af8e83a025865095472b00130d9720ad5575
5
5
  SHA512:
6
- metadata.gz: 510a4b49893fc8ee4b7c056b4f4bcd64d17381beb83c1cb58618401353530533b7fec730be4af96d1d44f72e03b13dee69667132ea6b51acc8475066cc618a78
7
- data.tar.gz: cd6192e48881e068b8e9fc70fd77a13decb94fcffd2016710b5d11b247515c33852e0fe2bd2afb41926419e8222611dd4f272678b8b5b0176312bb81e0a1cc32
6
+ metadata.gz: 826e1e1a0883d6a103da74ea2b3221ab55d786772e616038d05f2c7a38981ba45e2a9b14885358fef978cdf9aca0da8187f5c6da09d4c416e212e3c38c9b742f
7
+ data.tar.gz: 5a79ab66f87303e6ff5b06dc7999b6ede34ef2ee23126f47c318d25e37f51ba10551e09d3efe54d9811b5d8dfdc52d37c75b58024eb1d3c8979f8f85a8fe7371
@@ -38,7 +38,7 @@ Metrics/MethodLength:
38
38
  # Offense count: 1
39
39
  # Configuration parameters: CountComments.
40
40
  Metrics/ModuleLength:
41
- Max: 304
41
+ Max: 305
42
42
 
43
43
  # Offense count: 5
44
44
  # Configuration parameters: CountKeywordArgs.
@@ -16,7 +16,7 @@ sudo: false
16
16
 
17
17
  env:
18
18
  global:
19
- - STRIPE_MOCK_VERSION=0.4.0
19
+ - STRIPE_MOCK_VERSION=0.8.0
20
20
 
21
21
  cache:
22
22
  directories:
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.10.0 - 2018-02-21
4
+ * [#627](https://github.com/stripe/stripe-ruby/pull/627) Add support for topups
5
+
3
6
  ## 3.9.2 - 2018-02-12
4
7
  * [#625](https://github.com/stripe/stripe-ruby/pull/625) Skip calling `to_hash` for `nil`
5
8
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.9.2
1
+ 3.10.0
@@ -74,6 +74,7 @@ require "stripe/subscription"
74
74
  require "stripe/subscription_item"
75
75
  require "stripe/three_d_secure"
76
76
  require "stripe/token"
77
+ require "stripe/topup"
77
78
  require "stripe/transfer"
78
79
 
79
80
  # OAuth
@@ -0,0 +1,9 @@
1
+ module Stripe
2
+ class Topup < APIResource
3
+ extend Stripe::APIOperations::List
4
+ extend Stripe::APIOperations::Create
5
+ include Stripe::APIOperations::Save
6
+
7
+ OBJECT_NAME = "topup".freeze
8
+ end
9
+ end
@@ -83,6 +83,7 @@ module Stripe
83
83
  SubscriptionItem::OBJECT_NAME => SubscriptionItem,
84
84
  ThreeDSecure::OBJECT_NAME => ThreeDSecure,
85
85
  Token::OBJECT_NAME => Token,
86
+ Topup::OBJECT_NAME => Topup,
86
87
  Transfer::OBJECT_NAME => Transfer,
87
88
  }
88
89
  end
@@ -1,3 +1,3 @@
1
1
  module Stripe
2
- VERSION = "3.9.2".freeze
2
+ VERSION = "3.10.0".freeze
3
3
  end
@@ -16,10 +16,12 @@ module Stripe
16
16
  end
17
17
 
18
18
  should "be creatable" do
19
- _ = Stripe::Product.create(
20
- name: "My Product"
19
+ product = Stripe::Product.create(
20
+ name: "My Product",
21
+ type: "good"
21
22
  )
22
23
  assert_requested :post, "#{Stripe.api_base}/v1/products"
24
+ assert product.is_a?(Stripe::Product)
23
25
  end
24
26
 
25
27
  should "be saveable" do
@@ -0,0 +1,43 @@
1
+ require File.expand_path("../../test_helper", __FILE__)
2
+
3
+ module Stripe
4
+ class TopupTest < Test::Unit::TestCase
5
+ should "be listable" do
6
+ topups = Stripe::Topup.list
7
+ assert_requested :get, "#{Stripe.api_base}/v1/topups"
8
+ assert topups.data.is_a?(Array)
9
+ assert topups.data[0].is_a?(Stripe::Topup)
10
+ end
11
+
12
+ should "be retrievable" do
13
+ topup = Stripe::Topup.retrieve("tu_123")
14
+ assert_requested :get, "#{Stripe.api_base}/v1/topups/tu_123"
15
+ assert topup.is_a?(Stripe::Topup)
16
+ end
17
+
18
+ should "be creatable" do
19
+ topup = Stripe::Topup.create(
20
+ amount: 100,
21
+ currency: "USD",
22
+ source: "src_123",
23
+ description: "description",
24
+ statement_descriptor: "statement descriptor"
25
+ )
26
+ assert_requested :post, "#{Stripe.api_base}/v1/topups"
27
+ assert topup.is_a?(Stripe::Topup)
28
+ end
29
+
30
+ should "be saveable" do
31
+ topup = Stripe::Topup.retrieve("tu_123")
32
+ topup.metadata["key"] = "value"
33
+ topup.save
34
+ assert_requested :post, "#{Stripe.api_base}/v1/topups/#{topup.id}"
35
+ end
36
+
37
+ should "be updateable" do
38
+ topup = Stripe::Topup.update("tu_123", metadata: { foo: "bar" })
39
+ assert_requested :post, "#{Stripe.api_base}/v1/topups/tu_123"
40
+ assert topup.is_a?(Stripe::Topup)
41
+ end
42
+ end
43
+ 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: 3.9.2
4
+ version: 3.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-12 00:00:00.000000000 Z
11
+ date: 2018-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -103,6 +103,7 @@ files:
103
103
  - lib/stripe/subscription_item.rb
104
104
  - lib/stripe/three_d_secure.rb
105
105
  - lib/stripe/token.rb
106
+ - lib/stripe/topup.rb
106
107
  - lib/stripe/transfer.rb
107
108
  - lib/stripe/util.rb
108
109
  - lib/stripe/version.rb
@@ -155,6 +156,7 @@ files:
155
156
  - test/stripe/subscription_item_test.rb
156
157
  - test/stripe/subscription_test.rb
157
158
  - test/stripe/three_d_secure_test.rb
159
+ - test/stripe/topup_test.rb
158
160
  - test/stripe/transfer_reversals_operations_test.rb
159
161
  - test/stripe/transfer_test.rb
160
162
  - test/stripe/util_test.rb
@@ -182,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
184
  version: '0'
183
185
  requirements: []
184
186
  rubyforge_project:
185
- rubygems_version: 2.7.4
187
+ rubygems_version: 2.6.14
186
188
  signing_key:
187
189
  specification_version: 4
188
190
  summary: Ruby bindings for the Stripe API
@@ -234,6 +236,7 @@ test_files:
234
236
  - test/stripe/subscription_item_test.rb
235
237
  - test/stripe/subscription_test.rb
236
238
  - test/stripe/three_d_secure_test.rb
239
+ - test/stripe/topup_test.rb
237
240
  - test/stripe/transfer_reversals_operations_test.rb
238
241
  - test/stripe/transfer_test.rb
239
242
  - test/stripe/util_test.rb