diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 515f433c0..b164d836d 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v161 \ No newline at end of file +v162 \ No newline at end of file diff --git a/lib/stripe/resources/credit_note.rb b/lib/stripe/resources/credit_note.rb index 9779b6dae..d685f86d3 100644 --- a/lib/stripe/resources/credit_note.rb +++ b/lib/stripe/resources/credit_note.rb @@ -18,28 +18,28 @@ def void_credit_note(params = {}, opts = {}) ) end - def self.void_credit_note(id, params = {}, opts = {}) + def self.list_preview_line_items(params = {}, opts = {}) request_stripe_object( - method: :post, - path: format("/v1/credit_notes/%s/void", { id: CGI.escape(id) }), + method: :get, + path: "/v1/credit_notes/preview/lines", params: params, opts: opts ) end - def self.preview(params, opts = {}) + def self.preview(params = {}, opts = {}) request_stripe_object( method: :get, - path: resource_url + "/preview", + path: "/v1/credit_notes/preview", params: params, opts: opts ) end - def self.list_preview_line_items(params, opts = {}) + def self.void_credit_note(id, params = {}, opts = {}) request_stripe_object( - method: :get, - path: resource_url + "/preview/lines", + method: :post, + path: format("/v1/credit_notes/%s/void", { id: CGI.escape(id) }), params: params, opts: opts ) diff --git a/lib/stripe/resources/invoice.rb b/lib/stripe/resources/invoice.rb index e6bfd88e6..fa07ed593 100644 --- a/lib/stripe/resources/invoice.rb +++ b/lib/stripe/resources/invoice.rb @@ -65,55 +65,55 @@ def self.finalize_invoice(invoice, params = {}, opts = {}) ) end - def self.mark_uncollectible(invoice, params = {}, opts = {}) + def self.list_upcoming_line_items(params = {}, opts = {}) request_stripe_object( - method: :post, - path: format("/v1/invoices/%s/mark_uncollectible", { invoice: CGI.escape(invoice) }), + method: :get, + path: "/v1/invoices/upcoming/lines", params: params, opts: opts ) end - def self.pay(invoice, params = {}, opts = {}) + def self.mark_uncollectible(invoice, params = {}, opts = {}) request_stripe_object( method: :post, - path: format("/v1/invoices/%s/pay", { invoice: CGI.escape(invoice) }), + path: format("/v1/invoices/%s/mark_uncollectible", { invoice: CGI.escape(invoice) }), params: params, opts: opts ) end - def self.send_invoice(invoice, params = {}, opts = {}) + def self.pay(invoice, params = {}, opts = {}) request_stripe_object( method: :post, - path: format("/v1/invoices/%s/send", { invoice: CGI.escape(invoice) }), + path: format("/v1/invoices/%s/pay", { invoice: CGI.escape(invoice) }), params: params, opts: opts ) end - def self.void_invoice(invoice, params = {}, opts = {}) + def self.send_invoice(invoice, params = {}, opts = {}) request_stripe_object( method: :post, - path: format("/v1/invoices/%s/void", { invoice: CGI.escape(invoice) }), + path: format("/v1/invoices/%s/send", { invoice: CGI.escape(invoice) }), params: params, opts: opts ) end - def self.upcoming(params, opts = {}) + def self.upcoming(params = {}, opts = {}) request_stripe_object( method: :get, - path: resource_url + "/upcoming", + path: "/v1/invoices/upcoming", params: params, opts: opts ) end - def self.list_upcoming_line_items(params, opts = {}) + def self.void_invoice(invoice, params = {}, opts = {}) request_stripe_object( - method: :get, - path: resource_url + "/upcoming/lines", + method: :post, + path: format("/v1/invoices/%s/void", { invoice: CGI.escape(invoice) }), params: params, opts: opts ) diff --git a/test/stripe/generated_examples_test.rb b/test/stripe/generated_examples_test.rb index 7f3fea9d2..70d0a23e7 100644 --- a/test/stripe/generated_examples_test.rb +++ b/test/stripe/generated_examples_test.rb @@ -821,6 +821,12 @@ class CodegennedExampleTest < Test::Unit::TestCase assert_requested :post, "#{Stripe.api_base}/v1/invoices/in_xxxxxxxxxxxxx/send?" end end + context "Invoice.upcoming" do + should "support requests with args: customer" do + Stripe::Invoice.upcoming({ customer: "cus_9utnxg47pWjV1e" }) + assert_requested :get, "#{Stripe.api_base}/v1/invoices/upcoming?customer=cus_9utnxg47pWjV1e" + end + end context "Invoice.update" do should "support requests with args: metadata, id" do Stripe::Invoice.update(