View Source Stripe.InvoicePayment (stripity_stripe v3.3.1)

Invoice Payments represent payments made against invoices. Invoice Payments can be accessed in two ways:

  1. By expanding the payments field on the Invoice resource.
  2. By using the Invoice Payment retrieve and list endpoints.

Invoice Payments include the mapping between payment objects, such as Payment Intent, and Invoices. This resource and its endpoints allows you to easily track if a payment is associated with a specific invoice and monitor the allocation details of the payments.

Summary

Types

t()

The invoice_payment type.

Functions

When retrieving an invoice, there is an includable payments property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of payments.

Retrieves the invoice payment with the given ID.

Types

@type created() :: %{
  optional(:gt) => integer(),
  optional(:gte) => integer(),
  optional(:lt) => integer(),
  optional(:lte) => integer()
}
@type payment() :: %{
  optional(:payment_intent) => binary(),
  optional(:payment_record) => binary(),
  optional(:type) => :payment_intent | :payment_record
}
@type t() :: %Stripe.InvoicePayment{
  amount_paid: integer() | nil,
  amount_requested: integer(),
  created: integer(),
  currency: binary(),
  id: binary(),
  invoice: binary() | Stripe.Invoice.t() | Stripe.DeletedInvoice.t(),
  is_default: boolean(),
  livemode: boolean(),
  object: binary(),
  payment: term(),
  status: binary(),
  status_transitions: term()
}

The invoice_payment type.

  • amount_paid Amount that was actually paid for this invoice, in cents (or local equivalent). This field is null until the payment is paid. This amount can be less than the amount_requested if the PaymentIntent’s amount_received is not sufficient to pay all of the invoices that it is attached to.
  • amount_requested Amount intended to be paid toward this invoice, in cents (or local equivalent)
  • created Time at which the object was created. Measured in seconds since the Unix epoch.
  • currency Three-letter ISO currency code, in lowercase. Must be a supported currency.
  • id Unique identifier for the object.
  • invoice The invoice that was paid.
  • is_default Stripe automatically creates a default InvoicePayment when the invoice is finalized, and keeps it synchronized with the invoice’s amount_remaining. The PaymentIntent associated with the default payment can’t be edited or canceled directly.
  • livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode.
  • object String representing the object's type. Objects of the same type share the same value.
  • payment
  • status The status of the payment, one of open, paid, or canceled.
  • status_transitions

Functions

Link to this function

list(params \\ %{}, opts \\ [])

View Source
@spec list(
  params :: %{
    optional(:created) => created() | integer(),
    optional(:ending_before) => binary(),
    optional(:expand) => [binary()],
    optional(:invoice) => binary(),
    optional(:limit) => integer(),
    optional(:payment) => payment(),
    optional(:starting_after) => binary(),
    optional(:status) => :canceled | :open | :paid
  },
  opts :: Keyword.t()
) ::
  {:ok, Stripe.List.t(t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

When retrieving an invoice, there is an includable payments property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of payments.

Details

  • Method: get
  • Path: /v1/invoice_payments
Link to this function

retrieve(invoice_payment, params \\ %{}, opts \\ [])

View Source
@spec retrieve(
  invoice_payment :: binary(),
  params :: %{optional(:expand) => [binary()]},
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Retrieves the invoice payment with the given ID.

Details

  • Method: get
  • Path: /v1/invoice_payments/{invoice_payment}