From acae2a737217c8a9f5a83a9181b7f163a5d05c5e Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Thu, 11 Nov 2021 12:45:39 -0500 Subject: [PATCH] Codegen for openapi 21065d4 --- lib/stripe/resources/checkout/session.rb | 11 +++++++++++ test/stripe/generated_examples_test.rb | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/lib/stripe/resources/checkout/session.rb b/lib/stripe/resources/checkout/session.rb index f2d15de43..4c60bcc0f 100644 --- a/lib/stripe/resources/checkout/session.rb +++ b/lib/stripe/resources/checkout/session.rb @@ -10,7 +10,18 @@ class Session < APIResource OBJECT_NAME = "checkout.session" + custom_method :expire, http_verb: :post + nested_resource_class_methods :line_item, operations: %i[list] + + def expire(params = {}, opts = {}) + request_stripe_object( + method: :post, + path: resource_url + "/expire", + params: params, + opts: opts + ) + end end end end diff --git a/test/stripe/generated_examples_test.rb b/test/stripe/generated_examples_test.rb index 0b768ee99..80ced4d8a 100644 --- a/test/stripe/generated_examples_test.rb +++ b/test/stripe/generated_examples_test.rb @@ -1269,6 +1269,12 @@ class CodegennedExampleTest < Test::Unit::TestCase assert_requested :post, "#{Stripe.api_base}/v1/billing_portal/sessions" end end + context "Session.expire" do + should "support requests with args: session" do + Stripe::Checkout::Session.expire("sess_xyz") + assert_requested :post, "#{Stripe.api_base}/v1/checkout/sessions/sess_xyz/expire?" + end + end context "Session.list" do should "support requests with args: limit" do Stripe::Checkout::Session.list(limit: 3)