Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CODEGEN_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
97ed8f33ac148105eefc5ec2543b66a32367bc1f
05cb5f4269ead45cd337f456026295ed0e467f9c
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2206
v2207
8 changes: 6 additions & 2 deletions lib/stripe/services/checkout/session_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ def initialize(requestor)

# Creates a Checkout Session object.
def create(params = {}, opts = {})
params = Checkout::SessionCreateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)
unless params.is_a?(Stripe::RequestParams)
params = ::Stripe::Checkout::SessionCreateParams.coerce_params(params)
end

request(
method: :post,
Expand Down Expand Up @@ -63,7 +65,9 @@ def retrieve(session, params = {}, opts = {})
#
# Related guide: [Dynamically update a Checkout Session](https://docs.stripe.com/payments/advanced/dynamic-updates)
def update(session, params = {}, opts = {})
params = Checkout::SessionUpdateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)
unless params.is_a?(Stripe::RequestParams)
params = ::Stripe::Checkout::SessionUpdateParams.coerce_params(params)
end

request(
method: :post,
Expand Down
2 changes: 1 addition & 1 deletion lib/stripe/services/climate/order_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def cancel(order, params = {}, opts = {})
# Creates a Climate order object for a given Climate product. The order will be processed immediately
# after creation and payment will be deducted your Stripe balance.
def create(params = {}, opts = {})
params = Climate::OrderCreateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)
params = ::Stripe::Climate::OrderCreateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)

request(
method: :post,
Expand Down
4 changes: 3 additions & 1 deletion lib/stripe/services/credit_note_preview_lines_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ module Stripe
class CreditNotePreviewLinesService < StripeService
# When retrieving a credit note preview, you'll get a lines property containing the first handful of those items. This URL you can retrieve the full (paginated) list of line items.
def list(params = {}, opts = {})
params = CreditNotePreviewLinesListParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)
unless params.is_a?(Stripe::RequestParams)
params = ::Stripe::CreditNotePreviewLinesListParams.coerce_params(params)
end

request(
method: :get,
Expand Down
4 changes: 2 additions & 2 deletions lib/stripe/services/credit_note_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def initialize(requestor)
# You may issue multiple credit notes for an invoice. Each credit note may increment the invoice's pre_payment_credit_notes_amount,
# post_payment_credit_notes_amount, or both, depending on the invoice's amount_remaining at the time of credit note creation.
def create(params = {}, opts = {})
params = CreditNoteCreateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)
params = ::Stripe::CreditNoteCreateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)

request(
method: :post,
Expand All @@ -49,7 +49,7 @@ def list(params = {}, opts = {})

# Get a preview of a credit note without creating it.
def preview(params = {}, opts = {})
params = CreditNotePreviewParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)
params = ::Stripe::CreditNotePreviewParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)

request(
method: :get,
Expand Down
4 changes: 2 additions & 2 deletions lib/stripe/services/invoice_item_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Stripe
class InvoiceItemService < StripeService
# Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is specified, the item will be on the next invoice created for the customer specified.
def create(params = {}, opts = {})
params = InvoiceItemCreateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)
params = ::Stripe::InvoiceItemCreateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)

request(
method: :post,
Expand Down Expand Up @@ -51,7 +51,7 @@ def retrieve(invoiceitem, params = {}, opts = {})

# Updates the amount or description of an invoice item on an upcoming invoice. Updating an invoice item is only possible before the invoice it's attached to is closed.
def update(invoiceitem, params = {}, opts = {})
params = InvoiceItemUpdateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)
params = ::Stripe::InvoiceItemUpdateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)

request(
method: :post,
Expand Down
2 changes: 1 addition & 1 deletion lib/stripe/services/invoice_line_item_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def list(invoice, params = {}, opts = {})
# item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well.
# Updating an invoice's line item is only possible before the invoice is finalized.
def update(invoice, line_item_id, params = {}, opts = {})
params = InvoiceLineItemUpdateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)
params = ::Stripe::InvoiceLineItemUpdateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)

request(
method: :post,
Expand Down
6 changes: 3 additions & 3 deletions lib/stripe/services/invoice_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def initialize(requestor)

# Adds multiple line items to an invoice. This is only possible when an invoice is still a draft.
def add_lines(invoice, params = {}, opts = {})
params = InvoiceAddLinesParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)
params = ::Stripe::InvoiceAddLinesParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)

request(
method: :post,
Expand Down Expand Up @@ -58,7 +58,7 @@ def create(params = {}, opts = {})
#
# Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions)
def create_preview(params = {}, opts = {})
params = InvoiceCreatePreviewParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)
params = ::Stripe::InvoiceCreatePreviewParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)

request(
method: :post,
Expand Down Expand Up @@ -185,7 +185,7 @@ def update(invoice, params = {}, opts = {})

# Updates multiple line items on an invoice. This is only possible when an invoice is still a draft.
def update_lines(invoice, params = {}, opts = {})
params = InvoiceUpdateLinesParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)
params = ::Stripe::InvoiceUpdateLinesParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)

