From ad79e5ddec775ada5e607e25fdb378d7957644f2 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 9 Oct 2024 20:02:33 +0000 Subject: [PATCH 01/10] Update generated code for v1284 --- OPENAPI_VERSION | 2 +- lib/stripe/resources/token.rb | 2 +- lib/stripe/services/token_service.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 35e0f7638..96c839fe7 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1273 \ No newline at end of file +v1284 \ No newline at end of file diff --git a/lib/stripe/resources/token.rb b/lib/stripe/resources/token.rb index 9ae3b7f63..ffef36deb 100644 --- a/lib/stripe/resources/token.rb +++ b/lib/stripe/resources/token.rb @@ -31,7 +31,7 @@ def self.object_name end # Creates a single-use token that represents a bank account's details. - # You can use this token with any API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts. + # You can use this token with any v1 API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts. def self.create(params = {}, opts = {}) request_stripe_object(method: :post, path: "/v1/tokens", params: params, opts: opts) end diff --git a/lib/stripe/services/token_service.rb b/lib/stripe/services/token_service.rb index cf5deabf3..49994a745 100644 --- a/lib/stripe/services/token_service.rb +++ b/lib/stripe/services/token_service.rb @@ -4,7 +4,7 @@ module Stripe class TokenService < StripeService # Creates a single-use token that represents a bank account's details. - # You can use this token with any API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts. + # You can use this token with any v1 API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts. def create(params = {}, opts = {}) request(method: :post, path: "/v1/tokens", params: params, opts: opts, base_address: :api) end From 79ebfa5c1a8b00df724edabe1102d05dce9e2b89 Mon Sep 17 00:00:00 2001 From: jar-stripe Date: Thu, 10 Oct 2024 11:08:45 -0700 Subject: [PATCH 02/10] Cleaned up examples and added documentation (#1470) --- examples/README.md | 9 +++-- examples/example_template.rb | 36 +++++++++++++++++++ examples/meter_event_stream.rb | 10 ++++++ examples/new_example.rb | 24 ------------- ...andler.rb => thinevent_webhook_handler.rb} | 11 ++++++ 5 files changed, 64 insertions(+), 26 deletions(-) create mode 100644 examples/example_template.rb delete mode 100644 examples/new_example.rb rename examples/{stripe_webhook_handler.rb => thinevent_webhook_handler.rb} (60%) diff --git a/examples/README.md b/examples/README.md index d0c3af87b..e652a0bde 100644 --- a/examples/README.md +++ b/examples/README.md @@ -3,9 +3,14 @@ From the examples folder, run: `RUBYLIB=../lib ruby your_example.rb` +e.g. + +`RUBYLIB=../lib ruby thinevent_webhook_handler.rb` + ## Adding a new example 1. Clone new_example.rb 2. Implement your example -3. Run it (as per above) -4. 👍 +3. Fill out the file comment. Include a description and key steps that are being demonstrated. +4. Run it (as per above) +5. 👍 diff --git a/examples/example_template.rb b/examples/example_template.rb new file mode 100644 index 000000000..2342a3c4d --- /dev/null +++ b/examples/example_template.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# example_template.py - This is a template for defining new examples. It is not intended to be used directly. +# +# +# +# In this example, we: +# - +# - + +require "stripe" +require "date" + +class ExampleTemplate + attr_accessor :api_key + + def initialize(api_key) + @api_key = api_key + end + + def do_something_great + puts "Hello World" + # client = Stripe::StripeClient.new(api_key) + # client.v1 + end +end + +# Send meter events +api_key = "{{API_KEY}}" + +example = ExampleTemplate.new(api_key) +example.do_something_great diff --git a/examples/meter_event_stream.rb b/examples/meter_event_stream.rb index 3f75ad4fe..45484b85f 100644 --- a/examples/meter_event_stream.rb +++ b/examples/meter_event_stream.rb @@ -1,5 +1,15 @@ # frozen_string_literal: true +# meter_event_stream.py - use the high-throughput meter event stream to report create billing meter events. +# +# In this example, we: +# - create a meter event session and store the session's authentication token +# - define an event with a payload +# - use the meter_event_stream service accessor in StripeClient to create an event stream that reports this event +# +# This example expects a billing meter with an event_name of 'alpaca_ai_tokens'. If you have +# a different meter event name, you can change it before running this example. + require "stripe" require "date" diff --git a/examples/new_example.rb b/examples/new_example.rb deleted file mode 100644 index a358995f9..000000000 --- a/examples/new_example.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -require "stripe" -require "date" - -class NewExample - attr_accessor :api_key - - def initialize(api_key) - @api_key = api_key - end - - def do_something_great - puts "Hello World" - # client = Stripe::StripeClient.new(api_key) - # client.v1 - end -end - -# Send meter events -api_key = "{{API_KEY}}" - -example = NewExample.new(api_key) -example.do_something_great diff --git a/examples/stripe_webhook_handler.rb b/examples/thinevent_webhook_handler.rb similarity index 60% rename from examples/stripe_webhook_handler.rb rename to examples/thinevent_webhook_handler.rb index 94269ebfe..cc0594ff3 100644 --- a/examples/stripe_webhook_handler.rb +++ b/examples/thinevent_webhook_handler.rb @@ -1,6 +1,17 @@ # frozen_string_literal: true # typed: false +# thinevent_webhook_handler.rb - receive and process thin events like the +# v1.billing.meter.error_report_triggered event. +# +# In this example, we: +# - create a StripeClient called client +# - use client.parse_thin_event to parse the received thin event webhook body +# - call client.v2.core.events.retrieve to retrieve the full event object +# - if it is a V1BillingMeterErrorReportTriggeredEvent event type, call +# event.fetchRelatedObject to retrieve the Billing Meter object associated +# with the event. + require "stripe" require "sinatra" From b0baf7dcf542e98259b1795949b089255d7a6cac Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 00:35:23 +0000 Subject: [PATCH 03/10] Update generated code for v1289 --- OPENAPI_VERSION | 2 +- lib/stripe/resources/billing/credit_balance_summary.rb | 2 +- lib/stripe/resources/billing/credit_grant.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index a9cfa9e83..0ec54f68c 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1288 \ No newline at end of file +v1289 \ No newline at end of file diff --git a/lib/stripe/resources/billing/credit_balance_summary.rb b/lib/stripe/resources/billing/credit_balance_summary.rb index 1a78cfa08..928967a07 100644 --- a/lib/stripe/resources/billing/credit_balance_summary.rb +++ b/lib/stripe/resources/billing/credit_balance_summary.rb @@ -3,7 +3,7 @@ module Stripe module Billing - # Indicates the credit balance for credits granted to a customer. + # Indicates the billing credit balance for billing credits granted to a customer. class CreditBalanceSummary < SingletonAPIResource OBJECT_NAME = "billing.credit_balance_summary" def self.object_name diff --git a/lib/stripe/resources/billing/credit_grant.rb b/lib/stripe/resources/billing/credit_grant.rb index cac6d0969..26ef889d8 100644 --- a/lib/stripe/resources/billing/credit_grant.rb +++ b/lib/stripe/resources/billing/credit_grant.rb @@ -3,7 +3,7 @@ module Stripe module Billing - # A credit grant is a resource that records a grant of some credit to a customer. + # A credit grant is a resource that records a grant of billing credits to a customer. class CreditGrant < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List From 7475e762495267e059ecfa637fb59e06730241d8 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 15:52:59 +0000 Subject: [PATCH 04/10] Update generated code for v1290 --- OPENAPI_VERSION | 2 +- .../resources/treasury/inbound_transfer.rb | 20 +++++++++++++++++++ .../treasury/inbound_transfer_service.rb | 11 ++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 0ec54f68c..d312eda73 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1289 \ No newline at end of file +v1290 \ No newline at end of file diff --git a/lib/stripe/resources/treasury/inbound_transfer.rb b/lib/stripe/resources/treasury/inbound_transfer.rb index ed8c70ff6..e1e5afa3f 100644 --- a/lib/stripe/resources/treasury/inbound_transfer.rb +++ b/lib/stripe/resources/treasury/inbound_transfer.rb @@ -35,6 +35,26 @@ def self.cancel(inbound_transfer, params = {}, opts = {}) ) end + # Confirm an InboundTransfer. + def confirm(params = {}, opts = {}) + request_stripe_object( + method: :post, + path: format("/v1/treasury/inbound_transfers/%s/confirm", { inbound_transfer: CGI.escape(self["id"]) }), + params: params, + opts: opts + ) + end + + # Confirm an InboundTransfer. + def self.confirm(inbound_transfer, params = {}, opts = {}) + request_stripe_object( + method: :post, + path: format("/v1/treasury/inbound_transfers/%s/confirm", { inbound_transfer: CGI.escape(inbound_transfer) }), + params: params, + opts: opts + ) + end + # Creates an InboundTransfer. def self.create(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/services/treasury/inbound_transfer_service.rb b/lib/stripe/services/treasury/inbound_transfer_service.rb index f1737e281..7ff461798 100644 --- a/lib/stripe/services/treasury/inbound_transfer_service.rb +++ b/lib/stripe/services/treasury/inbound_transfer_service.rb @@ -15,6 +15,17 @@ def cancel(inbound_transfer, params = {}, opts = {}) ) end + # Confirm an InboundTransfer. + def confirm(inbound_transfer, params = {}, opts = {}) + request( + method: :post, + path: format("/v1/treasury/inbound_transfers/%s/confirm", { inbound_transfer: CGI.escape(inbound_transfer) }), + params: params, + opts: opts, + base_address: :api + ) + end + # Creates an InboundTransfer. def create(params = {}, opts = {}) request( From abe64d9057db15747b97e421e05136c5240fd71b Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 01:22:38 +0000 Subject: [PATCH 05/10] Update generated code for v1295 --- OPENAPI_VERSION | 2 +- .../customer_cash_balance_transaction.rb | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index d312eda73..762c3f9a9 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1290 \ No newline at end of file +v1295 \ No newline at end of file diff --git a/lib/stripe/resources/customer_cash_balance_transaction.rb b/lib/stripe/resources/customer_cash_balance_transaction.rb index 3d072e914..c062c12c0 100644 --- a/lib/stripe/resources/customer_cash_balance_transaction.rb +++ b/lib/stripe/resources/customer_cash_balance_transaction.rb @@ -11,5 +11,26 @@ class CustomerCashBalanceTransaction < APIResource def self.object_name "customer_cash_balance_transaction" end + + def test_helpers + TestHelpers.new(self) + end + + class TestHelpers < APIResourceTestHelpers + RESOURCE_CLASS = CustomerCashBalanceTransaction + def self.resource_class + "CustomerCashBalanceTransaction" + end + + # Simulate various customer cash balance side-effects by creating synthetic cash balance transactions in testmode. + def self.create(params = {}, opts = {}) + request_stripe_object( + method: :post, + path: "/v1/test_helpers/customer_cash_balance_transactions", + params: params, + opts: opts + ) + end + end end end From ea01a5f86a14ebfcd981953a6aad8a3f060d0717 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 16 Oct 2024 17:22:42 +0000 Subject: [PATCH 06/10] Update generated code for v1300 --- OPENAPI_VERSION | 2 +- lib/stripe/resources/billing/credit_grant.rb | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 762c3f9a9..3447db2c9 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1295 \ No newline at end of file +v1300 \ No newline at end of file diff --git a/lib/stripe/resources/billing/credit_grant.rb b/lib/stripe/resources/billing/credit_grant.rb index 26ef889d8..b12198e5e 100644 --- a/lib/stripe/resources/billing/credit_grant.rb +++ b/lib/stripe/resources/billing/credit_grant.rb @@ -3,7 +3,10 @@ module Stripe module Billing - # A credit grant is a resource that records a grant of billing credits to a customer. + # A credit grant is an API resource that documents the allocation of some billing credits to a customer. + # + # Related guide: [Billing credits](https://docs.stripe.com/billing/subscriptions/usage-based/billing-credits) + # end class CreditGrant < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List From 2cc89bdf57afdd1c6bc87dbc9f2aa561e75315fe Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 16 Oct 2024 22:17:08 +0000 Subject: [PATCH 07/10] Update generated code for v1301 --- OPENAPI_VERSION | 2 +- .../customer_cash_balance_transaction.rb | 21 ------------------- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 3447db2c9..358f3e1e7 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1300 \ No newline at end of file +v1301 \ No newline at end of file diff --git a/lib/stripe/resources/customer_cash_balance_transaction.rb b/lib/stripe/resources/customer_cash_balance_transaction.rb index c062c12c0..3d072e914 100644 --- a/lib/stripe/resources/customer_cash_balance_transaction.rb +++ b/lib/stripe/resources/customer_cash_balance_transaction.rb @@ -11,26 +11,5 @@ class CustomerCashBalanceTransaction < APIResource def self.object_name "customer_cash_balance_transaction" end - - def test_helpers - TestHelpers.new(self) - end - - class TestHelpers < APIResourceTestHelpers - RESOURCE_CLASS = CustomerCashBalanceTransaction - def self.resource_class - "CustomerCashBalanceTransaction" - end - - # Simulate various customer cash balance side-effects by creating synthetic cash balance transactions in testmode. - def self.create(params = {}, opts = {}) - request_stripe_object( - method: :post, - path: "/v1/test_helpers/customer_cash_balance_transactions", - params: params, - opts: opts - ) - end - end end end From 14ec67c5e548628347425660cce1c2de3942e803 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 16 Oct 2024 22:27:32 +0000 Subject: [PATCH 08/10] Update generated code for v1302 --- OPENAPI_VERSION | 2 +- lib/stripe/resources/issuing/card.rb | 4 ++-- lib/stripe/services/test_helpers/issuing/card_service.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 358f3e1e7..7dd6af3cb 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1301 \ No newline at end of file +v1302 \ No newline at end of file diff --git a/lib/stripe/resources/issuing/card.rb b/lib/stripe/resources/issuing/card.rb index 428b18b51..0166ab678 100644 --- a/lib/stripe/resources/issuing/card.rb +++ b/lib/stripe/resources/issuing/card.rb @@ -124,7 +124,7 @@ def ship_card(params = {}, opts = {}) ) end - # Updates the shipping status of the specified Issuing Card object to submitted. This method is only available with Stripe Version ‘2024-09-30.acacia' or above. + # Updates the shipping status of the specified Issuing Card object to submitted. This method requires Stripe Version ‘2024-09-30.acacia' or later. def self.submit_card(card, params = {}, opts = {}) request_stripe_object( method: :post, @@ -134,7 +134,7 @@ def self.submit_card(card, params = {}, opts = {}) ) end - # Updates the shipping status of the specified Issuing Card object to submitted. This method is only available with Stripe Version ‘2024-09-30.acacia' or above. + # Updates the shipping status of the specified Issuing Card object to submitted. This method requires Stripe Version ‘2024-09-30.acacia' or later. def submit_card(params = {}, opts = {}) @resource.request_stripe_object( method: :post, diff --git a/lib/stripe/services/test_helpers/issuing/card_service.rb b/lib/stripe/services/test_helpers/issuing/card_service.rb index c78e7ae9d..00f655124 100644 --- a/lib/stripe/services/test_helpers/issuing/card_service.rb +++ b/lib/stripe/services/test_helpers/issuing/card_service.rb @@ -49,7 +49,7 @@ def ship_card(card, params = {}, opts = {}) ) end - # Updates the shipping status of the specified Issuing Card object to submitted. This method is only available with Stripe Version ‘2024-09-30.acacia' or above. + # Updates the shipping status of the specified Issuing Card object to submitted. This method requires Stripe Version ‘2024-09-30.acacia' or later. def submit_card(card, params = {}, opts = {}) request( method: :post, From 6b8c0fe7a2527b105b99c36d98021d2f05271f58 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 17 Oct 2024 14:04:42 +0000 Subject: [PATCH 09/10] Update generated code for v1306 --- OPENAPI_VERSION | 2 +- .../resources/treasury/inbound_transfer.rb | 20 ------------------- .../treasury/inbound_transfer_service.rb | 11 ---------- 3 files changed, 1 insertion(+), 32 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 7dd6af3cb..2a6696995 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1302 \ No newline at end of file +v1306 \ No newline at end of file diff --git a/lib/stripe/resources/treasury/inbound_transfer.rb b/lib/stripe/resources/treasury/inbound_transfer.rb index e1e5afa3f..ed8c70ff6 100644 --- a/lib/stripe/resources/treasury/inbound_transfer.rb +++ b/lib/stripe/resources/treasury/inbound_transfer.rb @@ -35,26 +35,6 @@ def self.cancel(inbound_transfer, params = {}, opts = {}) ) end - # Confirm an InboundTransfer. - def confirm(params = {}, opts = {}) - request_stripe_object( - method: :post, - path: format("/v1/treasury/inbound_transfers/%s/confirm", { inbound_transfer: CGI.escape(self["id"]) }), - params: params, - opts: opts - ) - end - - # Confirm an InboundTransfer. - def self.confirm(inbound_transfer, params = {}, opts = {}) - request_stripe_object( - method: :post, - path: format("/v1/treasury/inbound_transfers/%s/confirm", { inbound_transfer: CGI.escape(inbound_transfer) }), - params: params, - opts: opts - ) - end - # Creates an InboundTransfer. def self.create(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/services/treasury/inbound_transfer_service.rb b/lib/stripe/services/treasury/inbound_transfer_service.rb index 7ff461798..f1737e281 100644 --- a/lib/stripe/services/treasury/inbound_transfer_service.rb +++ b/lib/stripe/services/treasury/inbound_transfer_service.rb @@ -15,17 +15,6 @@ def cancel(inbound_transfer, params = {}, opts = {}) ) end - # Confirm an InboundTransfer. - def confirm(inbound_transfer, params = {}, opts = {}) - request( - method: :post, - path: format("/v1/treasury/inbound_transfers/%s/confirm", { inbound_transfer: CGI.escape(inbound_transfer) }), - params: params, - opts: opts, - base_address: :api - ) - end - # Creates an InboundTransfer. def create(params = {}, opts = {}) request( From 95f4c9d231f9a9db0e5fed2058f9d20859adf86d Mon Sep 17 00:00:00 2001 From: David Brownman <109395161+xavdid-stripe@users.noreply.github.com> Date: Fri, 18 Oct 2024 11:16:58 -0700 Subject: [PATCH 10/10] update object tags for meter-related classes (#1471) * update object tags for meter-related classes * fix tests --- lib/stripe/resources/v2/billing/meter_event.rb | 4 ++-- lib/stripe/resources/v2/billing/meter_event_adjustment.rb | 4 ++-- lib/stripe/resources/v2/billing/meter_event_session.rb | 4 ++-- test/stripe/api_resource_test.rb | 2 +- test/stripe/stripe_service_test.rb | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/stripe/resources/v2/billing/meter_event.rb b/lib/stripe/resources/v2/billing/meter_event.rb index a7ddc2bfa..95f1e494f 100644 --- a/lib/stripe/resources/v2/billing/meter_event.rb +++ b/lib/stripe/resources/v2/billing/meter_event.rb @@ -6,9 +6,9 @@ module V2 module Billing # Fix me empty_doc_string. class MeterEvent < APIResource - OBJECT_NAME = "billing.meter_event" + OBJECT_NAME = "v2.billing.meter_event" def self.object_name - "billing.meter_event" + "v2.billing.meter_event" end end end diff --git a/lib/stripe/resources/v2/billing/meter_event_adjustment.rb b/lib/stripe/resources/v2/billing/meter_event_adjustment.rb index 1e89b1802..f26f857f2 100644 --- a/lib/stripe/resources/v2/billing/meter_event_adjustment.rb +++ b/lib/stripe/resources/v2/billing/meter_event_adjustment.rb @@ -5,9 +5,9 @@ module Stripe module V2 module Billing class MeterEventAdjustment < APIResource - OBJECT_NAME = "billing.meter_event_adjustment" + OBJECT_NAME = "v2.billing.meter_event_adjustment" def self.object_name - "billing.meter_event_adjustment" + "v2.billing.meter_event_adjustment" end end end diff --git a/lib/stripe/resources/v2/billing/meter_event_session.rb b/lib/stripe/resources/v2/billing/meter_event_session.rb index cc6ced827..0bb2ac4d1 100644 --- a/lib/stripe/resources/v2/billing/meter_event_session.rb +++ b/lib/stripe/resources/v2/billing/meter_event_session.rb @@ -5,9 +5,9 @@ module Stripe module V2 module Billing class MeterEventSession < APIResource - OBJECT_NAME = "billing.meter_event_session" + OBJECT_NAME = "v2.billing.meter_event_session" def self.object_name - "billing.meter_event_session" + "v2.billing.meter_event_session" end end end diff --git a/test/stripe/api_resource_test.rb b/test/stripe/api_resource_test.rb index 8f282a1c5..e6dc9e604 100644 --- a/test/stripe/api_resource_test.rb +++ b/test/stripe/api_resource_test.rb @@ -909,7 +909,7 @@ def self.object_name should "raise an NotImplementedError on refresh" do stub_request(:post, "#{Stripe::DEFAULT_API_BASE}/v2/billing/meter_event_session") - .to_return(body: JSON.generate(object: "billing.meter_event_session")) + .to_return(body: JSON.generate(object: "v2.billing.meter_event_session")) client = Stripe::StripeClient.new("sk_test_123") session = client.v2.billing.meter_event_session.create diff --git a/test/stripe/stripe_service_test.rb b/test/stripe/stripe_service_test.rb index b08e640b6..242f9377f 100644 --- a/test/stripe/stripe_service_test.rb +++ b/test/stripe/stripe_service_test.rb @@ -18,7 +18,7 @@ class StripeServiceTest < Test::Unit::TestCase should "correctly deserialize v2 account object" do stub_request(:post, "#{Stripe::DEFAULT_API_BASE}/v2/billing/meter_event_session") - .to_return(body: JSON.generate(object: "billing.meter_event_session")) + .to_return(body: JSON.generate(object: "v2.billing.meter_event_session")) client = Stripe::StripeClient.new("sk_test_123")