stripe 10.13.0 → 10.14.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: 97c811b2b459b17181407a3623e59762e40d4673adc0fd73b5be8ebc6b6dc6e0
4
- data.tar.gz: a548789eb483613398223cfb9edf9113f8c30fc11bb8e75b16111ea7c6844ced
3
+ metadata.gz: 4e005b6f71d3104349ec84fd1828b46bd94131b49a746233231654a682da91a1
4
+ data.tar.gz: c04f1e21e02e4a615a6477cddd1dc11130998ffcc90d2afc66ad73131e435cfa
5
5
  SHA512:
6
- metadata.gz: 03d491204d0bc879e91771025e8755fdc65b927b3f6d49bdd88831d994d2ae5db7865d8d1b79b64969369cf473fb46df87920d97fe60a239a9e5c2e660d660c6
7
- data.tar.gz: 32638e41755069eacce29e7a4a2e2e4847d7b9c890f868eb15eb1ad254c33d4b802724769010df046c50f239b30ff8a72bfe34824c3ee13dfe940b223e3571a3
6
+ metadata.gz: 8f56042df34d499b9fb85a4e8fba37a9a048cc9830caad148442fd629d34c943c5c5ea425e066007625a6bb8124de7cd53223a511d09fd495bba068038b2375d
7
+ data.tar.gz: 175595f2208cfdb6c952d4b163e2e86121e0bd0fe1afc0164368f5cbf72e471a46a0ff721274c1e1fd8de329c71f91029790573a99a4b94a782b22be16fa585e
data/CHANGELOG.md CHANGED
@@ -1,4 +1,10 @@
1
1
  # Changelog
