Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generated code #1425

Merged
merged 4 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1093
v1111
6 changes: 3 additions & 3 deletions lib/stripe/resources/customer_session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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,
Expand Down
60 changes: 60 additions & 0 deletions lib/stripe/resources/invoice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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/%<invoice>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/%<invoice>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 <a href="#send_invoice">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)
Expand Down Expand Up @@ -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/%<invoice>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/%<invoice>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
Expand Down Expand Up @@ -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/%<invoice>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/%<invoice>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 <a href="#create_credit_note">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.
Expand Down
Loading