From 7590b09181be8c7d6c2c8849ca5872c0a9ee50ff Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 18 Jul 2023 15:19:55 +0000 Subject: [PATCH] Update generated code for v423 --- OPENAPI_VERSION | 2 +- test/stripe/generated_examples_test.rb | 130 ++++++++++++++++++++----- 2 files changed, 108 insertions(+), 24 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 0b391be30..40eed4370 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v413 \ No newline at end of file +v423 \ No newline at end of file diff --git a/test/stripe/generated_examples_test.rb b/test/stripe/generated_examples_test.rb index f5bb8b820..451b03c66 100644 --- a/test/stripe/generated_examples_test.rb +++ b/test/stripe/generated_examples_test.rb @@ -30,6 +30,12 @@ class CodegennedExampleTest < Test::Unit::TestCase assert_requested :get, "#{Stripe.api_base}/v1/accounts?limit=3" end end + context "Account.persons" do + should "support requests with args: limit, parent_id" do + Stripe::Account.persons("acct_xxxxxxxxxxxxx", { limit: 3 }) + assert_requested :get, "#{Stripe.api_base}/v1/accounts/acct_xxxxxxxxxxxxx/persons?limit=3" + end + end context "Account.reject" do should "support requests with args: reason, id" do Stripe::Account.reject("acct_xxxxxxxxxxxxx", { reason: "fraud" }) @@ -605,6 +611,62 @@ class CodegennedExampleTest < Test::Unit::TestCase assert_requested :get, "#{Stripe.api_base}/v1/events/evt_xxxxxxxxxxxxx?" end end + context "ExternalAccount.create" do + should "support requests with args: external_account, parent_id" do + Stripe::Account.create_external_account( + "acct_xxxxxxxxxxxxx", + { external_account: "btok_xxxxxxxxxxxxx" } + ) + assert_requested :post, "#{Stripe.api_base}/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts" + end + should "support requests with args: external_account, parent_id2" do + Stripe::Account.create_external_account( + "acct_xxxxxxxxxxxxx", + { external_account: "tok_xxxx_debit" } + ) + assert_requested :post, "#{Stripe.api_base}/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts" + end + end + context "ExternalAccount.delete" do + should "support requests with args: parent_id, id" do + 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" + ) + assert_requested :delete, "#{Stripe.api_base}/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx?" + end + end + context "ExternalAccount.list" do + should "support requests with args: limit, parent_id" do + Stripe::Account.list_external_accounts("acct_xxxxxxxxxxxxx", { limit: 3 }) + assert_requested :get, "#{Stripe.api_base}/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts?limit=3" + end + end + context "ExternalAccount.update" do + should "support requests with args: metadata, parent_id, id" do + Stripe::Account.update_external_account( + "acct_xxxxxxxxxxxxx", + "ba_xxxxxxxxxxxxx", + { metadata: { order_id: "6735" } } + ) + assert_requested :post, "#{Stripe.api_base}/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx" + end + should "support requests with args: metadata, parent_id, id2" do + Stripe::Account.update_external_account( + "acct_xxxxxxxxxxxxx", + "card_xxxxxxxxxxxxx", + { metadata: { order_id: "6735" } } + ) + assert_requested :post, "#{Stripe.api_base}/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx" + end + end context "File.list" do should "support requests with args: limit" do Stripe::File.list({ limit: 3 }) @@ -1306,30 +1368,58 @@ class CodegennedExampleTest < Test::Unit::TestCase assert_requested :post, "#{Stripe.api_base}/v1/payment_methods/pm_xxxxxxxxxxxxx" end end - context "PaymentSource.update" do - should "support requests with args: customer, card, account_holder_name" do - Stripe::Customer.update_source( - "cus_123", - "card_123", - { account_holder_name: "Kamil" } + context "PaymentSource.create" do + should "support requests with args: source, parent_id" do + Stripe::Customer.create_source( + "cus_xxxxxxxxxxxxx", + { source: "btok_xxxxxxxxxxxxx" } ) - assert_requested :post, "#{Stripe.api_base}/v1/customers/cus_123/sources/card_123" + assert_requested :post, "#{Stripe.api_base}/v1/customers/cus_xxxxxxxxxxxxx/sources" end - should "support requests with args: metadata, parent_id, id" do - Stripe::Customer.update_source( + should "support requests with args: source, parent_id2" do + Stripe::Customer.create_source( "cus_xxxxxxxxxxxxx", - "ba_xxxxxxxxxxxxx", - { metadata: { order_id: "6735" } } + { source: "tok_xxxx" } ) - assert_requested :post, "#{Stripe.api_base}/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx" + assert_requested :post, "#{Stripe.api_base}/v1/customers/cus_xxxxxxxxxxxxx/sources" end - should "support requests with args: name, parent_id, id" do - Stripe::Customer.update_source( + end + context "PaymentSource.list" do + should "support requests with args: object, limit, parent_id" do + Stripe::Customer.list_sources( "cus_xxxxxxxxxxxxx", - "card_xxxxxxxxxxxxx", - { name: "Jenny Rosen" } + { + object: "bank_account", + limit: 3, + } ) - assert_requested :post, "#{Stripe.api_base}/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx" + assert_requested :get, "#{Stripe.api_base}/v1/customers/cus_xxxxxxxxxxxxx/sources?object=bank_account&limit=3" + end + should "support requests with args: object, limit, parent_id2" do + Stripe::Customer.list_sources( + "cus_xxxxxxxxxxxxx", + { + object: "card", + limit: 3, + } + ) + assert_requested :get, "#{Stripe.api_base}/v1/customers/cus_xxxxxxxxxxxxx/sources?object=card&limit=3" + end + end + context "PaymentSource.retrieve" do + should "support requests with args: parent_id, id" do + 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" + ) + assert_requested :get, "#{Stripe.api_base}/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx?" end end context "Payout.cancel" do @@ -1374,12 +1464,6 @@ class CodegennedExampleTest < Test::Unit::TestCase assert_requested :post, "#{Stripe.api_base}/v1/payouts/po_xxxxxxxxxxxxx" end end - context "Person.list" do - should "support requests with args: limit, parent_id" do - Stripe::Account.list_persons("acct_xxxxxxxxxxxxx", { limit: 3 }) - assert_requested :get, "#{Stripe.api_base}/v1/accounts/acct_xxxxxxxxxxxxx/persons?limit=3" - end - end context "Person.retrieve" do should "support requests with args: parent_id, id" do Stripe::Account.retrieve_person(