2
+ ## 10.14.0 - 2024-03-28
3
+ * [#1369](https://github.com/stripe/stripe-ruby/pull/1369) Update generated code
4
+ * Add support for new resources `Billing.MeterEventAdjustment`, `Billing.MeterEvent`, and `Billing.Meter`
5
+ * Add support for `create`, `deactivate`, `list`, `reactivate`, `retrieve`, and `update` methods on resource `Meter`
6
+ * Add support for `create` method on resources `MeterEventAdjustment` and `MeterEvent`
7
+
2
8
  ## 10.13.0 - 2024-03-21
3
9
  * [#1367](https://github.com/stripe/stripe-ruby/pull/1367) Update generated code
4
10
  * Add support for new resources `ConfirmationToken` and `Forwarding.Request`
data/OPENAPI_VERSION CHANGED
@@ -1 +1 @@
1
- v889
1
+ v908
data/VERSION CHANGED
@@ -1 +1 @@
1
- 10.13.0
1
+ 10.14.0
@@ -23,6 +23,10 @@ module Stripe
23
23
  Balance.object_name => Balance,
24
24
  BalanceTransaction.object_name => BalanceTransaction,
25
25
  BankAccount.object_name => BankAccount,
26
+ Billing::Meter.object_name => Billing::Meter,
27
+ Billing::MeterEvent.object_name => Billing::MeterEvent,
28
+ Billing::MeterEventAdjustment.object_name => Billing::MeterEventAdjustment,
29
+ Billing::MeterEventSummary.object_name => Billing::MeterEventSummary,
26
30
  BillingPortal::Configuration.object_name => BillingPortal::Configuration,
27
31
  BillingPortal::Session.object_name => BillingPortal::Session,
28
32
  Capability.object_name => Capability,
@@ -0,0 +1,83 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Billing
6
+ # A billing meter is a resource that allows you to track usage of a particular event. For example, you might create a billing meter to track the number of API calls made by a particular user. You can then use the billing meter to charge the user for the number of API calls they make.
7
+ class Meter < APIResource
8
+ extend Stripe::APIOperations::Create
9
+ extend Stripe::APIOperations::List
10
+ extend Stripe::APIOperations::NestedResource
11
+ include Stripe::APIOperations::Save
12
+
13
+ OBJECT_NAME = "billing.meter"
14
+ def self.object_name
15
+ "billing.meter"
16
+ end
17
+
18
+ nested_resource_class_methods :event_summary,
19
+ operations: %i[list],
20
+ resource_plural: "event_summaries"
21
+
22
+ # Creates a billing meter
23
+ def self.create(params = {}, opts = {})
24
+ request_stripe_object(method: :post, path: "/v1/billing/meters", params: params, opts: opts)
25
+ end
26
+
27
+ # Deactivates a billing meter
28
+ def deactivate(params = {}, opts = {})
29
+ request_stripe_object(
30
+ method: :post,
31
+ path: format("/v1/billing/meters/%<id>s/deactivate", { id: CGI.escape(self["id"]) }),
32
+ params: params,
33
+ opts: opts
34
+ )
35
+ end
36
+
37
+ # Deactivates a billing meter
38
+ def self.deactivate(id, params = {}, opts = {})
39
+ request_stripe_object(
40
+ method: :post,
41
+ path: format("/v1/billing/meters/%<id>s/deactivate", { id: CGI.escape(id) }),
42
+ params: params,
43
+ opts: opts
44
+ )
45
+ end
46
+
47
+ # Retrieve a list of billing meters.
48
+ def self.list(filters = {}, opts = {})
49
+ request_stripe_object(method: :get, path: "/v1/billing/meters", params: filters, opts: opts)
50
+ end
51
+
52
+ # Reactivates a billing meter
53
+ def reactivate(params = {}, opts = {})
54
+ request_stripe_object(
55
+ method: :post,
56
+ path: format("/v1/billing/meters/%<id>s/reactivate", { id: CGI.escape(self["id"]) }),
57
+ params: params,
58
+ opts: opts
59
+ )
60
+ end
61
+
62
+ # Reactivates a billing meter
63
+ def self.reactivate(id, params = {}, opts = {})
64
+ request_stripe_object(
65
+ method: :post,
66
+ path: format("/v1/billing/meters/%<id>s/reactivate", { id: CGI.escape(id) }),
67
+ params: params,
68
+ opts: opts
69
+ )
70
+ end
71
+
72
+ # Updates a billing meter
73
+ def self.update(id, params = {}, opts = {})
74
+ request_stripe_object(
75
+ method: :post,
76
+ path: format("/v1/billing/meters/%<id>s", { id: CGI.escape(id) }),
77
+ params: params,
78
+ opts: opts
79
+ )
80
+ end
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,27 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Billing
6
+ # A billing meter event represents a customer's usage of a product. Meter events are used to bill a customer based on their usage.
7
+ # Meter events are associated with billing meters, which define the shape of the event's payload and how those events are aggregated for billing.
8
+ class MeterEvent < APIResource
9
+ extend Stripe::APIOperations::Create
10
+
11
+ OBJECT_NAME = "billing.meter_event"
12
+ def self.object_name
13
+ "billing.meter_event"
14
+ end
15
+
16
+ # Creates a billing meter event
17
+ def self.create(params = {}, opts = {})
18
+ request_stripe_object(
19
+ method: :post,
20
+ path: "/v1/billing/meter_events",
21
+ params: params,
22
+ opts: opts
23
+ )
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,26 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Billing
6
+ # A billing meter event adjustment represents the status of a meter event adjustment.
7
+ class MeterEventAdjustment < APIResource
8
+ extend Stripe::APIOperations::Create
9
+
10
+ OBJECT_NAME = "billing.meter_event_adjustment"
11
+ def self.object_name
12
+ "billing.meter_event_adjustment"
13
+ end
14
+
15
+ # Creates a billing meter event adjustment
16
+ def self.create(params = {}, opts = {})
17
+ request_stripe_object(
18
+ method: :post,
19
+ path: "/v1/billing/meter_event_adjustments",
20
+ params: params,
21
+ opts: opts
22
+ )
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,15 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Billing
6
+ # A billing meter event summary represents an aggregated view of a customer's billing meter events within a specified timeframe. It indicates how much
7
+ # usage was accrued by a customer for that period.
8
+ class MeterEventSummary < APIResource
9
+ OBJECT_NAME = "billing.meter_event_summary"
10
+ def self.object_name
11
+ "billing.meter_event_summary"
12
+ end
13
+ end
14
+ end
15
+ end
@@ -6,7 +6,9 @@ module Stripe
6
6
  # to your server for confirming a PaymentIntent or SetupIntent. If the confirmation
7
7
  # is successful, values present on the ConfirmationToken are written onto the Intent.
8
8
  #
9
- # To learn more or request access, visit the related guided: [Finalize payments on the server using Confirmation Tokens](https://stripe.com/docs/payments/finalize-payments-on-the-server-confirmation-tokens).
9
+ # To learn more about how to use ConfirmationToken, visit the related guides:
10
+ # - [Finalize payments on the server](https://stripe.com/docs/payments/finalize-payments-on-the-server)
11
+ # - [Build two-step confirmation](https://stripe.com/docs/payments/build-a-two-step-confirmation).
10
12
  class ConfirmationToken < APIResource
11
13
  OBJECT_NAME = "confirmation_token"
12
14
  def self.object_name
@@ -17,6 +17,8 @@ module Stripe
17
17
  #
18
18
  # Forwarding Requests are synchronous requests that return a response or time out according to
19
19
  # Stripe's limits.
20
+ #
21
+ # Related guide: [Forward card details to third-party API endpoints](https://docs.stripe.com/payments/forwarding).
20
22
  class Request < APIResource
21
23
  extend Stripe::APIOperations::Create
22
24
  extend Stripe::APIOperations::List
@@ -203,6 +203,8 @@ module Stripe
203
203
  end
204
204
 
205
205
  # Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found.
206
+ #
207
+ # Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or <a href="#create_credit_note">credit note](https://stripe.com/docs/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business.
206
208
  def void_invoice(params = {}, opts = {})
207
209
  request_stripe_object(
208
210
  method: :post,
@@ -213,6 +215,8 @@ module Stripe
213
215
  end
214
216
 
215
217
  # Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found.
218
+ #
219
+ # Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or <a href="#create_credit_note">credit note](https://stripe.com/docs/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business.
216
220
  def self.void_invoice(invoice, params = {}, opts = {})
217
221
  request_stripe_object(
218
222
  method: :post,
@@ -124,7 +124,7 @@ module Stripe
124
124
  )
125
125
  end
126
126
 
127
- # Download the PDF for a finalized quote
127
+ # Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf)
128
128
  def pdf(params = {}, opts = {}, &read_body_chunk_block)
129
129
  config = opts[:client]&.config || Stripe.config
130
130
  opts = { api_base: config.uploads_base }.merge(opts)
@@ -137,7 +137,7 @@ module Stripe
137
137
  )
138
138
  end
139
139
 
140
- # Download the PDF for a finalized quote
140
+ # Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf)
141
141
  def self.pdf(quote, params = {}, opts = {}, &read_body_chunk_block)
142
142
  config = opts[:client]&.config || Stripe.config
143
143
  opts = { api_base: config.uploads_base }.merge(opts)
@@ -11,6 +11,10 @@ require "stripe/resources/apps/secret"
11
11
  require "stripe/resources/balance"
12
12
  require "stripe/resources/balance_transaction"
13
13
  require "stripe/resources/bank_account"
14
+ require "stripe/resources/billing/meter"
15
+ require "stripe/resources/billing/meter_event"
16
+ require "stripe/resources/billing/meter_event_adjustment"
17
+ require "stripe/resources/billing/meter_event_summary"
14
18
  require "stripe/resources/billing_portal/configuration"
15
19
  require "stripe/resources/billing_portal/session"
16
20
  require "stripe/resources/capability"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
- VERSION = "10.13.0"
4
+ VERSION = "10.14.0"
5
5
  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: 10.13.0
4
+ version: 10.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-21 00:00:00.000000000 Z
11
+ date: 2024-03-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Stripe is the easiest way to accept payments online. See https://stripe.com
14
14
  for details.
@@ -63,6 +63,10 @@ files:
63
63
  - lib/stripe/resources/balance.rb
64
64
  - lib/stripe/resources/balance_transaction.rb
65
65
  - lib/stripe/resources/bank_account.rb
66
+ - lib/stripe/resources/billing/meter.rb
67
+ - lib/stripe/resources/billing/meter_event.rb
68
+ - lib/stripe/resources/billing/meter_event_adjustment.rb
69
+ - lib/stripe/resources/billing/meter_event_summary.rb
66
70
  - lib/stripe/resources/billing_portal/configuration.rb
67
71
  - lib/stripe/resources/billing_portal/session.rb
68
72
  - lib/stripe/resources/capability.rb