From 3b507b46478ac37bfa51d6ee8768289a6242ca46 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 29 Feb 2024 20:10:26 +0000 Subject: [PATCH 1/7] Update generated code for v841 (#1342) Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: anniel-stripe <97691964+anniel-stripe@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- lib/stripe/resources/charge.rb | 3 +++ lib/stripe/resources/refund.rb | 14 +++++--------- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index e3b365910..2e1dc524f 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v840 \ No newline at end of file +v841 \ No newline at end of file diff --git a/lib/stripe/resources/charge.rb b/lib/stripe/resources/charge.rb index a68f2b702..48d0f3505 100644 --- a/lib/stripe/resources/charge.rb +++ b/lib/stripe/resources/charge.rb @@ -11,12 +11,15 @@ class Charge < APIResource extend Stripe::APIOperations::List extend Stripe::APIOperations::Search include Stripe::APIOperations::Save + extend Stripe::APIOperations::NestedResource OBJECT_NAME = "charge" def self.object_name "charge" end + nested_resource_class_methods :refund, operations: %i[retrieve list] + # Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. # # Uncaptured payments expire a set number of days after they are created ([7 by default](https://stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail. diff --git a/lib/stripe/resources/refund.rb b/lib/stripe/resources/refund.rb index fd7bebf05..e3a99775f 100644 --- a/lib/stripe/resources/refund.rb +++ b/lib/stripe/resources/refund.rb @@ -41,15 +41,6 @@ def self.cancel(refund, params = {}, opts = {}) ) end - def self.list(filters = {}, opts = {}) - request_stripe_object( - method: :get, - path: format("/v1/refunds"), - params: filters, - opts: opts - ) - end - # When you create a new refund, you must specify a Charge or a PaymentIntent object on which to create it. # # Creating a new refund will refund a charge that has previously been created but not yet refunded. @@ -65,6 +56,11 @@ def self.create(params = {}, opts = {}) request_stripe_object(method: :post, path: "/v1/refunds", params: params, opts: opts) end + # Returns a list of all refunds you created. We return the refunds in sorted order, with the most recent refunds appearing first The 10 most recent refunds are always available by default on the Charge object. + def self.list(filters = {}, opts = {}) + request_stripe_object(method: :get, path: "/v1/refunds", params: filters, opts: opts) + end + # Updates the refund that you specify by setting the values of the passed parameters. Any parameters that you don't provide remain unchanged. # # This request only accepts metadata as an argument. From 521ab2f97ce56dd5690a88c376a603e26cbd5ce4 Mon Sep 17 00:00:00 2001 From: Annie Li Date: Thu, 29 Feb 2024 15:22:00 -0500 Subject: [PATCH 2/7] Bump version to 10.11.0 --- CHANGELOG.md | 5 +++++ VERSION | 2 +- lib/stripe/version.rb | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f57e53d3..eccf43359 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ # Changelog +## 10.11.0 - 2024-02-29 +* [#1342](https://github.com/stripe/stripe-ruby/pull/1342) Update generated code + * Add `list_refunds` and `retrieve_refund` methods on resource `Charge`. +* [#1345](https://github.com/stripe/stripe-ruby/pull/1345) Update README to use add_beta_version + ## 10.10.0 - 2024-02-22 * [#1336](https://github.com/stripe/stripe-ruby/pull/1336) Update generated code - Add `InvoiceLineItem.update` method. diff --git a/VERSION b/VERSION index e8a306979..725870228 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.10.0 +10.11.0 diff --git a/lib/stripe/version.rb b/lib/stripe/version.rb index 284dd01eb..f41e1af70 100644 --- a/lib/stripe/version.rb +++ b/lib/stripe/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Stripe - VERSION = "10.10.0" + VERSION = "10.11.0" end From 00f2c02ca6a82a78f35a92287ee034a4398372ef Mon Sep 17 00:00:00 2001 From: helenye-stripe <111009531+helenye-stripe@users.noreply.github.com> Date: Thu, 29 Feb 2024 13:11:07 -0800 Subject: [PATCH 3/7] Use sorbet gem instead, required for srb (#1348) --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 9bc47fe22..62cab7f00 100644 --- a/Gemfile +++ b/Gemfile @@ -31,7 +31,7 @@ group :development do # don't install on truffleruby gem "jaro_winkler", "1.5.4" unless RUBY_ENGINE == "truffleruby" - gem "sorbet-static" + gem "sorbet" gem "tapioca" platforms :mri do From 8654aa9065a56c71e42e0b0755d235221d8a4e73 Mon Sep 17 00:00:00 2001 From: Annie Li Date: Thu, 29 Feb 2024 16:57:26 -0500 Subject: [PATCH 4/7] Bump version to 10.11.0 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index eccf43359..fe251cbdc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Changelog ## 10.11.0 - 2024-02-29 +* [#1348](https://github.com/stripe/stripe-ruby/pull/1348) Use sorbet gem instead of sorbet-static * [#1342](https://github.com/stripe/stripe-ruby/pull/1342) Update generated code * Add `list_refunds` and `retrieve_refund` methods on resource `Charge`. * [#1345](https://github.com/stripe/stripe-ruby/pull/1345) Update README to use add_beta_version From cb15e149626ae8a6ff74b151e7d9aebf13d20f2c Mon Sep 17 00:00:00 2001 From: Annie Li Date: Thu, 29 Feb 2024 17:45:25 -0500 Subject: [PATCH 5/7] Bump version to 10.11.0 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe251cbdc..a3d92a622 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## 10.11.0 - 2024-02-29 * [#1348](https://github.com/stripe/stripe-ruby/pull/1348) Use sorbet gem instead of sorbet-static * [#1342](https://github.com/stripe/stripe-ruby/pull/1342) Update generated code - * Add `list_refunds` and `retrieve_refund` methods on resource `Charge`. + * Add `list_refunds` and `retrieve_refund` methods on resource `Charge` * [#1345](https://github.com/stripe/stripe-ruby/pull/1345) Update README to use add_beta_version ## 10.10.0 - 2024-02-22 From 0e7779560782cd2bf320928e91a0f76304098aa2 Mon Sep 17 00:00:00 2001 From: Annie Li Date: Thu, 29 Feb 2024 17:46:58 -0500 Subject: [PATCH 6/7] Bump version to 10.11.0 --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3d92a622..d1b1e5dfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ # Changelog +## 10.11.0 - 2024-02-29 +* [#1348](https://github.com/stripe/stripe-ruby/pull/1348) Use sorbet gem instead of sorbet-static + ## 10.11.0 - 2024-02-29 * [#1348](https://github.com/stripe/stripe-ruby/pull/1348) Use sorbet gem instead of sorbet-static * [#1342](https://github.com/stripe/stripe-ruby/pull/1342) Update generated code From 0ad6440f44876f2ec9d1b170aa461fa6489ce947 Mon Sep 17 00:00:00 2001 From: Annie Li Date: Thu, 29 Feb 2024 17:49:29 -0500 Subject: [PATCH 7/7] Bump version to 10.11.0 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1b1e5dfc..44b4fa346 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,10 @@ # Changelog +## 10.11.0 - 2024-02-29 +* [#1348](https://github.com/stripe/stripe-ruby/pull/1348) Use sorbet gem instead of sorbet-static +* [#1342](https://github.com/stripe/stripe-ruby/pull/1342) Update generated code + * Add `list_refunds` and `retrieve_refund` methods on resource `Charge`. +* [#1345](https://github.com/stripe/stripe-ruby/pull/1345) Update README to use add_beta_version + ## 10.11.0 - 2024-02-29 * [#1348](https://github.com/stripe/stripe-ruby/pull/1348) Use sorbet gem instead of sorbet-static