From a961665452b7f268e92367e2a899461a3b6a487c Mon Sep 17 00:00:00 2001 From: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> Date: Thu, 7 Jul 2022 09:33:48 -0700 Subject: [PATCH] Codegen for openapi v163 (#1092) --- OPENAPI_VERSION | 2 +- lib/stripe/resources/customer.rb | 3 +-- test/stripe/generated_examples_test.rb | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index b164d836d..1f7b99f73 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v162 \ No newline at end of file +v163 \ No newline at end of file diff --git a/lib/stripe/resources/customer.rb b/lib/stripe/resources/customer.rb index a66452131..86cdad9f9 100644 --- a/lib/stripe/resources/customer.rb +++ b/lib/stripe/resources/customer.rb @@ -76,8 +76,6 @@ def self.retrieve_payment_method( ) end - custom_method :delete_discount, http_verb: :delete, http_path: "discount" - save_nested_resource :source nested_resource_class_methods :source, operations: %i[create retrieve update delete list] @@ -87,6 +85,7 @@ def self.retrieve_payment_method( class << self alias detach_source delete_source end + custom_method :delete_discount, http_verb: :delete, http_path: "discount" # Deletes a discount associated with the customer. # diff --git a/test/stripe/generated_examples_test.rb b/test/stripe/generated_examples_test.rb index 70d0a23e7..c1934842c 100644 --- a/test/stripe/generated_examples_test.rb +++ b/test/stripe/generated_examples_test.rb @@ -1407,6 +1407,21 @@ class CodegennedExampleTest < Test::Unit::TestCase end end context "Price.create" do + should "support requests with args: unit_amount, currency, currency_options, recurring, product" do + Stripe::Price.create( + { + unit_amount: 2000, + currency: "usd", + currency_options: { + uah: { unit_amount: 5000 }, + eur: { unit_amount: 1800 }, + }, + recurring: { interval: "month" }, + product: "prod_xxxxxxxxxxxxx", + } + ) + assert_requested :post, "#{Stripe.api_base}/v1/prices" + end should "support requests with args: unit_amount, currency, recurring, product" do Stripe::Price.create( {