From a9a687ab61559f8ccba1a2b421842b91272ec9a1 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Thu, 2 Feb 2023 13:53:12 -0600 Subject: [PATCH 1/4] Codegen for openapi v223 --- OPENAPI_VERSION | 2 +- lib/stripe/resources/subscription.rb | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index f3da18c95..4e134f2a9 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v219 \ No newline at end of file +v223 \ No newline at end of file diff --git a/lib/stripe/resources/subscription.rb b/lib/stripe/resources/subscription.rb index ee14a68f0..62d11f053 100644 --- a/lib/stripe/resources/subscription.rb +++ b/lib/stripe/resources/subscription.rb @@ -31,6 +31,15 @@ def delete_discount(params = {}, opts = {}) ) end + def resume(params = {}, opts = {}) + request_stripe_object( + method: :post, + path: format("/v1/subscriptions/%s/resume", { subscription: CGI.escape(self["id"]) }), + params: params, + opts: opts + ) + end + def self.cancel(subscription_exposed_id, params = {}, opts = {}) request_stripe_object( method: :delete, @@ -49,6 +58,15 @@ def self.delete_discount(subscription_exposed_id, params = {}, opts = {}) ) end + def self.resume(subscription, params = {}, opts = {}) + request_stripe_object( + method: :post, + path: format("/v1/subscriptions/%s/resume", { subscription: CGI.escape(subscription) }), + params: params, + opts: opts + ) + end + save_nested_resource :source def self.search(params = {}, opts = {}) From 206b707d0ced613e59a0a1f18bc8be731c7e23a1 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Thu, 2 Feb 2023 14:05:46 -0600 Subject: [PATCH 2/4] Add test --- test/stripe/generated_examples_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/stripe/generated_examples_test.rb b/test/stripe/generated_examples_test.rb index 471525533..f575c461e 100644 --- a/test/stripe/generated_examples_test.rb +++ b/test/stripe/generated_examples_test.rb @@ -1876,6 +1876,15 @@ class CodegennedExampleTest < Test::Unit::TestCase assert_requested :get, "#{Stripe.api_base}/v1/subscriptions?limit=3" end end + context "Subscription.resume" do + should "support requests with args: id, proration_date, proration_behavior" do + Stripe::Subscription.resume( + "sub_xxxxxxxxxxxxx", + { proration_date: 1_675_400_000, proration_behavior: "always_invoice" } + ) + assert_requested :post, "#{Stripe.api_base}/v1/subscriptions/sub_xxxxxxxxxxxxx/resume" + end + end context "Subscription.retrieve" do should "support requests with args: id" do Stripe::Subscription.retrieve("sub_xxxxxxxxxxxxx") From 0b028811f2818b0bd922b710585f5e898e8fdc50 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Thu, 2 Feb 2023 14:27:11 -0600 Subject: [PATCH 3/4] bump CI From 8be00fef4eb3150ebf9b60d86c23e03a0eab886e Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Thu, 2 Feb 2023 15:01:45 -0600 Subject: [PATCH 4/4] Bump version to 8.2.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 01e1bf6ab..bae165d2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 8.2.0 - 2023-02-02 +* [#1173](https://github.com/stripe/stripe-ruby/pull/1173) API Updates + * Add support for `resume` method on resource `Subscription` +* [#1171](https://github.com/stripe/stripe-ruby/pull/1171) Remove unused `partial` param from `initialize_from` + ## 8.1.0 - 2023-01-12 * [#1162](https://github.com/stripe/stripe-ruby/pull/1162) Improve request events instrumentation diff --git a/VERSION b/VERSION index 8104cabd3..fbb9ea12d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.1.0 +8.2.0 diff --git a/lib/stripe/version.rb b/lib/stripe/version.rb index 0c2d479cd..c848b5458 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" end