From bcc7f66986731649b9085dceac4e18e4345e89af Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Thu, 21 Apr 2022 12:30:12 -0700 Subject: [PATCH 1/3] Codegen for openapi e07f049 --- lib/stripe/resources/refund.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/stripe/resources/refund.rb b/lib/stripe/resources/refund.rb index 3cd12350c..1b27c9396 100644 --- a/lib/stripe/resources/refund.rb +++ b/lib/stripe/resources/refund.rb @@ -19,5 +19,24 @@ def cancel(params = {}, opts = {}) opts: opts ) end + + def test_helpers + TestHelpers.new(self) + end + + class TestHelpers < APIResourceTestHelpers + RESOURCE_CLASS = Refund + + custom_method :expire, http_verb: :post + + def expire(params = {}, opts = {}) + @resource.request_stripe_object( + method: :post, + path: resource_url + "/expire", + params: params, + opts: opts + ) + end + end end end From 7b090bf08ecfe27947603c2047239a077b4b4421 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Thu, 21 Apr 2022 12:41:16 -0700 Subject: [PATCH 2/3] Generated test --- test/stripe/generated_examples_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/stripe/generated_examples_test.rb b/test/stripe/generated_examples_test.rb index 6e0c41c18..49521a3ba 100644 --- a/test/stripe/generated_examples_test.rb +++ b/test/stripe/generated_examples_test.rb @@ -1241,6 +1241,12 @@ class CodegennedExampleTest < Test::Unit::TestCase assert_requested :post, "#{Stripe.api_base}/v1/refunds" end end + context "Refund.expire" do + should "support requests with args: refund" do + Stripe::Refund::TestHelpers.expire("re_123") + assert_requested :post, "#{Stripe.api_base}/v1/test_helpers/refunds/re_123/expire?" + end + end context "Refund.list" do should "support requests with args: limit" do Stripe::Refund.list(limit: 3) From 5e6510d97fe2b82a8e1dc87b2a475516723c88a5 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Thu, 21 Apr 2022 12:53:58 -0700 Subject: [PATCH 3/3] bump ci