stripe 4.23.0 → 4.24.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
  SHA256:
3
- metadata.gz: 971d8e2630db1ab5e7317a3ae4320efc9b40dcdbf706995bb930e955669088fa
4
- data.tar.gz: 73a6a25b4aa3de37baa3dc4092d3c56e930a857250b8a7ebce8843511022eb3f
3
+ metadata.gz: b2abaedad94afb640e2ee4b39c6a825a2aa8f234d8ce5d64542d73cae0c46c92
4
+ data.tar.gz: c5c0f7c81270700f7abbf8adcf329268daaff092c8c4892c500ff06c6a1e2dc4
5
5
  SHA512:
6
- metadata.gz: 021f1c534b92cea616d141a076474308717052fa2e78cf09ceb7ba8f7e549c5cf4fced0f609485a2876497a1a008d9f32cf362b5ae8d9def38b2ae96d8306b25
7
- data.tar.gz: 2379e1195b665550d267aefe2bf9f0e24821503dc6d49775576069035feee3316ea7f673c6b57846f58ba222264e29c888376484a5220490095d97213cca2bf6
6
+ metadata.gz: 4f3955ca4759861c3f5d2bd6c78d661239886e44d3cf25939185dc0cc1846ded39c19c71f15c1c71295d686d2cab2d3b5937c11cf0dc9364dbca9289718f02b7
7
+ data.tar.gz: 9d3d78053ccb35930ebf2cb7da3b4fe986e357599d53fe685b63f79799e26707354eac68b8ce70b0958ddce0375865f67158c1c843c7bd74d28f4b8f8fd3a56c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.24.0 - 2019-08-12
4
+ * [#825](https://github.com/stripe/stripe-ruby/pull/825) Add `SubscriptionItem.create_usage_record` method
5
+ - This release also removed the `SubscriptionSchedule.revisions` method. This should have been included in the previous release (4.23.0)
6
+
3
7
  ## 4.23.0 - 2019-08-09
4
8
  * [#824](https://github.com/stripe/stripe-ruby/pull/824) Remove SubscriptionScheduleRevision
5
9
  - This is technically a breaking change. We've chosen to release it as a minor vesion bump because the associated API is unused.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.23.0
1
+ 4.24.0
@@ -6,9 +6,12 @@ module Stripe
6
6
  include Stripe::APIOperations::Delete
7
7
  extend Stripe::APIOperations::List
8
8
  include Stripe::APIOperations::Save
9
+ extend Stripe::APIOperations::NestedResource
9
10
 
10
11
  OBJECT_NAME = "subscription_item".freeze
11
12
 
13
+ nested_resource_class_methods :usage_record, operations: %i[create]
14
+
12
15
  def usage_record_summaries(params = {}, opts = {})
13
16
  resp, opts = request(:get, resource_url + "/usage_record_summaries", params, opts)
14
17
  Util.convert_to_stripe_object(resp.data, opts)
@@ -28,10 +28,5 @@ module Stripe
28
28
  opts: opts
29
29
  )
30
30
  end
31
-
32
- def revisions(params = {}, opts = {})
33
- resp, opts = request(:get, resource_url + "/revisions", params, opts)
34
- Util.convert_to_stripe_object(resp.data, opts)
35
- end
36
31
  end
37
32
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
- VERSION = "4.23.0".freeze
4
+ VERSION = "4.24.0".freeze
5
5
  end
@@ -59,5 +59,17 @@ module Stripe
59
59
  assert item.is_a?(Stripe::SubscriptionItem)
60
60
  end
61
61
  end
62
+
63
+ context "#create_usage_record" do
64
+ should "create a usage record" do
65
+ Stripe::SubscriptionItem.create_usage_record(
66
+ "si_123",
67
+ quantity: 5000,
68
+ timestamp: Time.now.to_i,
69
+ action: "increment"
70
+ )
71
+ assert_requested :post, "#{Stripe.api_base}/v1/subscription_items/si_123/usage_records"
72
+ end
73
+ end
62
74
  end
63
75
  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: 4.23.0
4
+ version: 4.24.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-10 00:00:00.000000000 Z
11
+ date: 2019-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday