Skip to content

Commit

Permalink
Update generated code for v643
Browse files Browse the repository at this point in the history
  • Loading branch information
stripe-openapi[bot] committed Nov 2, 2023
1 parent 0d538ab commit 6ba63d9
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v640
v643
1 change: 1 addition & 0 deletions lib/stripe/object_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def self.object_names_to_classes
Invoice::OBJECT_NAME => Invoice,
InvoiceItem::OBJECT_NAME => InvoiceItem,
InvoiceLineItem::OBJECT_NAME => InvoiceLineItem,
InvoicePayment::OBJECT_NAME => InvoicePayment,
Issuing::Authorization::OBJECT_NAME => Issuing::Authorization,
Issuing::Card::OBJECT_NAME => Issuing::Card,
Issuing::Cardholder::OBJECT_NAME => Issuing::Cardholder,
Expand Down
1 change: 1 addition & 0 deletions lib/stripe/resources.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
require "stripe/resources/invoice"
require "stripe/resources/invoice_item"
require "stripe/resources/invoice_line_item"
require "stripe/resources/invoice_payment"
require "stripe/resources/issuing/authorization"
require "stripe/resources/issuing/card"
require "stripe/resources/issuing/cardholder"
Expand Down
21 changes: 21 additions & 0 deletions lib/stripe/resources/invoice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,21 @@ class Invoice < APIResource
extend Stripe::APIOperations::List
extend Stripe::APIOperations::Search
include Stripe::APIOperations::Save
extend Stripe::APIOperations::NestedResource

OBJECT_NAME = "invoice"

nested_resource_class_methods :payment, operations: %i[retrieve list]

def attach_payment_intent(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/invoices/%<invoice>s/attach_payment_intent", { invoice: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end

def finalize_invoice(params = {}, opts = {})
request_stripe_object(
method: :post,
Expand Down Expand Up @@ -88,6 +100,15 @@ def void_invoice(params = {}, opts = {})
)
end

def self.attach_payment_intent(invoice, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/invoices/%<invoice>s/attach_payment_intent", { invoice: CGI.escape(invoice) }),
params: params,
opts: opts
)
end

def self.finalize_invoice(invoice, params = {}, opts = {})
request_stripe_object(
method: :post,
Expand Down
11 changes: 11 additions & 0 deletions lib/stripe/resources/invoice_payment.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true

module Stripe
# The invoice payment object
class InvoicePayment < APIResource
extend Stripe::APIOperations::List

OBJECT_NAME = "invoice_payment"
end
end

0 comments on commit 6ba63d9

Please sign in to comment.