lib/stripe/services/invoice_service.rb in stripe-13.2.0.pre.beta.3 vs lib/stripe/services/invoice_service.rb in stripe-13.2.0
- old
+ new
@@ -1,65 +1,22 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
class InvoiceService < StripeService
- attr_reader :payments, :line_items, :upcoming_lines
+ attr_reader :line_items, :upcoming_lines
def initialize(requestor)
super(requestor)
- @payments = Stripe::InvoicePaymentService.new(@requestor)
@line_items = Stripe::InvoiceLineItemService.new(@requestor)
@upcoming_lines = Stripe::InvoiceUpcomingLinesService.new(@requestor)
end
# Adds multiple line items to an invoice. This is only possible when an invoice is still a draft.
def add_lines(invoice, params = {}, opts = {})
request(
method: :post,
path: format("/v1/invoices/%<invoice>s/add_lines", { invoice: CGI.escape(invoice) }),
- params: params,
- opts: opts,
- base_address: :api
- )
- 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(invoice, params = {}, opts = {})
- request(
- method: :post,
- path: format("/v1/invoices/%<invoice>s/attach_payment", { invoice: CGI.escape(invoice) }),
- params: params,
- opts: opts,
- base_address: :api
- )
- 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
- # invoice's status becomes paid.
- #
- # If the PaymentIntent's status is already succeeded when it is attached, it is
- # credited to the invoice immediately.
- #
- # Related guide: [Create an invoice payment](https://stripe.com/docs/invoicing/payments/create)
- def attach_payment_intent(invoice, params = {}, opts = {})
- request(
- method: :post,
- path: format("/v1/invoices/%<invoice>s/attach_payment_intent", { invoice: CGI.escape(invoice) }),
params: params,
opts: opts,
base_address: :api
)
end