request(
method: :post,
Expand Down
2 changes: 1 addition & 1 deletion lib/stripe/services/payment_link_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def initialize(requestor)

# Creates a payment link.
def create(params = {}, opts = {})
params = PaymentLinkCreateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)
params = ::Stripe::PaymentLinkCreateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)

request(
method: :post,
Expand Down
2 changes: 1 addition & 1 deletion lib/stripe/services/plan_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Stripe
class PlanService < StripeService
# You can now model subscriptions more flexibly using the [Prices API](https://docs.stripe.com/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration.
def create(params = {}, opts = {})
params = PlanCreateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)
params = ::Stripe::PlanCreateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)

request(method: :post, path: "/v1/plans", params: params, opts: opts, base_address: :api)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/stripe/services/price_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Stripe
class PriceService < StripeService
# Creates a new [Price for an existing <a href="https://docs.stripe.com/api/products">Product](https://docs.stripe.com/api/prices). The Price can be recurring or one-time.
def create(params = {}, opts = {})
params = PriceCreateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)
params = ::Stripe::PriceCreateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)

request(method: :post, path: "/v1/prices", params: params, opts: opts, base_address: :api)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/stripe/services/product_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def initialize(requestor)

# Creates a new product object.
def create(params = {}, opts = {})
params = ProductCreateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)
params = ::Stripe::ProductCreateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)

request(method: :post, path: "/v1/products", params: params, opts: opts, base_address: :api)
end
Expand Down
4 changes: 2 additions & 2 deletions lib/stripe/services/quote_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def cancel(quote, params = {}, opts = {})

# A quote models prices and services for a customer. Default options for header, description, footer, and expires_at can be set in the dashboard via the [quote template](https://dashboard.stripe.com/settings/billing/quote).
def create(params = {}, opts = {})
params = QuoteCreateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)
params = ::Stripe::QuoteCreateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)

request(method: :post, path: "/v1/quotes", params: params, opts: opts, base_address: :api)
end
Expand Down Expand Up @@ -82,7 +82,7 @@ def retrieve(quote, params = {}, opts = {})

# A quote models prices and services for a customer.
def update(quote, params = {}, opts = {})
params = QuoteUpdateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)
params = ::Stripe::QuoteUpdateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)

request(
method: :post,
Expand Down
4 changes: 2 additions & 2 deletions lib/stripe/services/subscription_item_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Stripe
class SubscriptionItemService < StripeService
# Adds a new item to an existing subscription. No existing items will be changed or replaced.
def create(params = {}, opts = {})
params = SubscriptionItemCreateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)
params = ::Stripe::SubscriptionItemCreateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)

request(
method: :post,
Expand Down Expand Up @@ -51,7 +51,7 @@ def retrieve(item, params = {}, opts = {})

# Updates the plan or quantity of an item on a current subscription.
def update(item, params = {}, opts = {})
params = SubscriptionItemUpdateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)
params = ::Stripe::SubscriptionItemUpdateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)

request(
method: :post,
Expand Down
8 changes: 6 additions & 2 deletions lib/stripe/services/subscription_schedule_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ def cancel(schedule, params = {}, opts = {})

# Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions.
def create(params = {}, opts = {})
params = SubscriptionScheduleCreateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)
unless params.is_a?(Stripe::RequestParams)
params = ::Stripe::SubscriptionScheduleCreateParams.coerce_params(params)
end

request(
method: :post,
Expand Down Expand Up @@ -62,7 +64,9 @@ def retrieve(schedule, params = {}, opts = {})

# Updates an existing subscription schedule.
def update(schedule, params = {}, opts = {})
params = SubscriptionScheduleUpdateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)
unless params.is_a?(Stripe::RequestParams)
params = ::Stripe::SubscriptionScheduleUpdateParams.coerce_params(params)
end

request(
method: :post,
Expand Down
4 changes: 2 additions & 2 deletions lib/stripe/services/subscription_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def cancel(subscription_exposed_id, params = {}, opts = {})
# To start subscriptions where the first invoice always begins in a draft status, use [subscription schedules](https://docs.stripe.com/docs/billing/subscriptions/subscription-schedules#managing) instead.
# Schedules provide the flexibility to model more complex billing configurations that change over time.
def create(params = {}, opts = {})
params = SubscriptionCreateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)
params = ::Stripe::SubscriptionCreateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)

request(
method: :post,
Expand Down Expand Up @@ -128,7 +128,7 @@ def search(params = {}, opts = {})
#
# Updating the quantity on a subscription many times in an hour may result in [rate limiting. If you need to bill for a frequently changing quantity, consider integrating <a href="/docs/billing/subscriptions/usage-based">usage-based billing](https://docs.stripe.com/docs/rate-limits) instead.
def update(subscription_exposed_id, params = {}, opts = {})
params = SubscriptionUpdateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)
params = ::Stripe::SubscriptionUpdateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)

