Skip to content

Commit

Permalink
Update generated code for v1165
Browse files Browse the repository at this point in the history
  • Loading branch information
stripe-openapi[bot] committed Jul 31, 2024
1 parent 10babeb commit 87190ff
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1156
v1165
44 changes: 44 additions & 0 deletions lib/stripe/resources/invoice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,50 @@ def self.add_lines(invoice, params = {}, opts = {})
)
end

# Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of payments.
#
# For Out of Band Payment, the payment is credited to the invoice immediately, increasing the amount_paid
# of the invoice and subsequently transitioning the status of the invoice to paid if necessary.
#
# For the PaymentIntent, when the PaymentIntent's status changes to succeeded, the payment is credited
# to the invoice, increasing its amount_paid. When the invoice is fully paid, the
# invoice's status becomes paid.
#
# If the PaymentIntent's status is already succeeded when it's attached, it's
# credited to the invoice immediately.
#
# See: [Create an invoice payment](https://stripe.com/docs/invoicing/payments/create) to learn more.
def attach_payment(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/invoices/%<invoice>s/attach_payment", { invoice: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end

# Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of payments.
#
# For Out of Band Payment, the payment is credited to the invoice immediately, increasing the amount_paid
# of the invoice and subsequently transitioning the status of the invoice to paid if necessary.
#
# For the PaymentIntent, when the PaymentIntent's status changes to succeeded, the payment is credited
# to the invoice, increasing its amount_paid. When the invoice is fully paid, the
# invoice's status becomes paid.
#
# If the PaymentIntent's status is already succeeded when it's attached, it's
# credited to the invoice immediately.
#
# See: [Create an invoice payment](https://stripe.com/docs/invoicing/payments/create) to learn more.
def self.attach_payment(invoice, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/invoices/%<invoice>s/attach_payment", { invoice: CGI.escape(invoice) }),
params: params,
opts: opts
)
end

# Attaches a PaymentIntent to the invoice, adding it to the list of payments.
# When the PaymentIntent's status changes to succeeded, the payment is credited
# to the invoice, increasing its amount_paid. When the invoice is fully paid, the
Expand Down

0 comments on commit 87190ff

Please sign in to comment.