diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 2597d2c77..e9281bf5d 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v515 \ No newline at end of file +v532 \ No newline at end of file diff --git a/lib/stripe/object_types.rb b/lib/stripe/object_types.rb index 44bbcd028..f521d6413 100644 --- a/lib/stripe/object_types.rb +++ b/lib/stripe/object_types.rb @@ -32,6 +32,7 @@ def self.object_names_to_classes CashBalance::OBJECT_NAME => CashBalance, Charge::OBJECT_NAME => Charge, Checkout::Session::OBJECT_NAME => Checkout::Session, + ConfirmationToken::OBJECT_NAME => ConfirmationToken, CountrySpec::OBJECT_NAME => CountrySpec, Coupon::OBJECT_NAME => Coupon, CreditNote::OBJECT_NAME => CreditNote, diff --git a/lib/stripe/resources.rb b/lib/stripe/resources.rb index fc91e7e62..32fd21895 100644 --- a/lib/stripe/resources.rb +++ b/lib/stripe/resources.rb @@ -21,6 +21,7 @@ require "stripe/resources/cash_balance" require "stripe/resources/charge" require "stripe/resources/checkout/session" +require "stripe/resources/confirmation_token" require "stripe/resources/country_spec" require "stripe/resources/coupon" require "stripe/resources/credit_note" diff --git a/lib/stripe/resources/account.rb b/lib/stripe/resources/account.rb index 68e6e334e..88811d67b 100644 --- a/lib/stripe/resources/account.rb +++ b/lib/stripe/resources/account.rb @@ -23,8 +23,7 @@ class Account < APIResource nested_resource_class_methods :capability, operations: %i[retrieve update list], resource_plural: "capabilities" - nested_resource_class_methods :person, - operations: %i[create retrieve update delete list] + nested_resource_class_methods :person, operations: %i[create retrieve update delete list] def persons(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/application_fee.rb b/lib/stripe/resources/application_fee.rb index dd8a56c6e..7e75cd1b4 100644 --- a/lib/stripe/resources/application_fee.rb +++ b/lib/stripe/resources/application_fee.rb @@ -8,7 +8,6 @@ class ApplicationFee < APIResource OBJECT_NAME = "application_fee" - nested_resource_class_methods :refund, - operations: %i[create retrieve update list] + nested_resource_class_methods :refund, operations: %i[create retrieve update list] end end diff --git a/lib/stripe/resources/balance_transaction.rb b/lib/stripe/resources/balance_transaction.rb index a1a5b1d07..519feada7 100644 --- a/lib/stripe/resources/balance_transaction.rb +++ b/lib/stripe/resources/balance_transaction.rb @@ -3,7 +3,7 @@ module Stripe # Balance transactions represent funds moving through your Stripe account. - # They're created for every type of transaction that comes into or flows out of your Stripe account balance. + # Stripe creates them for every type of transaction that enters or leaves your Stripe account balance. # # Related guide: [Balance transaction types](https://stripe.com/docs/reports/balance-transaction-types) class BalanceTransaction < APIResource diff --git a/lib/stripe/resources/confirmation_token.rb b/lib/stripe/resources/confirmation_token.rb new file mode 100644 index 000000000..2b5a3327f --- /dev/null +++ b/lib/stripe/resources/confirmation_token.rb @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + # ConfirmationTokens help transport client side data collected by Stripe JS over + # to your server for confirming a PaymentIntent or SetupIntent. If the confirmation + # is successful, values present on the ConfirmationToken are written onto the Intent. + class ConfirmationToken < APIResource + OBJECT_NAME = "confirmation_token" + end +end diff --git a/lib/stripe/resources/customer.rb b/lib/stripe/resources/customer.rb index 29a584a20..7b643fb76 100644 --- a/lib/stripe/resources/customer.rb +++ b/lib/stripe/resources/customer.rb @@ -2,7 +2,7 @@ # frozen_string_literal: true module Stripe - # This object represents a customer of your business. It lets you create recurring charges and track payments that belong to the same customer. + # This object represents a customer of your business. Use it to create recurring charges and track payments that belong to the same customer. # # Related guide: [Save a card during payment](https://stripe.com/docs/payments/save-during-payment) class Customer < APIResource @@ -15,12 +15,9 @@ class Customer < APIResource OBJECT_NAME = "customer" - nested_resource_class_methods :balance_transaction, - operations: %i[create retrieve update list] - nested_resource_class_methods :cash_balance_transaction, - operations: %i[retrieve list] - nested_resource_class_methods :tax_id, - operations: %i[create retrieve delete list] + nested_resource_class_methods :balance_transaction, operations: %i[create retrieve update list] + nested_resource_class_methods :cash_balance_transaction, operations: %i[retrieve list] + nested_resource_class_methods :tax_id, operations: %i[create retrieve delete list] def create_funding_instructions(params = {}, opts = {}) request_stripe_object( @@ -85,12 +82,7 @@ def self.list_payment_methods(customer, params = {}, opts = {}) ) end - def self.retrieve_payment_method( - customer, - payment_method, - params = {}, - opts = {} - ) + def self.retrieve_payment_method(customer, payment_method, params = {}, opts = {}) request_stripe_object( method: :get, path: format("/v1/customers/%s/payment_methods/%s", { customer: CGI.escape(customer), payment_method: CGI.escape(payment_method) }), diff --git a/lib/stripe/resources/dispute.rb b/lib/stripe/resources/dispute.rb index 8f761c4dc..55e687726 100644 --- a/lib/stripe/resources/dispute.rb +++ b/lib/stripe/resources/dispute.rb @@ -3,10 +3,8 @@ module Stripe # A dispute occurs when a customer questions your charge with their card issuer. - # When this happens, you're given the opportunity to respond to the dispute with - # evidence that shows that the charge is legitimate. You can find more - # information about the dispute process in our [Disputes and - # Fraud](https://stripe.com/docs/disputes) documentation. + # When this happens, you have the opportunity to respond to the dispute with + # evidence that shows that the charge is legitimate. # # Related guide: [Disputes and fraud](https://stripe.com/docs/disputes) class Dispute < APIResource diff --git a/lib/stripe/resources/event.rb b/lib/stripe/resources/event.rb index d02134b18..d89ed826c 100644 --- a/lib/stripe/resources/event.rb +++ b/lib/stripe/resources/event.rb @@ -5,32 +5,33 @@ module Stripe # Events are our way of letting you know when something interesting happens in # your account. When an interesting event occurs, we create a new `Event` # object. For example, when a charge succeeds, we create a `charge.succeeded` - # event; and when an invoice payment attempt fails, we create an - # `invoice.payment_failed` event. Note that many API requests may cause multiple - # events to be created. For example, if you create a new subscription for a - # customer, you will receive both a `customer.subscription.created` event and a + # event, and when an invoice payment attempt fails, we create an + # `invoice.payment_failed` event. Certain API requests might create multiple + # events. For example, if you create a new subscription for a + # customer, you receive both a `customer.subscription.created` event and a # `charge.succeeded` event. # - # Events occur when the state of another API resource changes. The state of that - # resource at the time of the change is embedded in the event's data field. For - # example, a `charge.succeeded` event will contain a charge, and an - # `invoice.payment_failed` event will contain an invoice. + # Events occur when the state of another API resource changes. The event's data + # field embeds the resource's state at the time of the change. For + # example, a `charge.succeeded` event contains a charge, and an + # `invoice.payment_failed` event contains an invoice. # # As with other API resources, you can use endpoints to retrieve an # [individual event](https://stripe.com/docs/api#retrieve_event) or a [list of events](https://stripe.com/docs/api#list_events) # from the API. We also have a separate # [webhooks](http://en.wikipedia.org/wiki/Webhook) system for sending the - # `Event` objects directly to an endpoint on your server. Webhooks are managed - # in your - # [account settings](https://dashboard.stripe.com/account/webhooks), - # and our [Using Webhooks](https://stripe.com/docs/webhooks) guide will help you get set up. + # `Event` objects directly to an endpoint on your server. You can manage + # webhooks in your + # [account settings](https://dashboard.stripe.com/account/webhooks). Learn how + # to [listen for events] + # (/docs/webhooks) so that your integration can automatically trigger reactions. # - # When using [Connect](https://stripe.com/docs/connect), you can also receive notifications of - # events that occur in connected accounts. For these events, there will be an + # When using [Connect](https://stripe.com/docs/connect), you can also receive event notifications + # that occur in connected accounts. For these events, there's an # additional `account` attribute in the received `Event` object. # - # **NOTE:** Right now, access to events through the [Retrieve Event API](https://stripe.com/docs/api#retrieve_event) is - # guaranteed only for 30 days. + # We only guarantee access to events through the [Retrieve Event API](https://stripe.com/docs/api#retrieve_event) + # for 30 days. class Event < APIResource extend Stripe::APIOperations::List diff --git a/lib/stripe/resources/invoice.rb b/lib/stripe/resources/invoice.rb index edea63edc..eb6484638 100644 --- a/lib/stripe/resources/invoice.rb +++ b/lib/stripe/resources/invoice.rb @@ -134,12 +134,7 @@ def self.send_invoice(invoice, params = {}, opts = {}) end def self.upcoming(params = {}, opts = {}) - request_stripe_object( - method: :get, - path: "/v1/invoices/upcoming", - params: params, - opts: opts - ) + request_stripe_object(method: :get, path: "/v1/invoices/upcoming", params: params, opts: opts) end def self.void_invoice(invoice, params = {}, opts = {}) diff --git a/lib/stripe/resources/issuing/authorization.rb b/lib/stripe/resources/issuing/authorization.rb index 05a138375..fa250792b 100644 --- a/lib/stripe/resources/issuing/authorization.rb +++ b/lib/stripe/resources/issuing/authorization.rb @@ -49,6 +49,95 @@ def self.decline(authorization, params = {}, opts = {}) opts: opts ) end + + def test_helpers + TestHelpers.new(self) + end + + class TestHelpers < APIResourceTestHelpers + RESOURCE_CLASS = Authorization + + def self.capture(authorization, params = {}, opts = {}) + request_stripe_object( + method: :post, + path: format("/v1/test_helpers/issuing/authorizations/%s/capture", { authorization: CGI.escape(authorization) }), + params: params, + opts: opts + ) + end + + def self.create(params = {}, opts = {}) + request_stripe_object( + method: :post, + path: "/v1/test_helpers/issuing/authorizations", + params: params, + opts: opts + ) + end + + def self.expire(authorization, params = {}, opts = {}) + request_stripe_object( + method: :post, + path: format("/v1/test_helpers/issuing/authorizations/%s/expire", { authorization: CGI.escape(authorization) }), + params: params, + opts: opts + ) + end + + def self.increment(authorization, params = {}, opts = {}) + request_stripe_object( + method: :post, + path: format("/v1/test_helpers/issuing/authorizations/%s/increment", { authorization: CGI.escape(authorization) }), + params: params, + opts: opts + ) + end + + def self.reverse(authorization, params = {}, opts = {}) + request_stripe_object( + method: :post, + path: format("/v1/test_helpers/issuing/authorizations/%s/reverse", { authorization: CGI.escape(authorization) }), + params: params, + opts: opts + ) + end + + def capture(params = {}, opts = {}) + @resource.request_stripe_object( + method: :post, + path: format("/v1/test_helpers/issuing/authorizations/%s/capture", { authorization: CGI.escape(@resource["id"]) }), + params: params, + opts: opts + ) + end + + def expire(params = {}, opts = {}) + @resource.request_stripe_object( + method: :post, + path: format("/v1/test_helpers/issuing/authorizations/%s/expire", { authorization: CGI.escape(@resource["id"]) }), + params: params, + opts: opts + ) + end + + def increment(params = {}, opts = {}) + @resource.request_stripe_object( + method: :post, + path: format("/v1/test_helpers/issuing/authorizations/%s/increment", { authorization: CGI.escape(@resource["id"]) }), + params: params, + opts: opts + ) + end + + def reverse(params = {}, opts = {}) + @resource.request_stripe_object( + method: :post, + path: format("/v1/test_helpers/issuing/authorizations/%s/reverse", { authorization: CGI.escape(@resource["id"]) }), + params: params, + opts: opts + ) + end + end end end end diff --git a/lib/stripe/resources/issuing/card_design.rb b/lib/stripe/resources/issuing/card_design.rb index 21983cb5e..f7324b06c 100644 --- a/lib/stripe/resources/issuing/card_design.rb +++ b/lib/stripe/resources/issuing/card_design.rb @@ -5,6 +5,7 @@ module Stripe module Issuing # A Card Design is a logical grouping of a Card Bundle, card logo, and carrier text that represents a product line. class CardDesign < APIResource + extend Stripe::APIOperations::Create extend Stripe::APIOperations::List include Stripe::APIOperations::Save @@ -35,6 +36,15 @@ def self.deactivate_testmode(card_design, params = {}, opts = {}) ) end + def self.reject_testmode(card_design, params = {}, opts = {}) + request_stripe_object( + method: :post, + path: format("/v1/test_helpers/issuing/card_designs/%s/status/reject", { card_design: CGI.escape(card_design) }), + params: params, + opts: opts + ) + end + def activate_testmode(params = {}, opts = {}) @resource.request_stripe_object( method: :post, @@ -52,6 +62,15 @@ def deactivate_testmode(params = {}, opts = {}) opts: opts ) end + + def reject_testmode(params = {}, opts = {}) + @resource.request_stripe_object( + method: :post, + path: format("/v1/test_helpers/issuing/card_designs/%s/status/reject", { card_design: CGI.escape(@resource["id"]) }), + params: params, + opts: opts + ) + end end end end diff --git a/lib/stripe/resources/issuing/transaction.rb b/lib/stripe/resources/issuing/transaction.rb index 2b87d9991..9fc7e6a4f 100644 --- a/lib/stripe/resources/issuing/transaction.rb +++ b/lib/stripe/resources/issuing/transaction.rb @@ -13,6 +13,50 @@ class Transaction < APIResource include Stripe::APIOperations::Save OBJECT_NAME = "issuing.transaction" + + def test_helpers + TestHelpers.new(self) + end + + class TestHelpers < APIResourceTestHelpers + RESOURCE_CLASS = Transaction + + def self.create_force_capture(params = {}, opts = {}) + request_stripe_object( + method: :post, + path: "/v1/test_helpers/issuing/transactions/create_force_capture", + params: params, + opts: opts + ) + end + + def self.create_unlinked_refund(params = {}, opts = {}) + request_stripe_object( + method: :post, + path: "/v1/test_helpers/issuing/transactions/create_unlinked_refund", + params: params, + opts: opts + ) + end + + def self.refund(transaction, params = {}, opts = {}) + request_stripe_object( + method: :post, + path: format("/v1/test_helpers/issuing/transactions/%s/refund", { transaction: CGI.escape(transaction) }), + params: params, + opts: opts + ) + end + + def refund(params = {}, opts = {}) + @resource.request_stripe_object( + method: :post, + path: format("/v1/test_helpers/issuing/transactions/%s/refund", { transaction: CGI.escape(@resource["id"]) }), + params: params, + opts: opts + ) + end + end end end end diff --git a/lib/stripe/resources/quote.rb b/lib/stripe/resources/quote.rb index 216323b0f..a752cdd7a 100644 --- a/lib/stripe/resources/quote.rb +++ b/lib/stripe/resources/quote.rb @@ -13,8 +13,7 @@ class Quote < APIResource OBJECT_NAME = "quote" nested_resource_class_methods :preview_invoice, operations: %i[list] - nested_resource_class_methods :preview_subscription_schedule, - operations: %i[list] + nested_resource_class_methods :preview_subscription_schedule, operations: %i[list] def accept(params = {}, opts = {}) request_stripe_object( @@ -202,12 +201,7 @@ def self.pdf(quote, params = {}, opts = {}, &read_body_chunk_block) ) end - def self.preview_invoice_lines( - quote, - preview_invoice, - params = {}, - opts = {} - ) + def self.preview_invoice_lines(quote, preview_invoice, params = {}, opts = {}) request_stripe_object( method: :get, path: format("/v1/quotes/%s/preview_invoices/%s/lines", { quote: CGI.escape(quote), preview_invoice: CGI.escape(preview_invoice) }), diff --git a/lib/stripe/resources/source.rb b/lib/stripe/resources/source.rb index d474f59d9..425b3a229 100644 --- a/lib/stripe/resources/source.rb +++ b/lib/stripe/resources/source.rb @@ -19,8 +19,7 @@ class Source < APIResource OBJECT_NAME = "source" - nested_resource_class_methods :source_transaction, - operations: %i[retrieve list] + nested_resource_class_methods :source_transaction, operations: %i[retrieve list] def verify(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/transfer.rb b/lib/stripe/resources/transfer.rb index b8beb46fe..cedeb5bd7 100644 --- a/lib/stripe/resources/transfer.rb +++ b/lib/stripe/resources/transfer.rb @@ -20,7 +20,6 @@ class Transfer < APIResource OBJECT_NAME = "transfer" - nested_resource_class_methods :reversal, - operations: %i[create retrieve update list] + nested_resource_class_methods :reversal, operations: %i[create retrieve update list] end end diff --git a/lib/stripe/resources/treasury/outbound_transfer.rb b/lib/stripe/resources/treasury/outbound_transfer.rb index 82c39ac05..728c63e95 100644 --- a/lib/stripe/resources/treasury/outbound_transfer.rb +++ b/lib/stripe/resources/treasury/outbound_transfer.rb @@ -55,11 +55,7 @@ def self.post(outbound_transfer, params = {}, opts = {}) ) end - def self.return_outbound_transfer( - outbound_transfer, - params = {}, - opts = {} - ) + def self.return_outbound_transfer(outbound_transfer, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/test_helpers/treasury/outbound_transfers/%s/return", { outbound_transfer: CGI.escape(outbound_transfer) }), diff --git a/test/stripe/generated_examples_test.rb b/test/stripe/generated_examples_test.rb index 2562189a6..e7830b91c 100644 --- a/test/stripe/generated_examples_test.rb +++ b/test/stripe/generated_examples_test.rb @@ -1,6 +1,6 @@ +# File generated from our OpenAPI spec # frozen_string_literal: true -# File generated from our OpenAPI spec require ::File.expand_path("../test_helper", __dir__) module Stripe class CodegennedExampleTest < Test::Unit::TestCase @@ -50,10 +50,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "Account.update" do should "support requests with args: metadata, id" do - Stripe::Account.update( - "acct_xxxxxxxxxxxxx", - { metadata: { order_id: "6735" } } - ) + Stripe::Account.update("acct_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } }) assert_requested :post, "#{Stripe.api_base}/v1/accounts/acct_xxxxxxxxxxxxx" end end @@ -88,10 +85,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "ApplicationFeeRefund.retrieve" do should "support requests with args: parent_id, id" do - Stripe::ApplicationFee.retrieve_refund( - "fee_xxxxxxxxxxxxx", - "fr_xxxxxxxxxxxxx" - ) + Stripe::ApplicationFee.retrieve_refund("fee_xxxxxxxxxxxxx", "fr_xxxxxxxxxxxxx") assert_requested :get, "#{Stripe.api_base}/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx?" end end @@ -230,20 +224,13 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "Capability.retrieve" do should "support requests with args: parent_id, id" do - Stripe::Account.retrieve_capability( - "acct_xxxxxxxxxxxxx", - "card_payments" - ) + Stripe::Account.retrieve_capability("acct_xxxxxxxxxxxxx", "card_payments") assert_requested :get, "#{Stripe.api_base}/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments?" end end context "Capability.update" do should "support requests with args: requested, parent_id, id" do - Stripe::Account.update_capability( - "acct_xxxxxxxxxxxxx", - "card_payments", - { requested: true } - ) + Stripe::Account.update_capability("acct_xxxxxxxxxxxxx", "card_payments", { requested: true }) assert_requested :post, "#{Stripe.api_base}/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments" end end @@ -255,10 +242,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "CashBalance.update" do should "support requests with args: customer, settings" do - Stripe::Customer.update_cash_balance( - "cus_123", - { settings: { reconciliation_mode: "manual" } } - ) + Stripe::Customer.update_cash_balance("cus_123", { settings: { reconciliation_mode: "manual" } }) assert_requested :post, "#{Stripe.api_base}/v1/customers/cus_123/cash_balance" end end @@ -293,18 +277,13 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "Charge.search" do should "support requests with args: query" do - Stripe::Charge.search({ - query: "amount>999 AND metadata['order_id']:'6735'", - }) + Stripe::Charge.search({ query: "amount>999 AND metadata['order_id']:'6735'" }) assert_requested :get, "#{Stripe.api_base}/v1/charges/search?query=amount>999 AND metadata['order_id']:'6735'" end end context "Charge.update" do should "support requests with args: metadata, id" do - Stripe::Charge.update( - "ch_xxxxxxxxxxxxx", - { metadata: { order_id: "6735" } } - ) + Stripe::Charge.update("ch_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } }) assert_requested :post, "#{Stripe.api_base}/v1/charges/ch_xxxxxxxxxxxxx" end end @@ -508,10 +487,7 @@ class CodegennedExampleTest < Test::Unit::TestCase assert_requested :get, "#{Stripe.api_base}/v1/customers/cus_xyz/payment_methods?type=card" end should "support requests with args: type, parent_id" do - Stripe::Customer.list_payment_methods( - "cus_xxxxxxxxxxxxx", - { type: "card" } - ) + Stripe::Customer.list_payment_methods("cus_xxxxxxxxxxxxx", { type: "card" }) assert_requested :get, "#{Stripe.api_base}/v1/customers/cus_xxxxxxxxxxxxx/payment_methods?type=card" end end @@ -523,42 +499,29 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "Customer.search" do should "support requests with args: query" do - Stripe::Customer.search({ - query: "name:'fakename' AND metadata['foo']:'bar'", - }) + Stripe::Customer.search({ query: "name:'fakename' AND metadata['foo']:'bar'" }) assert_requested :get, "#{Stripe.api_base}/v1/customers/search?query=name:'fakename' AND metadata['foo']:'bar'" end should "support requests with args: query2" do - Stripe::Customer.search({ - query: "name:'fakename' AND metadata['foo']:'bar'", - }) + Stripe::Customer.search({ query: "name:'fakename' AND metadata['foo']:'bar'" }) assert_requested :get, "#{Stripe.api_base}/v1/customers/search?query=name:'fakename' AND metadata['foo']:'bar'" end end context "Customer.update" do should "support requests with args: metadata, id" do - Stripe::Customer.update( - "cus_xxxxxxxxxxxxx", - { metadata: { order_id: "6735" } } - ) + Stripe::Customer.update("cus_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } }) assert_requested :post, "#{Stripe.api_base}/v1/customers/cus_xxxxxxxxxxxxx" end end context "CustomerBalanceTransaction.list" do should "support requests with args: limit, parent_id" do - Stripe::Customer.list_balance_transactions( - "cus_xxxxxxxxxxxxx", - { limit: 3 } - ) + Stripe::Customer.list_balance_transactions("cus_xxxxxxxxxxxxx", { limit: 3 }) assert_requested :get, "#{Stripe.api_base}/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions?limit=3" end end context "CustomerBalanceTransaction.retrieve" do should "support requests with args: parent_id, id" do - Stripe::Customer.retrieve_balance_transaction( - "cus_xxxxxxxxxxxxx", - "cbtxn_xxxxxxxxxxxxx" - ) + Stripe::Customer.retrieve_balance_transaction("cus_xxxxxxxxxxxxx", "cbtxn_xxxxxxxxxxxxx") assert_requested :get, "#{Stripe.api_base}/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx?" end end @@ -592,10 +555,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "Dispute.update" do should "support requests with args: metadata, id" do - Stripe::Dispute.update( - "dp_xxxxxxxxxxxxx", - { metadata: { order_id: "6735" } } - ) + Stripe::Dispute.update("dp_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } }) assert_requested :post, "#{Stripe.api_base}/v1/disputes/dp_xxxxxxxxxxxxx" end end @@ -629,17 +589,11 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "ExternalAccount.delete" do should "support requests with args: parent_id, id" do - Stripe::Account.delete_external_account( - "acct_xxxxxxxxxxxxx", - "ba_xxxxxxxxxxxxx" - ) + Stripe::Account.delete_external_account("acct_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx") assert_requested :delete, "#{Stripe.api_base}/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx?" end should "support requests with args: parent_id, id2" do - Stripe::Account.delete_external_account( - "acct_xxxxxxxxxxxxx", - "card_xxxxxxxxxxxxx" - ) + Stripe::Account.delete_external_account("acct_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx") assert_requested :delete, "#{Stripe.api_base}/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx?" end end @@ -699,10 +653,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "FileLink.update" do should "support requests with args: metadata, id" do - Stripe::FileLink.update( - "link_xxxxxxxxxxxxx", - { metadata: { order_id: "6735" } } - ) + Stripe::FileLink.update("link_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } }) assert_requested :post, "#{Stripe.api_base}/v1/file_links/link_xxxxxxxxxxxxx" end end @@ -730,10 +681,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "FinancialConnections.Account.list_owners" do should "support requests with args: account, ownership" do - Stripe::FinancialConnections::Account.list_owners( - "fca_xyz", - { ownership: "fcaowns_xyz" } - ) + Stripe::FinancialConnections::Account.list_owners("fca_xyz", { ownership: "fcaowns_xyz" }) assert_requested :get, "#{Stripe.api_base}/v1/financial_connections/accounts/fca_xyz/owners?ownership=fcaowns_xyz" end should "support requests with args: limit, ownership, parent_id" do @@ -749,10 +697,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "FinancialConnections.Account.refresh_account" do should "support requests with args: account, features" do - Stripe::FinancialConnections::Account.refresh_account( - "fca_xyz", - { features: ["balance"] } - ) + Stripe::FinancialConnections::Account.refresh_account("fca_xyz", { features: ["balance"] }) assert_requested :post, "#{Stripe.api_base}/v1/financial_connections/accounts/fca_xyz/refresh" end end @@ -843,10 +788,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "Identity.VerificationSession.update" do should "support requests with args: type, id" do - Stripe::Identity::VerificationSession.update( - "vs_xxxxxxxxxxxxx", - { type: "id_number" } - ) + Stripe::Identity::VerificationSession.update("vs_xxxxxxxxxxxxx", { type: "id_number" }) assert_requested :post, "#{Stripe.api_base}/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx" end end @@ -901,9 +843,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "Invoice.search" do should "support requests with args: query" do - Stripe::Invoice.search({ - query: "total>999 AND metadata['order_id']:'6735'", - }) + Stripe::Invoice.search({ query: "total>999 AND metadata['order_id']:'6735'" }) assert_requested :get, "#{Stripe.api_base}/v1/invoices/search?query=total>999 AND metadata['order_id']:'6735'" end end @@ -921,10 +861,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "Invoice.update" do should "support requests with args: metadata, id" do - Stripe::Invoice.update( - "in_xxxxxxxxxxxxx", - { metadata: { order_id: "6735" } } - ) + Stripe::Invoice.update("in_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } }) assert_requested :post, "#{Stripe.api_base}/v1/invoices/in_xxxxxxxxxxxxx" end end @@ -963,10 +900,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "InvoiceItem.update" do should "support requests with args: metadata, id" do - Stripe::InvoiceItem.update( - "ii_xxxxxxxxxxxxx", - { metadata: { order_id: "6735" } } - ) + Stripe::InvoiceItem.update("ii_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } }) assert_requested :post, "#{Stripe.api_base}/v1/invoiceitems/ii_xxxxxxxxxxxxx" end end @@ -976,12 +910,113 @@ class CodegennedExampleTest < Test::Unit::TestCase assert_requested :post, "#{Stripe.api_base}/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/approve?" end end + context "Issuing.Authorization.capture" do + should "support requests with args: authorization, capture_amount, close_authorization, purchase_details" do + Stripe::Issuing::Authorization::TestHelpers.capture( + "example_authorization", + { + capture_amount: 100, + close_authorization: true, + purchase_details: { + flight: { + departure_at: 1_633_651_200, + passenger_name: "John Doe", + refundable: true, + segments: [ + { + arrival_airport_code: "SFO", + carrier: "Delta", + departure_airport_code: "LAX", + flight_number: "DL100", + service_class: "Economy", + stopover_allowed: true, + }, + ], + travel_agency: "Orbitz", + }, + fuel: { + type: "diesel", + unit: "liter", + unit_cost_decimal: "3.5", + volume_decimal: "10", + }, + lodging: { + check_in_at: 1_633_651_200, + nights: 2, + }, + receipt: [ + { + description: "Room charge", + quantity: "1", + total: 200, + unit_cost: 200, + }, + ], + reference: "foo", + }, + } + ) + assert_requested :post, "#{Stripe.api_base}/v1/test_helpers/issuing/authorizations/example_authorization/capture" + end + end + context "Issuing.Authorization.create" do + should "support requests with args: amount, amount_details, authorization_method, card, currency, is_amount_controllable, merchant_data, network_data, verification_data, wallet" do + Stripe::Issuing::Authorization::TestHelpers.create({ + amount: 100, + amount_details: { + atm_fee: 10, + cashback_amount: 5, + }, + authorization_method: "chip", + card: "foo", + currency: "usd", + is_amount_controllable: true, + merchant_data: { + category: "ac_refrigeration_repair", + city: "foo", + country: "bar", + name: "foo", + network_id: "bar", + postal_code: "foo", + state: "bar", + terminal_id: "foo", + }, + network_data: { acquiring_institution_id: "foo" }, + verification_data: { + address_line1_check: "mismatch", + address_postal_code_check: "match", + cvc_check: "match", + expiry_check: "mismatch", + }, + wallet: "apple_pay", + }) + assert_requested :post, "#{Stripe.api_base}/v1/test_helpers/issuing/authorizations" + end + end context "Issuing.Authorization.decline" do should "support requests with args: id" do Stripe::Issuing::Authorization.decline("iauth_xxxxxxxxxxxxx") assert_requested :post, "#{Stripe.api_base}/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/decline?" end end + context "Issuing.Authorization.expire" do + should "support requests with args: authorization" do + Stripe::Issuing::Authorization::TestHelpers.expire("example_authorization") + assert_requested :post, "#{Stripe.api_base}/v1/test_helpers/issuing/authorizations/example_authorization/expire?" + end + end + context "Issuing.Authorization.increment" do + should "support requests with args: authorization, increment_amount, is_amount_controllable" do + Stripe::Issuing::Authorization::TestHelpers.increment( + "example_authorization", + { + increment_amount: 50, + is_amount_controllable: true, + } + ) + assert_requested :post, "#{Stripe.api_base}/v1/test_helpers/issuing/authorizations/example_authorization/increment" + end + end context "Issuing.Authorization.list" do should "support requests with args: limit" do Stripe::Issuing::Authorization.list({ limit: 3 }) @@ -994,12 +1029,18 @@ class CodegennedExampleTest < Test::Unit::TestCase assert_requested :get, "#{Stripe.api_base}/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx?" end end + context "Issuing.Authorization.reverse" do + should "support requests with args: authorization, reverse_amount" do + Stripe::Issuing::Authorization::TestHelpers.reverse( + "example_authorization", + { reverse_amount: 20 } + ) + assert_requested :post, "#{Stripe.api_base}/v1/test_helpers/issuing/authorizations/example_authorization/reverse" + end + end context "Issuing.Authorization.update" do should "support requests with args: metadata, id" do - Stripe::Issuing::Authorization.update( - "iauth_xxxxxxxxxxxxx", - { metadata: { order_id: "6735" } } - ) + Stripe::Issuing::Authorization.update("iauth_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } }) assert_requested :post, "#{Stripe.api_base}/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx" end end @@ -1051,10 +1092,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "Issuing.Card.update" do should "support requests with args: metadata, id" do - Stripe::Issuing::Card.update( - "ic_xxxxxxxxxxxxx", - { metadata: { order_id: "6735" } } - ) + Stripe::Issuing::Card.update("ic_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } }) assert_requested :post, "#{Stripe.api_base}/v1/issuing/cards/ic_xxxxxxxxxxxxx" end end @@ -1092,10 +1130,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "Issuing.Cardholder.update" do should "support requests with args: metadata, id" do - Stripe::Issuing::Cardholder.update( - "ich_xxxxxxxxxxxxx", - { metadata: { order_id: "6735" } } - ) + Stripe::Issuing::Cardholder.update("ich_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } }) assert_requested :post, "#{Stripe.api_base}/v1/issuing/cardholders/ich_xxxxxxxxxxxxx" end end @@ -1129,12 +1164,132 @@ class CodegennedExampleTest < Test::Unit::TestCase assert_requested :post, "#{Stripe.api_base}/v1/issuing/disputes/idp_xxxxxxxxxxxxx/submit?" end end + context "Issuing.Transaction.create_force_capture" do + should "support requests with args: amount, card, currency, merchant_data, purchase_details" do + Stripe::Issuing::Transaction::TestHelpers.create_force_capture({ + amount: 100, + card: "foo", + currency: "usd", + merchant_data: { + category: "ac_refrigeration_repair", + city: "foo", + country: "US", + name: "foo", + network_id: "bar", + postal_code: "10001", + state: "NY", + terminal_id: "foo", + }, + purchase_details: { + flight: { + departure_at: 1_633_651_200, + passenger_name: "John Doe", + refundable: true, + segments: [ + { + arrival_airport_code: "SFO", + carrier: "Delta", + departure_airport_code: "LAX", + flight_number: "DL100", + service_class: "Economy", + stopover_allowed: true, + }, + ], + travel_agency: "Orbitz", + }, + fuel: { + type: "diesel", + unit: "liter", + unit_cost_decimal: "3.5", + volume_decimal: "10", + }, + lodging: { + check_in_at: 1_533_651_200, + nights: 2, + }, + receipt: [ + { + description: "Room charge", + quantity: "1", + total: 200, + unit_cost: 200, + }, + ], + reference: "foo", + }, + }) + assert_requested :post, "#{Stripe.api_base}/v1/test_helpers/issuing/transactions/create_force_capture" + end + end + context "Issuing.Transaction.create_unlinked_refund" do + should "support requests with args: amount, card, currency, merchant_data, purchase_details" do + Stripe::Issuing::Transaction::TestHelpers.create_unlinked_refund({ + amount: 100, + card: "foo", + currency: "usd", + merchant_data: { + category: "ac_refrigeration_repair", + city: "foo", + country: "bar", + name: "foo", + network_id: "bar", + postal_code: "foo", + state: "bar", + terminal_id: "foo", + }, + purchase_details: { + flight: { + departure_at: 1_533_651_200, + passenger_name: "John Doe", + refundable: true, + segments: [ + { + arrival_airport_code: "SFO", + carrier: "Delta", + departure_airport_code: "LAX", + flight_number: "DL100", + service_class: "Economy", + stopover_allowed: true, + }, + ], + travel_agency: "Orbitz", + }, + fuel: { + type: "diesel", + unit: "liter", + unit_cost_decimal: "3.5", + volume_decimal: "10", + }, + lodging: { + check_in_at: 1_533_651_200, + nights: 2, + }, + receipt: [ + { + description: "Room charge", + quantity: "1", + total: 200, + unit_cost: 200, + }, + ], + reference: "foo", + }, + }) + assert_requested :post, "#{Stripe.api_base}/v1/test_helpers/issuing/transactions/create_unlinked_refund" + end + end context "Issuing.Transaction.list" do should "support requests with args: limit" do Stripe::Issuing::Transaction.list({ limit: 3 }) assert_requested :get, "#{Stripe.api_base}/v1/issuing/transactions?limit=3" end end + context "Issuing.Transaction.refund" do + should "support requests with args: transaction, refund_amount" do + Stripe::Issuing::Transaction::TestHelpers.refund("example_transaction", { refund_amount: 50 }) + assert_requested :post, "#{Stripe.api_base}/v1/test_helpers/issuing/transactions/example_transaction/refund" + end + end context "Issuing.Transaction.retrieve" do should "support requests with args: id" do Stripe::Issuing::Transaction.retrieve("ipi_xxxxxxxxxxxxx") @@ -1143,10 +1298,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "Issuing.Transaction.update" do should "support requests with args: metadata, id" do - Stripe::Issuing::Transaction.update( - "ipi_xxxxxxxxxxxxx", - { metadata: { order_id: "6735" } } - ) + Stripe::Issuing::Transaction.update("ipi_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } }) assert_requested :post, "#{Stripe.api_base}/v1/issuing/transactions/ipi_xxxxxxxxxxxxx" end end @@ -1176,10 +1328,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "PaymentIntent.confirm" do should "support requests with args: payment_method, id" do - Stripe::PaymentIntent.confirm( - "pi_xxxxxxxxxxxxx", - { payment_method: "pm_card_visa" } - ) + Stripe::PaymentIntent.confirm("pi_xxxxxxxxxxxxx", { payment_method: "pm_card_visa" }) assert_requested :post, "#{Stripe.api_base}/v1/payment_intents/pi_xxxxxxxxxxxxx/confirm" end end @@ -1214,10 +1363,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "PaymentIntent.increment_authorization" do should "support requests with args: amount, id" do - Stripe::PaymentIntent.increment_authorization( - "pi_xxxxxxxxxxxxx", - { amount: 2099 } - ) + Stripe::PaymentIntent.increment_authorization("pi_xxxxxxxxxxxxx", { amount: 2099 }) assert_requested :post, "#{Stripe.api_base}/v1/payment_intents/pi_xxxxxxxxxxxxx/increment_authorization" end end @@ -1243,10 +1389,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "PaymentIntent.update" do should "support requests with args: metadata, id" do - Stripe::PaymentIntent.update( - "pi_xxxxxxxxxxxxx", - { metadata: { order_id: "6735" } } - ) + Stripe::PaymentIntent.update("pi_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } }) assert_requested :post, "#{Stripe.api_base}/v1/payment_intents/pi_xxxxxxxxxxxxx" end end @@ -1256,10 +1399,7 @@ class CodegennedExampleTest < Test::Unit::TestCase assert_requested :post, "#{Stripe.api_base}/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits?" end should "support requests with args: amounts, id" do - Stripe::PaymentIntent.verify_microdeposits( - "pi_xxxxxxxxxxxxx", - { amounts: [32, 45] } - ) + Stripe::PaymentIntent.verify_microdeposits("pi_xxxxxxxxxxxxx", { amounts: [32, 45] }) assert_requested :post, "#{Stripe.api_base}/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits" end end @@ -1317,10 +1457,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "PaymentMethod.attach" do should "support requests with args: customer, id" do - Stripe::PaymentMethod.attach( - "pm_xxxxxxxxxxxxx", - { customer: "cus_xxxxxxxxxxxxx" } - ) + Stripe::PaymentMethod.attach("pm_xxxxxxxxxxxxx", { customer: "cus_xxxxxxxxxxxxx" }) assert_requested :post, "#{Stripe.api_base}/v1/payment_methods/pm_xxxxxxxxxxxxx/attach" end end @@ -1361,26 +1498,47 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "PaymentMethod.update" do should "support requests with args: metadata, id" do - Stripe::PaymentMethod.update( - "pm_xxxxxxxxxxxxx", - { metadata: { order_id: "6735" } } - ) + Stripe::PaymentMethod.update("pm_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } }) assert_requested :post, "#{Stripe.api_base}/v1/payment_methods/pm_xxxxxxxxxxxxx" end end + context "PaymentMethodConfiguration.create" do + should "support requests with args: acss_debit, affirm" do + Stripe::PaymentMethodConfiguration.create({ + acss_debit: { display_preference: { preference: "none" } }, + affirm: { display_preference: { preference: "none" } }, + }) + assert_requested :post, "#{Stripe.api_base}/v1/payment_method_configurations" + end + end + context "PaymentMethodConfiguration.list" do + should "support requests with args: application" do + Stripe::PaymentMethodConfiguration.list({ application: "foo" }) + assert_requested :get, "#{Stripe.api_base}/v1/payment_method_configurations?application=foo" + end + end + context "PaymentMethodConfiguration.retrieve" do + should "support requests with args: configuration" do + Stripe::PaymentMethodConfiguration.retrieve("foo") + assert_requested :get, "#{Stripe.api_base}/v1/payment_method_configurations/foo?" + end + end + context "PaymentMethodConfiguration.update" do + should "support requests with args: configuration, acss_debit" do + Stripe::PaymentMethodConfiguration.update( + "foo", + { acss_debit: { display_preference: { preference: "on" } } } + ) + assert_requested :post, "#{Stripe.api_base}/v1/payment_method_configurations/foo" + end + end context "PaymentSource.create" do should "support requests with args: source, parent_id" do - Stripe::Customer.create_source( - "cus_xxxxxxxxxxxxx", - { source: "btok_xxxxxxxxxxxxx" } - ) + Stripe::Customer.create_source("cus_xxxxxxxxxxxxx", { source: "btok_xxxxxxxxxxxxx" }) assert_requested :post, "#{Stripe.api_base}/v1/customers/cus_xxxxxxxxxxxxx/sources" end should "support requests with args: source, parent_id2" do - Stripe::Customer.create_source( - "cus_xxxxxxxxxxxxx", - { source: "tok_xxxx" } - ) + Stripe::Customer.create_source("cus_xxxxxxxxxxxxx", { source: "tok_xxxx" }) assert_requested :post, "#{Stripe.api_base}/v1/customers/cus_xxxxxxxxxxxxx/sources" end end @@ -1408,17 +1566,11 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "PaymentSource.retrieve" do should "support requests with args: parent_id, id" do - Stripe::Customer.retrieve_source( - "cus_xxxxxxxxxxxxx", - "ba_xxxxxxxxxxxxx" - ) + Stripe::Customer.retrieve_source("cus_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx") assert_requested :get, "#{Stripe.api_base}/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx?" end should "support requests with args: parent_id, id2" do - Stripe::Customer.retrieve_source( - "cus_xxxxxxxxxxxxx", - "card_xxxxxxxxxxxxx" - ) + Stripe::Customer.retrieve_source("cus_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx") assert_requested :get, "#{Stripe.api_base}/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx?" end end @@ -1457,19 +1609,13 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "Payout.update" do should "support requests with args: metadata, id" do - Stripe::Payout.update( - "po_xxxxxxxxxxxxx", - { metadata: { order_id: "6735" } } - ) + Stripe::Payout.update("po_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } }) assert_requested :post, "#{Stripe.api_base}/v1/payouts/po_xxxxxxxxxxxxx" end end context "Person.retrieve" do should "support requests with args: parent_id, id" do - Stripe::Account.retrieve_person( - "acct_xxxxxxxxxxxxx", - "person_xxxxxxxxxxxxx" - ) + Stripe::Account.retrieve_person("acct_xxxxxxxxxxxxx", "person_xxxxxxxxxxxxx") assert_requested :get, "#{Stripe.api_base}/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx?" end end @@ -1523,10 +1669,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "Plan.update" do should "support requests with args: metadata, id" do - Stripe::Plan.update( - "price_xxxxxxxxxxxxx", - { metadata: { order_id: "6735" } } - ) + Stripe::Plan.update("price_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } }) assert_requested :post, "#{Stripe.api_base}/v1/plans/price_xxxxxxxxxxxxx" end end @@ -1568,18 +1711,13 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "Price.search" do should "support requests with args: query" do - Stripe::Price.search({ - query: "active:'true' AND metadata['order_id']:'6735'", - }) + Stripe::Price.search({ query: "active:'true' AND metadata['order_id']:'6735'" }) assert_requested :get, "#{Stripe.api_base}/v1/prices/search?query=active:'true' AND metadata['order_id']:'6735'" end end context "Price.update" do should "support requests with args: metadata, id" do - Stripe::Price.update( - "price_xxxxxxxxxxxxx", - { metadata: { order_id: "6735" } } - ) + Stripe::Price.update("price_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } }) assert_requested :post, "#{Stripe.api_base}/v1/prices/price_xxxxxxxxxxxxx" end end @@ -1609,18 +1747,13 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "Product.search" do should "support requests with args: query" do - Stripe::Product.search({ - query: "active:'true' AND metadata['order_id']:'6735'", - }) + Stripe::Product.search({ query: "active:'true' AND metadata['order_id']:'6735'" }) assert_requested :get, "#{Stripe.api_base}/v1/products/search?query=active:'true' AND metadata['order_id']:'6735'" end end context "Product.update" do should "support requests with args: metadata, id" do - Stripe::Product.update( - "prod_xxxxxxxxxxxxx", - { metadata: { order_id: "6735" } } - ) + Stripe::Product.update("prod_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } }) assert_requested :post, "#{Stripe.api_base}/v1/products/prod_xxxxxxxxxxxxx" end end @@ -1644,10 +1777,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "PromotionCode.update" do should "support requests with args: metadata, id" do - Stripe::PromotionCode.update( - "promo_xxxxxxxxxxxxx", - { metadata: { order_id: "6735" } } - ) + Stripe::PromotionCode.update("promo_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } }) assert_requested :post, "#{Stripe.api_base}/v1/promotion_codes/promo_xxxxxxxxxxxxx" end end @@ -1762,10 +1892,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "Radar.ValueList.update" do should "support requests with args: name, id" do - Stripe::Radar::ValueList.update( - "rsl_xxxxxxxxxxxxx", - { name: "Updated IP Block List" } - ) + Stripe::Radar::ValueList.update("rsl_xxxxxxxxxxxxx", { name: "Updated IP Block List" }) assert_requested :post, "#{Stripe.api_base}/v1/radar/value_lists/rsl_xxxxxxxxxxxxx" end end @@ -1831,10 +1958,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "Refund.update" do should "support requests with args: metadata, id" do - Stripe::Refund.update( - "re_xxxxxxxxxxxxx", - { metadata: { order_id: "6735" } } - ) + Stripe::Refund.update("re_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } }) assert_requested :post, "#{Stripe.api_base}/v1/refunds/re_xxxxxxxxxxxxx" end end @@ -1882,10 +2006,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "Reversal.retrieve" do should "support requests with args: parent_id, id" do - Stripe::Transfer.retrieve_reversal( - "tr_xxxxxxxxxxxxx", - "trr_xxxxxxxxxxxxx" - ) + Stripe::Transfer.retrieve_reversal("tr_xxxxxxxxxxxxx", "trr_xxxxxxxxxxxxx") assert_requested :get, "#{Stripe.api_base}/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx?" end end @@ -1934,10 +2055,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "SetupIntent.confirm" do should "support requests with args: payment_method, id" do - Stripe::SetupIntent.confirm( - "seti_xxxxxxxxxxxxx", - { payment_method: "pm_card_visa" } - ) + Stripe::SetupIntent.confirm("seti_xxxxxxxxxxxxx", { payment_method: "pm_card_visa" }) assert_requested :post, "#{Stripe.api_base}/v1/setup_intents/seti_xxxxxxxxxxxxx/confirm" end end @@ -1961,10 +2079,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "SetupIntent.update" do should "support requests with args: metadata, id" do - Stripe::SetupIntent.update( - "seti_xxxxxxxxxxxxx", - { metadata: { user_id: "3435453" } } - ) + Stripe::SetupIntent.update("seti_xxxxxxxxxxxxx", { metadata: { user_id: "3435453" } }) assert_requested :post, "#{Stripe.api_base}/v1/setup_intents/seti_xxxxxxxxxxxxx" end end @@ -1974,10 +2089,7 @@ class CodegennedExampleTest < Test::Unit::TestCase assert_requested :post, "#{Stripe.api_base}/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits?" end should "support requests with args: amounts, id" do - Stripe::SetupIntent.verify_microdeposits( - "seti_xxxxxxxxxxxxx", - { amounts: [32, 45] } - ) + Stripe::SetupIntent.verify_microdeposits("seti_xxxxxxxxxxxxx", { amounts: [32, 45] }) assert_requested :post, "#{Stripe.api_base}/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits" end end @@ -2023,10 +2135,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "ShippingRate.update" do should "support requests with args: metadata, id" do - Stripe::ShippingRate.update( - "shr_xxxxxxxxxxxxx", - { metadata: { order_id: "6735" } } - ) + Stripe::ShippingRate.update("shr_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } }) assert_requested :post, "#{Stripe.api_base}/v1/shipping_rates/shr_xxxxxxxxxxxxx" end end @@ -2054,10 +2163,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "Source.update" do should "support requests with args: metadata, id" do - Stripe::Source.update( - "src_xxxxxxxxxxxxx", - { metadata: { order_id: "6735" } } - ) + Stripe::Source.update("src_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } }) assert_requested :post, "#{Stripe.api_base}/v1/sources/src_xxxxxxxxxxxxx" end end @@ -2092,10 +2198,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "Subscription.update" do should "support requests with args: metadata, id" do - Stripe::Subscription.update( - "sub_xxxxxxxxxxxxx", - { metadata: { order_id: "6735" } } - ) + Stripe::Subscription.update("sub_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } }) assert_requested :post, "#{Stripe.api_base}/v1/subscriptions/sub_xxxxxxxxxxxxx" end end @@ -2129,10 +2232,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "SubscriptionItem.update" do should "support requests with args: metadata, id" do - Stripe::SubscriptionItem.update( - "si_xxxxxxxxxxxxx", - { metadata: { order_id: "6735" } } - ) + Stripe::SubscriptionItem.update("si_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } }) assert_requested :post, "#{Stripe.api_base}/v1/subscription_items/si_xxxxxxxxxxxxx" end end @@ -2183,10 +2283,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "SubscriptionSchedule.update" do should "support requests with args: end_behavior, id" do - Stripe::SubscriptionSchedule.update( - "sub_sched_xxxxxxxxxxxxx", - { end_behavior: "release" } - ) + Stripe::SubscriptionSchedule.update("sub_sched_xxxxxxxxxxxxx", { end_behavior: "release" }) assert_requested :post, "#{Stripe.api_base}/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx" end end @@ -2262,10 +2359,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "TaxId.retrieve" do should "support requests with args: id, parent_id" do - Stripe::Customer.retrieve_tax_id( - "cus_xxxxxxxxxxxxx", - "txi_xxxxxxxxxxxxx" - ) + Stripe::Customer.retrieve_tax_id("cus_xxxxxxxxxxxxx", "txi_xxxxxxxxxxxxx") assert_requested :get, "#{Stripe.api_base}/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx?" end end @@ -2343,10 +2437,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "Terminal.Configuration.update" do should "support requests with args: configuration, tipping" do - Stripe::Terminal::Configuration.update( - "uc_123", - { tipping: { usd: { fixed_amounts: [10] } } } - ) + Stripe::Terminal::Configuration.update("uc_123", { tipping: { usd: { fixed_amounts: [10] } } }) assert_requested :post, "#{Stripe.api_base}/v1/terminal/configurations/uc_123" end should "support requests with args: bbpos_wisepos_e, id" do @@ -2398,10 +2489,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "Terminal.Location.update" do should "support requests with args: display_name, id" do - Stripe::Terminal::Location.update( - "tml_xxxxxxxxxxxxx", - { display_name: "My First Store" } - ) + Stripe::Terminal::Location.update("tml_xxxxxxxxxxxxx", { display_name: "My First Store" }) assert_requested :post, "#{Stripe.api_base}/v1/terminal/locations/tml_xxxxxxxxxxxxx" end end @@ -2462,10 +2550,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "Terminal.Reader.update" do should "support requests with args: label, id" do - Stripe::Terminal::Reader.update( - "tmr_xxxxxxxxxxxxx", - { label: "Blue Rabbit" } - ) + Stripe::Terminal::Reader.update("tmr_xxxxxxxxxxxxx", { label: "Blue Rabbit" }) assert_requested :post, "#{Stripe.api_base}/v1/terminal/readers/tmr_xxxxxxxxxxxxx" end end @@ -2475,10 +2560,7 @@ class CodegennedExampleTest < Test::Unit::TestCase assert_requested :post, "#{Stripe.api_base}/v1/test_helpers/test_clocks/clock_xyz/advance" end should "support requests with args: frozen_time, id" do - Stripe::TestHelpers::TestClock.advance( - "clock_xxxxxxxxxxxxx", - { frozen_time: 1_675_552_261 } - ) + Stripe::TestHelpers::TestClock.advance("clock_xxxxxxxxxxxxx", { frozen_time: 1_675_552_261 }) assert_requested :post, "#{Stripe.api_base}/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx/advance" end end @@ -2647,18 +2729,13 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "Transfer.update" do should "support requests with args: metadata, id" do - Stripe::Transfer.update( - "tr_xxxxxxxxxxxxx", - { metadata: { order_id: "6735" } } - ) + Stripe::Transfer.update("tr_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } }) assert_requested :post, "#{Stripe.api_base}/v1/transfers/tr_xxxxxxxxxxxxx" end end context "Treasury.CreditReversal.create" do should "support requests with args: received_credit" do - Stripe::Treasury::CreditReversal.create({ - received_credit: "rc_xxxxxxxxxxxxx", - }) + Stripe::Treasury::CreditReversal.create({ received_credit: "rc_xxxxxxxxxxxxx" }) assert_requested :post, "#{Stripe.api_base}/v1/treasury/credit_reversals" end end @@ -2679,9 +2756,7 @@ class CodegennedExampleTest < Test::Unit::TestCase end context "Treasury.DebitReversal.create" do should "support requests with args: received_debit" do - Stripe::Treasury::DebitReversal.create({ - received_debit: "rd_xxxxxxxxxxxxx", - }) + Stripe::Treasury::DebitReversal.create({ received_debit: "rd_xxxxxxxxxxxxx" }) assert_requested :post, "#{Stripe.api_base}/v1/treasury/debit_reversals" end end