request(
method: :post,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class AuthorizationService < StripeService
# Capture a test-mode authorization.
def capture(authorization, params = {}, opts = {})
unless params.is_a?(Stripe::RequestParams)
params = TestHelpers::Issuing::AuthorizationCaptureParams.coerce_params(params)
params = ::Stripe::TestHelpers::Issuing::AuthorizationCaptureParams.coerce_params(params)
end

request(
Expand All @@ -23,7 +23,7 @@ def capture(authorization, params = {}, opts = {})
# Create a test-mode authorization.
def create(params = {}, opts = {})
unless params.is_a?(Stripe::RequestParams)
params = TestHelpers::Issuing::AuthorizationCreateParams.coerce_params(params)
params = ::Stripe::TestHelpers::Issuing::AuthorizationCreateParams.coerce_params(params)
end

request(
Expand All @@ -49,7 +49,7 @@ def expire(authorization, params = {}, opts = {})
# Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount.
def finalize_amount(authorization, params = {}, opts = {})
unless params.is_a?(Stripe::RequestParams)
params = TestHelpers::Issuing::AuthorizationFinalizeAmountParams.coerce_params(params)
params = ::Stripe::TestHelpers::Issuing::AuthorizationFinalizeAmountParams.coerce_params(params)
end

request(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class TransactionService < StripeService
# Allows the user to capture an arbitrary amount, also known as a forced capture.
def create_force_capture(params = {}, opts = {})
unless params.is_a?(Stripe::RequestParams)
params = TestHelpers::Issuing::TransactionCreateForceCaptureParams.coerce_params(params)
params = ::Stripe::TestHelpers::Issuing::TransactionCreateForceCaptureParams.coerce_params(params)
end

request(
Expand All @@ -23,7 +23,7 @@ def create_force_capture(params = {}, opts = {})
# Allows the user to refund an arbitrary amount, also known as a unlinked refund.
def create_unlinked_refund(params = {}, opts = {})
unless params.is_a?(Stripe::RequestParams)
params = TestHelpers::Issuing::TransactionCreateUnlinkedRefundParams.coerce_params(params)
params = ::Stripe::TestHelpers::Issuing::TransactionCreateUnlinkedRefundParams.coerce_params(params)
end

request(
Expand Down
8 changes: 6 additions & 2 deletions lib/stripe/services/v2/core/account_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ def close(id, params = {}, opts = {})
#
# ** raises RateLimitError
def create(params = {}, opts = {})
params = V2::Core::AccountCreateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)
unless params.is_a?(Stripe::RequestParams)
params = ::Stripe::V2::Core::AccountCreateParams.coerce_params(params)
end

request(
method: :post,
Expand Down Expand Up @@ -71,7 +73,9 @@ def retrieve(id, params = {}, opts = {})
#
# ** raises RateLimitError
def update(id, params = {}, opts = {})
params = V2::Core::AccountUpdateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)
unless params.is_a?(Stripe::RequestParams)
params = ::Stripe::V2::Core::AccountUpdateParams.coerce_params(params)
end

request(
method: :post,
Expand Down
4 changes: 3 additions & 1 deletion lib/stripe/services/v2/core/account_token_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ class AccountTokenService < StripeService
#
# ** raises RateLimitError
def create(params = {}, opts = {})
params = V2::Core::AccountTokenCreateParams.coerce_params(params) unless params.is_a?(Stripe::RequestParams)
unless params.is_a?(Stripe::RequestParams)
params = ::Stripe::V2::Core::AccountTokenCreateParams.coerce_params(params)
end

request(
method: :post,
Expand Down
4 changes: 2 additions & 2 deletions lib/stripe/services/v2/core/accounts/person_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class PersonService < StripeService
# ** raises RateLimitError
def create(account_id, params = {}, opts = {})
unless params.is_a?(Stripe::RequestParams)
params = V2::Core::Accounts::PersonCreateParams.coerce_params(params)
params = ::Stripe::V2::Core::Accounts::PersonCreateParams.coerce_params(params)
end

request(
Expand Down Expand Up @@ -67,7 +67,7 @@ def retrieve(account_id, id, params = {}, opts = {})
# ** raises RateLimitError
def update(account_id, id, params = {}, opts = {})
unless params.is_a?(Stripe::RequestParams)
params = V2::Core::Accounts::PersonUpdateParams.coerce_params(params)
params = ::Stripe::V2::Core::Accounts::PersonUpdateParams.coerce_params(params)
end

request(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class PersonTokenService < StripeService
# ** raises RateLimitError
def create(account_id, params = {}, opts = {})
unless params.is_a?(Stripe::RequestParams)
params = V2::Core::Accounts::PersonTokenCreateParams.coerce_params(params)
params = ::Stripe::V2::Core::Accounts::PersonTokenCreateParams.coerce_params(params)
end

request(
Expand Down
Loading