From f94c2cb45ca9a15294fc37d0d885664d1f0f526b Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 8 Sep 2023 19:24:11 +0000 Subject: [PATCH 01/10] Update generated code for v518 --- OPENAPI_VERSION | 2 +- lib/stripe/resources/issuing/card_design.rb | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 2597d2c77..850194444 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v515 \ No newline at end of file +v518 \ No newline at end of file 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 From 0ea7c61bcf33e5acc8c170f390b6c15205ba032b Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 11 Sep 2023 16:50:27 +0000 Subject: [PATCH 02/10] Update generated code for v519 --- OPENAPI_VERSION | 2 +- lib/stripe/resources/issuing/authorization.rb | 89 +++++++++++++++++++ lib/stripe/resources/issuing/transaction.rb | 44 +++++++++ 3 files changed, 134 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 850194444..8c7e87b6a 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v518 \ No newline at end of file +v519 \ No newline at end of file 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/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 From 6ed6014b894c5612bcabdd83db09c46f4dec4ad0 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 11 Sep 2023 18:58:57 +0000 Subject: [PATCH 03/10] Update generated code for v522 --- OPENAPI_VERSION | 2 +- test/stripe/generated_examples_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 8c7e87b6a..30cf21dac 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v519 \ No newline at end of file +v522 \ No newline at end of file diff --git a/test/stripe/generated_examples_test.rb b/test/stripe/generated_examples_test.rb index 2562189a6..194fca7a8 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 From be4388721da37526b733e3ed69600caf7654bdb4 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 12 Sep 2023 14:35:29 +0000 Subject: [PATCH 04/10] Update generated code for v522 --- lib/stripe/resources/account.rb | 3 +- lib/stripe/resources/application_fee.rb | 3 +- lib/stripe/resources/customer.rb | 16 +- lib/stripe/resources/invoice.rb | 7 +- lib/stripe/resources/quote.rb | 10 +- lib/stripe/resources/source.rb | 3 +- lib/stripe/resources/transfer.rb | 3 +- .../resources/treasury/outbound_transfer.rb | 6 +- test/stripe/generated_examples_test.rb | 313 ++++-------------- 9 files changed, 76 insertions(+), 288 deletions(-) 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/customer.rb b/lib/stripe/resources/customer.rb index 29a584a20..fc74621bc 100644 --- a/lib/stripe/resources/customer.rb +++ b/lib/stripe/resources/customer.rb @@ -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/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/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 194fca7a8..41998da06 100644 --- a/test/stripe/generated_examples_test.rb +++ b/test/stripe/generated_examples_test.rb @@ -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 @@ -996,10 +930,7 @@ class CodegennedExampleTest < Test::Unit::TestCase 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 +982,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 +1020,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 @@ -1143,10 +1068,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 +1098,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 +1133,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 +1159,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 +1169,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 +1227,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 +1268,17 @@ 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 "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 +1306,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 +1349,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 +1409,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 +1451,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 +1487,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 +1517,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 +1632,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 +1698,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 +1746,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 +1795,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 +1819,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 +1829,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 +1875,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 +1903,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 +1938,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 +1972,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 +2023,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 +2099,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 +2177,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 +2229,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 +2290,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 +2300,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 +2469,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 +2496,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 From 3165ed59053a285bf659525165ccf07656fc29c1 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 13 Sep 2023 15:42:40 +0000 Subject: [PATCH 05/10] Update generated code for v525 --- OPENAPI_VERSION | 2 +- lib/stripe/resources/account.rb | 3 +- lib/stripe/resources/application_fee.rb | 3 +- lib/stripe/resources/customer.rb | 16 +- lib/stripe/resources/invoice.rb | 7 +- lib/stripe/resources/quote.rb | 10 +- lib/stripe/resources/source.rb | 3 +- lib/stripe/resources/transfer.rb | 3 +- .../resources/treasury/outbound_transfer.rb | 6 +- test/stripe/generated_examples_test.rb | 315 ++++++++++++++---- 10 files changed, 290 insertions(+), 78 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 30cf21dac..ca2b1285d 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v522 \ No newline at end of file +v525 \ No newline at end of file diff --git a/lib/stripe/resources/account.rb b/lib/stripe/resources/account.rb index 88811d67b..68e6e334e 100644 --- a/lib/stripe/resources/account.rb +++ b/lib/stripe/resources/account.rb @@ -23,7 +23,8 @@ 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 7e75cd1b4..dd8a56c6e 100644 --- a/lib/stripe/resources/application_fee.rb +++ b/lib/stripe/resources/application_fee.rb @@ -8,6 +8,7 @@ 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/customer.rb b/lib/stripe/resources/customer.rb index fc74621bc..29a584a20 100644 --- a/lib/stripe/resources/customer.rb +++ b/lib/stripe/resources/customer.rb @@ -15,9 +15,12 @@ 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( @@ -82,7 +85,12 @@ 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/invoice.rb b/lib/stripe/resources/invoice.rb index eb6484638..edea63edc 100644 --- a/lib/stripe/resources/invoice.rb +++ b/lib/stripe/resources/invoice.rb @@ -134,7 +134,12 @@ 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/quote.rb b/lib/stripe/resources/quote.rb index a752cdd7a..216323b0f 100644 --- a/lib/stripe/resources/quote.rb +++ b/lib/stripe/resources/quote.rb @@ -13,7 +13,8 @@ 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( @@ -201,7 +202,12 @@ 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 425b3a229..d474f59d9 100644 --- a/lib/stripe/resources/source.rb +++ b/lib/stripe/resources/source.rb @@ -19,7 +19,8 @@ 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 cedeb5bd7..b8beb46fe 100644 --- a/lib/stripe/resources/transfer.rb +++ b/lib/stripe/resources/transfer.rb @@ -20,6 +20,7 @@ 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 728c63e95..82c39ac05 100644 --- a/lib/stripe/resources/treasury/outbound_transfer.rb +++ b/lib/stripe/resources/treasury/outbound_transfer.rb @@ -55,7 +55,11 @@ 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 41998da06..2562189a6 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,7 +50,10 @@ 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 @@ -85,7 +88,10 @@ 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 @@ -224,13 +230,20 @@ 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 @@ -242,7 +255,10 @@ 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 @@ -277,13 +293,18 @@ 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 @@ -487,7 +508,10 @@ 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 @@ -499,29 +523,42 @@ 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 @@ -555,7 +592,10 @@ 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 @@ -589,11 +629,17 @@ 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 @@ -653,7 +699,10 @@ 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 @@ -681,7 +730,10 @@ 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 @@ -697,7 +749,10 @@ 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 @@ -788,7 +843,10 @@ 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 @@ -843,7 +901,9 @@ 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 @@ -861,7 +921,10 @@ 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 @@ -900,7 +963,10 @@ 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 @@ -930,7 +996,10 @@ class CodegennedExampleTest < Test::Unit::TestCase 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 @@ -982,7 +1051,10 @@ 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 @@ -1020,7 +1092,10 @@ 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 @@ -1068,7 +1143,10 @@ 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 @@ -1098,7 +1176,10 @@ 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 @@ -1133,7 +1214,10 @@ 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 @@ -1159,7 +1243,10 @@ 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 @@ -1169,7 +1256,10 @@ 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 @@ -1227,7 +1317,10 @@ 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 @@ -1268,17 +1361,26 @@ 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 "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 @@ -1306,11 +1408,17 @@ 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 @@ -1349,13 +1457,19 @@ 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 @@ -1409,7 +1523,10 @@ 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 @@ -1451,13 +1568,18 @@ 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 @@ -1487,13 +1609,18 @@ 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 @@ -1517,7 +1644,10 @@ 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 @@ -1632,7 +1762,10 @@ 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 @@ -1698,7 +1831,10 @@ 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 @@ -1746,7 +1882,10 @@ 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 @@ -1795,7 +1934,10 @@ 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 @@ -1819,7 +1961,10 @@ 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 @@ -1829,7 +1974,10 @@ 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 @@ -1875,7 +2023,10 @@ 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 @@ -1903,7 +2054,10 @@ 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 @@ -1938,7 +2092,10 @@ 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 @@ -1972,7 +2129,10 @@ 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 @@ -2023,7 +2183,10 @@ 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 @@ -2099,7 +2262,10 @@ 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 @@ -2177,7 +2343,10 @@ 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 @@ -2229,7 +2398,10 @@ 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 @@ -2290,7 +2462,10 @@ 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 @@ -2300,7 +2475,10 @@ 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 @@ -2469,13 +2647,18 @@ 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 @@ -2496,7 +2679,9 @@ 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 From 1ef9ff4b886a9fc29663745072cbcdf55459436b Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 13 Sep 2023 16:46:29 +0000 Subject: [PATCH 06/10] Update generated code for v525 --- lib/stripe/resources/account.rb | 3 +- lib/stripe/resources/application_fee.rb | 3 +- lib/stripe/resources/customer.rb | 16 +- lib/stripe/resources/invoice.rb | 7 +- lib/stripe/resources/quote.rb | 10 +- lib/stripe/resources/source.rb | 3 +- lib/stripe/resources/transfer.rb | 3 +- .../resources/treasury/outbound_transfer.rb | 6 +- test/stripe/generated_examples_test.rb | 315 ++++-------------- 9 files changed, 77 insertions(+), 289 deletions(-) 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/customer.rb b/lib/stripe/resources/customer.rb index 29a584a20..fc74621bc 100644 --- a/lib/stripe/resources/customer.rb +++ b/lib/stripe/resources/customer.rb @@ -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/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/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..41998da06 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 @@ -996,10 +930,7 @@ class CodegennedExampleTest < Test::Unit::TestCase 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 +982,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 +1020,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 @@ -1143,10 +1068,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 +1098,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 +1133,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 +1159,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 +1169,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 +1227,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 +1268,17 @@ 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 "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 +1306,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 +1349,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 +1409,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 +1451,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 +1487,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 +1517,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 +1632,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 +1698,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 +1746,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 +1795,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 +1819,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 +1829,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 +1875,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 +1903,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 +1938,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 +1972,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 +2023,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 +2099,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 +2177,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 +2229,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 +2290,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 +2300,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 +2469,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 +2496,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 From 568b3191c4718309c89fbb6ff6cff9d016493c99 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 13 Sep 2023 20:35:42 +0000 Subject: [PATCH 07/10] Update generated code for v526 --- OPENAPI_VERSION | 2 +- lib/stripe/object_types.rb | 1 + lib/stripe/resources.rb | 1 + lib/stripe/resources/confirmation_token.rb | 11 +++++++++++ 4 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 lib/stripe/resources/confirmation_token.rb diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index ca2b1285d..8fc461e62 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v525 \ No newline at end of file +v526 \ 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/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 From a1c164e2d8cfb7b87b39c9702278b8b2af0dc79a Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 14 Sep 2023 08:28:36 -0700 Subject: [PATCH 08/10] Update generated code (#1271) * Update generated code for v519 * Update generated code for v522 * Update generated code for v522 * Update generated code for v525 * Update generated code for v525 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- lib/stripe/resources/account.rb | 3 +- lib/stripe/resources/application_fee.rb | 3 +- lib/stripe/resources/customer.rb | 16 +- lib/stripe/resources/invoice.rb | 7 +- lib/stripe/resources/issuing/authorization.rb | 89 +++++ lib/stripe/resources/issuing/transaction.rb | 44 +++ lib/stripe/resources/source.rb | 3 +- lib/stripe/resources/transfer.rb | 3 +- .../resources/treasury/outbound_transfer.rb | 6 +- test/stripe/generated_examples_test.rb | 315 ++++-------------- 11 files changed, 209 insertions(+), 282 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index c1619cf1f..ca2b1285d 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v507 \ No newline at end of file +v525 \ No newline at end of file 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/customer.rb b/lib/stripe/resources/customer.rb index 29a584a20..fc74621bc 100644 --- a/lib/stripe/resources/customer.rb +++ b/lib/stripe/resources/customer.rb @@ -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/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/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/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 cab8f0bfa..34dbc0f01 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 @@ -996,10 +930,7 @@ class CodegennedExampleTest < Test::Unit::TestCase 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 +982,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 +1020,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 @@ -1143,10 +1068,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 +1098,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 +1133,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 +1159,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 +1169,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 +1227,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 +1268,17 @@ 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 "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 +1306,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 +1349,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 +1409,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 +1451,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 +1487,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 +1517,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 @@ -1756,10 +1626,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 @@ -1825,10 +1692,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 @@ -1876,10 +1740,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 @@ -1928,10 +1789,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 @@ -1955,10 +1813,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 @@ -1968,10 +1823,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 @@ -2017,10 +1869,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 @@ -2048,10 +1897,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 @@ -2086,10 +1932,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 @@ -2123,10 +1966,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 @@ -2177,10 +2017,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 @@ -2249,10 +2086,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 @@ -2330,10 +2164,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 @@ -2385,10 +2216,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 @@ -2449,10 +2277,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 @@ -2462,10 +2287,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 @@ -2634,18 +2456,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 @@ -2666,9 +2483,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 From 7066d7d3a10a75415418d4ba57f53b3731a4ce43 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 15 Sep 2023 00:10:55 +0000 Subject: [PATCH 09/10] Update generated code for v531 --- OPENAPI_VERSION | 2 +- lib/stripe/resources/balance_transaction.rb | 2 +- lib/stripe/resources/customer.rb | 2 +- lib/stripe/resources/dispute.rb | 6 ++-- lib/stripe/resources/event.rb | 33 +++++++++++---------- 5 files changed, 22 insertions(+), 23 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index c4c820059..7ed2f6254 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v530 \ No newline at end of file +v531 \ No newline at end of file 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/customer.rb b/lib/stripe/resources/customer.rb index fc74621bc..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 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 From f97b214181eecbeaba99117c3b74e1b07386c1b5 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 15 Sep 2023 00:45:49 +0000 Subject: [PATCH 10/10] Update generated code for v532 --- OPENAPI_VERSION | 2 +- test/stripe/generated_examples_test.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 7ed2f6254..e9281bf5d 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v531 \ No newline at end of file +v532 \ No newline at end of file diff --git a/test/stripe/generated_examples_test.rb b/test/stripe/generated_examples_test.rb index e29ac8018..e7830b91c 100644 --- a/test/stripe/generated_examples_test.rb +++ b/test/stripe/generated_examples_test.rb @@ -969,7 +969,7 @@ class CodegennedExampleTest < Test::Unit::TestCase }, authorization_method: "chip", card: "foo", - currency: "bar", + currency: "usd", is_amount_controllable: true, merchant_data: { category: "ac_refrigeration_repair", @@ -1169,7 +1169,7 @@ class CodegennedExampleTest < Test::Unit::TestCase Stripe::Issuing::Transaction::TestHelpers.create_force_capture({ amount: 100, card: "foo", - currency: "bar", + currency: "usd", merchant_data: { category: "ac_refrigeration_repair", city: "foo", @@ -1226,7 +1226,7 @@ class CodegennedExampleTest < Test::Unit::TestCase Stripe::Issuing::Transaction::TestHelpers.create_unlinked_refund({ amount: 100, card: "foo", - currency: "bar", + currency: "usd", merchant_data: { category: "ac_refrigeration_repair", city: "foo",