stripe 3.22.0 → 3.23.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
- SHA1:
3
- metadata.gz: 20dbcf02b1a4654d1ec60751b52efe4583e42ac0
4
- data.tar.gz: 648b11cf6f57fb6c71609593553b978954fef2d2
2
+ SHA256:
3
+ metadata.gz: b72ba017e53f1ce4d5421b86d2f4f061b24e5c3db066198d822a4ccd613f20c3
4
+ data.tar.gz: 91b5e733079469a1e15ab26ecc3524ac04d01661682121eb24dc8296b99e66e6
5
5
  SHA512:
6
- metadata.gz: 7db7998300c64ccaebc98f5fe66ec5a93416652b6bd2c5d98efc7df5f353a92af2314fe8621fd6c6661800b456b208f15e9b1da4de2893b0ca95c6de5abc2574
7
- data.tar.gz: e49a1de7f488e0b94c0ce0d58b7e427f78c3fd99112bf75df55f3a676411723df2c48e4b44b2d3348a57af8992ba69b97343da02459f51b4c94aa0ea09291eea
6
+ metadata.gz: 2823396ffb1a8afe9c1531fa9ea1b2d02638c2eedfc78d51cf846adec44bba12a587d756271c08424855c85b6ff9ff2af8666721788ab988339889d0b3f5b2d1
7
+ data.tar.gz: 9f5a2b11eb8d5c30149001430092411ff830f8dc5b0fd3dad2c3ec064fdc035ecb0c2774e8dbd2b33b05fbfb437049a0af34b79a92095cfd8ee09a4ae681be97
@@ -18,7 +18,7 @@ sudo: false
18
18
  env:
19
19
  global:
20
20
  # If changing this number, please also change it in `test/test_helper.rb`.
21
- - STRIPE_MOCK_VERSION=0.25.0
21
+ - STRIPE_MOCK_VERSION=0.26.0
22
22
 
23
23
  cache:
24
24
  directories:
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.23.0 - 2018-08-23
4
+ * [#676](https://github.com/stripe/stripe-ruby/pull/676) Add support for usage record summaries
5
+
3
6
  ## 3.22.0 - 2018-08-15
4
7
  * [#674](https://github.com/stripe/stripe-ruby/pull/674) Use integer-indexed encoding for all arrays
5
8
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.22.0
1
+ 3.23.0
@@ -89,6 +89,7 @@ require "stripe/token"
89
89
  require "stripe/topup"
90
90
  require "stripe/transfer"
91
91
  require "stripe/usage_record"
92
+ require "stripe/usage_record_summary"
92
93
 
93
94
  # OAuth
94
95
  require "stripe/oauth"
@@ -8,5 +8,10 @@ module Stripe
8
8
  include Stripe::APIOperations::Save
9
9
 
10
10
  OBJECT_NAME = "subscription_item".freeze
11
+
12
+ def usage_record_summaries(params = {}, opts = {})
13
+ resp, opts = request(:get, resource_url + "/usage_record_summaries", params, Util.normalize_opts(opts))
14
+ Util.convert_to_stripe_object(resp.data, opts)
15
+ end
11
16
  end
12
17
  end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stripe
4
+ class UsageRecordSummary < StripeObject
5
+ OBJECT_NAME = "usage_record_summary".freeze
6
+ end
7
+ end
@@ -98,6 +98,7 @@ module Stripe
98
98
  Topup::OBJECT_NAME => Topup,
99
99
  Transfer::OBJECT_NAME => Transfer,
100
100
  UsageRecord::OBJECT_NAME => UsageRecord,
101
+ UsageRecordSummary::OBJECT_NAME => UsageRecordSummary,
101
102
  }
102
103
  end
103
104
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
- VERSION = "3.22.0".freeze
4
+ VERSION = "3.23.0".freeze
5
5
  end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require File.expand_path("../../test_helper", __FILE__)
4
+
5
+ module Stripe
6
+ class UsageRecordSummaryTest < Test::Unit::TestCase
7
+ setup do
8
+ @sub_item = Stripe::SubscriptionItem.retrieve("si_123")
9
+ end
10
+
11
+ should "be listable" do
12
+ transactions = @sub_item.usage_record_summaries
13
+
14
+ assert_requested :get, "#{Stripe.api_base}/v1/subscription_items/#{@sub_item.id}/usage_record_summaries"
15
+ assert transactions.data.is_a?(Array)
16
+ assert transactions.first.is_a?(Stripe::UsageRecordSummary)
17
+ end
18
+ end
19
+ end
@@ -16,7 +16,7 @@ PROJECT_ROOT = File.expand_path("../../", __FILE__)
16
16
  require File.expand_path("../test_data", __FILE__)
17
17
 
18
18
  # If changing this number, please also change it in `.travis.yml`.
19
- MOCK_MINIMUM_VERSION = "0.25.0".freeze
19
+ MOCK_MINIMUM_VERSION = "0.26.0".freeze
20
20
  MOCK_PORT = ENV["STRIPE_MOCK_PORT"] || 12_111
21
21
 
22
22
  # Disable all real network connections except those that are outgoing to
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.22.0
4
+ version: 3.23.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-08-15 00:00:00.000000000 Z
11
+ date: 2018-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -116,6 +116,7 @@ files:
116
116
  - lib/stripe/topup.rb
117
117
  - lib/stripe/transfer.rb
118
118
  - lib/stripe/usage_record.rb
119
+ - lib/stripe/usage_record_summary.rb
119
120
  - lib/stripe/util.rb
120
121
  - lib/stripe/version.rb
121
122
  - lib/stripe/webhook.rb
@@ -179,6 +180,7 @@ files:
179
180
  - test/stripe/topup_test.rb
180
181
  - test/stripe/transfer_reversals_operations_test.rb
181
182
  - test/stripe/transfer_test.rb
183
+ - test/stripe/usage_record_summary_test.rb
182
184
  - test/stripe/usage_record_test.rb
183
185
  - test/stripe/util_test.rb
184
186
  - test/stripe/webhook_test.rb
@@ -205,7 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
205
207
  version: '0'
206
208
  requirements: []
207
209
  rubyforge_project:
208
- rubygems_version: 2.6.14
210
+ rubygems_version: 2.7.7
209
211
  signing_key:
210
212
  specification_version: 4
211
213
  summary: Ruby bindings for the Stripe API
@@ -269,6 +271,7 @@ test_files:
269
271
  - test/stripe/topup_test.rb
270
272
  - test/stripe/transfer_reversals_operations_test.rb
271
273
  - test/stripe/transfer_test.rb
274
+ - test/stripe/usage_record_summary_test.rb
272
275
  - test/stripe/usage_record_test.rb
273
276
  - test/stripe/util_test.rb
274
277
  - test/stripe/webhook_test.rb