From fcfeac740e2a6da611ee3ea9c4105dcb2e667d3e Mon Sep 17 00:00:00 2001 From: anniel-stripe <97691964+anniel-stripe@users.noreply.github.com> Date: Wed, 18 Jan 2023 15:41:04 -0800 Subject: [PATCH 1/5] Update README.md with instrumentation changes (#1165) --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 69dea24da..bf953f45a 100644 --- a/README.md +++ b/README.md @@ -253,7 +253,11 @@ a success or error. Receives `RequestEndEvent` with the following properties: - `path`: Request path. (`String`) - `user_data`: A hash on which users may have set arbitrary data in `request_begin`. See above for more information. (`Hash`) -- `request_id`. HTTP request identifier. +- `request_id`: HTTP request identifier. (`String`) +- `response_header`: The response headers. (`Hash`) +- `response_body` = The response body. (`String`) +- `request_header` = The request headers. (`Hash`) +- `request_body` = The request body. (`String`) #### Example From e6b167565e109984800e6d8f66be3e69eec3d650 Mon Sep 17 00:00:00 2001 From: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> Date: Thu, 19 Jan 2023 10:19:27 -0800 Subject: [PATCH 2/5] Codegen for openapi v219 (#1169) --- OPENAPI_VERSION | 2 +- lib/stripe/resources/account.rb | 1 - test/stripe/generated_examples_test.rb | 112 ++++++++++++------------- 3 files changed, 57 insertions(+), 58 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index fe802d3a4..f3da18c95 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v204 \ No newline at end of file +v219 \ No newline at end of file diff --git a/lib/stripe/resources/account.rb b/lib/stripe/resources/account.rb index bfb8572d9..d6cac0247 100644 --- a/lib/stripe/resources/account.rb +++ b/lib/stripe/resources/account.rb @@ -64,7 +64,6 @@ def self.reject(account, params = {}, opts = {}) nested_resource_class_methods :external_account, operations: %i[create retrieve update delete list] - nested_resource_class_methods :login_link, operations: %i[create] def resource_url diff --git a/test/stripe/generated_examples_test.rb b/test/stripe/generated_examples_test.rb index 4837c2599..471525533 100644 --- a/test/stripe/generated_examples_test.rb +++ b/test/stripe/generated_examples_test.rb @@ -32,6 +32,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" }) @@ -78,6 +84,31 @@ class CodegennedExampleTest < Test::Unit::TestCase assert_requested :get, "#{Stripe.api_base}/v1/application_fees/fee_xxxxxxxxxxxxx?" end end + context "ApplicationFeeRefund.list" do + should "support requests with args: limit, parent_id" do + Stripe::ApplicationFee.list_refunds("fee_xxxxxxxxxxxxx", { limit: 3 }) + assert_requested :get, "#{Stripe.api_base}/v1/application_fees/fee_xxxxxxxxxxxxx/refunds?limit=3" + end + end + context "ApplicationFeeRefund.retrieve" do + should "support requests with args: parent_id, id" do + Stripe::ApplicationFee.retrieve_refund( + "fee_xxxxxxxxxxxxx", + "fr_xxxxxxxxxxxxx" + ) + assert_requested :get, "#{Stripe.api_base}/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx?" + end + end + context "ApplicationFeeRefund.update" do + should "support requests with args: metadata, parent_id, id" do + Stripe::ApplicationFee.update_refund( + "fee_xxxxxxxxxxxxx", + "fr_xxxxxxxxxxxxx", + { metadata: { order_id: "6735" } } + ) + assert_requested :post, "#{Stripe.api_base}/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx" + end + end context "Apps.Secret.create" do should "support requests with args: name, payload, scope" do Stripe::Apps::Secret.create( @@ -571,31 +602,6 @@ class CodegennedExampleTest < Test::Unit::TestCase assert_requested :get, "#{Stripe.api_base}/v1/events/evt_xxxxxxxxxxxxx?" end end - context "FeeRefund.list" do - should "support requests with args: limit, parent_id" do - Stripe::ApplicationFee.list_refunds("fee_xxxxxxxxxxxxx", { limit: 3 }) - assert_requested :get, "#{Stripe.api_base}/v1/application_fees/fee_xxxxxxxxxxxxx/refunds?limit=3" - end - end - context "FeeRefund.retrieve" do - should "support requests with args: parent_id, id" do - Stripe::ApplicationFee.retrieve_refund( - "fee_xxxxxxxxxxxxx", - "fr_xxxxxxxxxxxxx" - ) - assert_requested :get, "#{Stripe.api_base}/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx?" - end - end - context "FeeRefund.update" do - should "support requests with args: metadata, parent_id, id" do - Stripe::ApplicationFee.update_refund( - "fee_xxxxxxxxxxxxx", - "fr_xxxxxxxxxxxxx", - { metadata: { order_id: "6735" } } - ) - assert_requested :post, "#{Stripe.api_base}/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx" - end - end context "File.list" do should "support requests with args: limit" do Stripe::File.list({ limit: 3 }) @@ -1294,12 +1300,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( @@ -1684,6 +1684,31 @@ class CodegennedExampleTest < Test::Unit::TestCase assert_requested :get, "#{Stripe.api_base}/v1/reporting/report_types/balance.summary.1?" end end + context "Reversal.list" do + should "support requests with args: limit, parent_id" do + Stripe::Transfer.list_reversals("tr_xxxxxxxxxxxxx", { limit: 3 }) + assert_requested :get, "#{Stripe.api_base}/v1/transfers/tr_xxxxxxxxxxxxx/reversals?limit=3" + end + end + context "Reversal.retrieve" do + should "support requests with args: parent_id, id" do + Stripe::Transfer.retrieve_reversal( + "tr_xxxxxxxxxxxxx", + "trr_xxxxxxxxxxxxx" + ) + assert_requested :get, "#{Stripe.api_base}/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx?" + end + end + context "Reversal.update" do + should "support requests with args: metadata, parent_id, id" do + Stripe::Transfer.update_reversal( + "tr_xxxxxxxxxxxxx", + "trr_xxxxxxxxxxxxx", + { metadata: { order_id: "6735" } } + ) + assert_requested :post, "#{Stripe.api_base}/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx" + end + end context "Review.approve" do should "support requests with args: id" do Stripe::Review.approve("prv_xxxxxxxxxxxxx") @@ -2383,31 +2408,6 @@ class CodegennedExampleTest < Test::Unit::TestCase assert_requested :post, "#{Stripe.api_base}/v1/transfers/tr_xxxxxxxxxxxxx" end end - context "TransferReversal.list" do - should "support requests with args: limit, parent_id" do - Stripe::Transfer.list_reversals("tr_xxxxxxxxxxxxx", { limit: 3 }) - assert_requested :get, "#{Stripe.api_base}/v1/transfers/tr_xxxxxxxxxxxxx/reversals?limit=3" - end - end - context "TransferReversal.retrieve" do - should "support requests with args: parent_id, id" do - Stripe::Transfer.retrieve_reversal( - "tr_xxxxxxxxxxxxx", - "trr_xxxxxxxxxxxxx" - ) - assert_requested :get, "#{Stripe.api_base}/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx?" - end - end - context "TransferReversal.update" do - should "support requests with args: metadata, parent_id, id" do - Stripe::Transfer.update_reversal( - "tr_xxxxxxxxxxxxx", - "trr_xxxxxxxxxxxxx", - { metadata: { order_id: "6735" } } - ) - assert_requested :post, "#{Stripe.api_base}/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx" - end - end context "Treasury.CreditReversal.create" do should "support requests with args: received_credit" do Stripe::Treasury::CreditReversal.create( From ce4946f5d8301b68cf48b8dcb9e72c61a2621bec Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Thu, 19 Jan 2023 12:27:16 -0800 Subject: [PATCH 3/5] Set version to 8.1.0 to simplify merge --- VERSION | 2 +- lib/stripe/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 2a795dfca..8104cabd3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.2.0-beta.1 +8.1.0 diff --git a/lib/stripe/version.rb b/lib/stripe/version.rb index cdc36ca2b..0c2d479cd 100644 --- a/lib/stripe/version.rb +++ b/lib/stripe/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Stripe - VERSION = "8.2.0-beta.1" + VERSION = "8.1.0" end From d7eac6010db6d9861d7e73fc8010967a0150661f Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Thu, 19 Jan 2023 12:27:16 -0800 Subject: [PATCH 4/5] Reset version to 8.2.0-beta.1 --- VERSION | 2 +- lib/stripe/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 8104cabd3..2a795dfca 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.1.0 +8.2.0-beta.1 diff --git a/lib/stripe/version.rb b/lib/stripe/version.rb index 0c2d479cd..cdc36ca2b 100644 --- a/lib/stripe/version.rb +++ b/lib/stripe/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Stripe - VERSION = "8.1.0" + VERSION = "8.2.0-beta.1" end From 7bf9cace9e7d94dcdf5d2e1c2e61ce134f253884 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Thu, 19 Jan 2023 12:27:31 -0800 Subject: [PATCH 5/5] Codegen for openapi v219 --- OPENAPI_VERSION | 2 +- lib/stripe/object_types.rb | 1 + lib/stripe/resources.rb | 1 + lib/stripe/resources/tax/settings.rb | 15 +++++++++++++++ 4 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 lib/stripe/resources/tax/settings.rb diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 76d4091fa..f3da18c95 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v218 \ No newline at end of file +v219 \ No newline at end of file diff --git a/lib/stripe/object_types.rb b/lib/stripe/object_types.rb index 107456dac..3ad4b7ed5 100644 --- a/lib/stripe/object_types.rb +++ b/lib/stripe/object_types.rb @@ -99,6 +99,7 @@ def self.object_names_to_classes SubscriptionSchedule::OBJECT_NAME => SubscriptionSchedule, Tax::Calculation::OBJECT_NAME => Tax::Calculation, Tax::Registration::OBJECT_NAME => Tax::Registration, + Tax::Settings::OBJECT_NAME => Tax::Settings, Tax::Transaction::OBJECT_NAME => Tax::Transaction, TaxCode::OBJECT_NAME => TaxCode, TaxId::OBJECT_NAME => TaxId, diff --git a/lib/stripe/resources.rb b/lib/stripe/resources.rb index d04a6c248..3442d3bb5 100644 --- a/lib/stripe/resources.rb +++ b/lib/stripe/resources.rb @@ -86,6 +86,7 @@ require "stripe/resources/subscription_schedule" require "stripe/resources/tax/calculation" require "stripe/resources/tax/registration" +require "stripe/resources/tax/settings" require "stripe/resources/tax/transaction" require "stripe/resources/tax_code" require "stripe/resources/tax_id" diff --git a/lib/stripe/resources/tax/settings.rb b/lib/stripe/resources/tax/settings.rb new file mode 100644 index 000000000..965bd956f --- /dev/null +++ b/lib/stripe/resources/tax/settings.rb @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Tax + # You can use Tax `Settings` to manage configurations used by Stripe Tax calculations. + # + # Related guide: [Account settings](https://stripe.com/docs/tax/connect/settings). + class Settings < SingletonAPIResource + include Stripe::APIOperations::Save + + OBJECT_NAME = "tax.settings" + end + end +end