From bab5393d6a840cbcd0bcd77e147a414dd40ecea8 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 5 Jul 2024 14:29:21 -0400 Subject: [PATCH] Update generated code (#1425) * Update generated code for v1095 * Update generated code for v1105 * Update generated code for v1111 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: Ramya Rao <100975018+ramya-stripe@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- lib/stripe/resources/customer_session.rb | 6 +-- lib/stripe/resources/invoice.rb | 60 ++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 4 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 1dbca34fc..d1614a49b 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1093 \ No newline at end of file +v1111 \ No newline at end of file diff --git a/lib/stripe/resources/customer_session.rb b/lib/stripe/resources/customer_session.rb index 73dcaf5a8..9d66e044d 100644 --- a/lib/stripe/resources/customer_session.rb +++ b/lib/stripe/resources/customer_session.rb @@ -2,8 +2,8 @@ # frozen_string_literal: true module Stripe - # A customer session allows you to grant client access to Stripe's frontend SDKs (like StripeJs) - # control over a customer. + # A Customer Session allows you to grant Stripe's frontend SDKs (like Stripe.js) client-side access + # control over a Customer. class CustomerSession < APIResource extend Stripe::APIOperations::Create @@ -12,7 +12,7 @@ def self.object_name "customer_session" end - # Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources. + # Creates a Customer Session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources. def self.create(params = {}, opts = {}) request_stripe_object( method: :post, diff --git a/lib/stripe/resources/invoice.rb b/lib/stripe/resources/invoice.rb index 4761243a6..a3c723344 100644 --- a/lib/stripe/resources/invoice.rb +++ b/lib/stripe/resources/invoice.rb @@ -49,6 +49,26 @@ def self.object_name nested_resource_class_methods :line, operations: %i[list] + # Adds multiple line items to an invoice. This is only possible when an invoice is still a draft. + def add_lines(params = {}, opts = {}) + request_stripe_object( + method: :post, + path: format("/v1/invoices/%s/add_lines", { invoice: CGI.escape(self["id"]) }), + params: params, + opts: opts + ) + end + + # Adds multiple line items to an invoice. This is only possible when an invoice is still a draft. + def self.add_lines(invoice, params = {}, opts = {}) + request_stripe_object( + method: :post, + path: format("/v1/invoices/%s/add_lines", { invoice: CGI.escape(invoice) }), + params: params, + opts: opts + ) + end + # This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you [finalize the invoice, which allows you to [pay](#pay_invoice) or send](https://stripe.com/docs/api#finalize_invoice) the invoice to your customers. def self.create(params = {}, opts = {}) request_stripe_object(method: :post, path: "/v1/invoices", params: params, opts: opts) @@ -165,6 +185,26 @@ def self.pay(invoice, params = {}, opts = {}) ) end + # Removes multiple line items from an invoice. This is only possible when an invoice is still a draft. + def remove_lines(params = {}, opts = {}) + request_stripe_object( + method: :post, + path: format("/v1/invoices/%s/remove_lines", { invoice: CGI.escape(self["id"]) }), + params: params, + opts: opts + ) + end + + # Removes multiple line items from an invoice. This is only possible when an invoice is still a draft. + def self.remove_lines(invoice, params = {}, opts = {}) + request_stripe_object( + method: :post, + path: format("/v1/invoices/%s/remove_lines", { invoice: CGI.escape(invoice) }), + params: params, + opts: opts + ) + end + def self.search(params = {}, opts = {}) request_stripe_object(method: :get, path: "/v1/invoices/search", params: params, opts: opts) end @@ -223,6 +263,26 @@ def self.update(id, params = {}, opts = {}) ) end + # Updates multiple line items on an invoice. This is only possible when an invoice is still a draft. + def update_lines(params = {}, opts = {}) + request_stripe_object( + method: :post, + path: format("/v1/invoices/%s/update_lines", { invoice: CGI.escape(self["id"]) }), + params: params, + opts: opts + ) + end + + # Updates multiple line items on an invoice. This is only possible when an invoice is still a draft. + def self.update_lines(invoice, params = {}, opts = {}) + request_stripe_object( + method: :post, + path: format("/v1/invoices/%s/update_lines", { invoice: CGI.escape(invoice) }), + params: params, + opts: opts + ) + end + # Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. # # Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://stripe.com/docs/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business.