View Source Stripe.PaymentRecord (stripity_stripe v3.3.1)

A Payment Record is a resource that allows you to represent payments that occur on- or off-Stripe. For example, you can create a Payment Record to model a payment made on a different payment processor, in order to mark an Invoice as paid and a Subscription as active. Payment Records consist of one or more Payment Attempt Records, which represent individual attempts made on a payment network.

Summary

Types

The billing address associated with the method of payment.

A positive integer in the smallest currency unit representing how much of this payment to refund. Can refund only up to the remaining, unrefunded amount of the payment.

The amount you initially requested for this payment.

The billing details associated with the method of payment.

Information about the custom (user-defined) payment method used to make this payment.

Customer information for this payment.

Information about the payment attempt failure.

Information about the payment attempt guarantee.

Information about the Payment Method debited for this payment.

Processor information for this refund.

Information about the payment attempt refund.

Shipping information for this payment.

t()

The payment_record type.

Functions

Report a new Payment Record. You may report a Payment Record as it is initialized and later report updates through the other report_* methods, or report Payment Records in a terminal state directly, through this method.

Report a new payment attempt on the specified Payment Record. A new payment attempt can only be specified if all other payment attempts are canceled or failed.

Report that the most recent payment attempt on the specified Payment Record was canceled.

Report that the most recent payment attempt on the specified Payment Record failed or errored.

Report that the most recent payment attempt on the specified Payment Record was guaranteed.

Report informational updates on the specified Payment Record.

Report that the most recent payment attempt on the specified Payment Record was refunded.

Retrieves a Payment Record with the given ID

Types

@type address() :: %{
  optional(:city) => binary(),
  optional(:country) => binary(),
  optional(:line1) => binary(),
  optional(:line2) => binary(),
  optional(:postal_code) => binary(),
  optional(:state) => binary()
}

The billing address associated with the method of payment.

@type amount() :: %{optional(:currency) => binary(), optional(:value) => integer()}

A positive integer in the smallest currency unit representing how much of this payment to refund. Can refund only up to the remaining, unrefunded amount of the payment.

@type amount_requested() :: %{
  optional(:currency) => binary(),
  optional(:value) => integer()
}

The amount you initially requested for this payment.

@type billing_details() :: %{
  optional(:address) => address(),
  optional(:email) => binary(),
  optional(:name) => binary(),
  optional(:phone) => binary()
}

The billing details associated with the method of payment.

@type custom() :: %{optional(:display_name) => binary(), optional(:type) => binary()}

Information about the custom (user-defined) payment method used to make this payment.

@type customer_details() :: %{
  optional(:customer) => binary(),
  optional(:email) => binary(),
  optional(:name) => binary(),
  optional(:phone) => binary()
}

Customer information for this payment.

@type failed() :: %{optional(:failed_at) => integer()}

Information about the payment attempt failure.

@type guaranteed() :: %{optional(:guaranteed_at) => integer()}

Information about the payment attempt guarantee.

Link to this type

payment_method_details()

View Source
@type payment_method_details() :: %{
  optional(:billing_details) => billing_details(),
  optional(:custom) => custom(),
  optional(:payment_method) => binary(),
  optional(:type) => :custom
}

Information about the Payment Method debited for this payment.

@type processor_details() :: %{
  optional(:custom) => custom(),
  optional(:type) => :custom
}

Processor information for this refund.

@type refunded() :: %{optional(:refunded_at) => integer()}

Information about the payment attempt refund.

@type shipping_details() :: %{
  optional(:address) => address(),
  optional(:name) => binary(),
  optional(:phone) => binary()
}

Shipping information for this payment.

@type t() :: %Stripe.PaymentRecord{
  amount: term(),
  amount_authorized: term(),
  amount_canceled: term(),
  amount_failed: term(),
  amount_guaranteed: term(),
  amount_refunded: term(),
  amount_requested: term(),
  application: binary() | nil,
  created: integer(),
  customer_details: term() | nil,
  customer_presence: binary() | nil,
  description: binary() | nil,
  id: binary(),
  latest_payment_attempt_record: binary() | nil,
  livemode: boolean(),
  metadata: term(),
  object: binary(),
  payment_method_details: term() | nil,
  processor_details: term(),
  shipping_details: term() | nil
}

The payment_record type.

  • amount
  • amount_authorized
  • amount_canceled
  • amount_failed
  • amount_guaranteed
  • amount_refunded
  • amount_requested
  • application ID of the Connect application that created the PaymentRecord.
  • created Time at which the object was created. Measured in seconds since the Unix epoch.
  • customer_details Customer information for this payment.
  • customer_presence Indicates whether the customer was present in your checkout flow during this payment.
  • description An arbitrary string attached to the object. Often useful for displaying to users.
  • id Unique identifier for the object.
  • latest_payment_attempt_record ID of the latest Payment Attempt Record attached to this Payment Record.
  • livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode.
  • metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
  • object String representing the object's type. Objects of the same type share the same value.
  • payment_method_details Information about the Payment Method debited for this payment.
  • processor_details
  • shipping_details Shipping information for this payment.

Functions

Link to this function

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

View Source
@spec report_payment(
  params :: %{
    optional(:amount_requested) => amount_requested(),
    optional(:customer_details) => customer_details(),
    optional(:customer_presence) => :off_session | :on_session,
    optional(:description) => binary(),
    optional(:expand) => [binary()],
    optional(:failed) => failed(),
    optional(:guaranteed) => guaranteed(),
    optional(:initiated_at) => integer(),
    optional(:metadata) => %{optional(binary()) => binary()} | binary(),
    optional(:outcome) => :failed | :guaranteed,
    optional(:payment_method_details) => payment_method_details(),
    optional(:processor_details) => processor_details(),
    optional(:shipping_details) => shipping_details()
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Report a new Payment Record. You may report a Payment Record as it is initialized and later report updates through the other report_* methods, or report Payment Records in a terminal state directly, through this method.

#### Details * Method: `post` * Path: `/v1/payment_records/report_payment`

Link to this function

report_payment_attempt(id, params \\ %{}, opts \\ [])

View Source
@spec report_payment_attempt(
  id :: binary(),
  params :: %{
    optional(:description) => binary(),
    optional(:expand) => [binary()],
    optional(:failed) => failed(),
    optional(:guaranteed) => guaranteed(),
    optional(:initiated_at) => integer(),
    optional(:metadata) => %{optional(binary()) => binary()} | binary(),
    optional(:outcome) => :failed | :guaranteed,
    optional(:payment_method_details) => payment_method_details(),
    optional(:shipping_details) => shipping_details()
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Report a new payment attempt on the specified Payment Record. A new payment attempt can only be specified if all other payment attempts are canceled or failed.

#### Details * Method: `post` * Path: `/v1/payment_records/{id}/report_payment_attempt`

Link to this function

report_payment_attempt_canceled(id, params \\ %{}, opts \\ [])

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

Report that the most recent payment attempt on the specified Payment Record was canceled.

#### Details * Method: `post` * Path: `/v1/payment_records/{id}/report_payment_attempt_canceled`

Link to this function

report_payment_attempt_failed(id, params \\ %{}, opts \\ [])

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

Report that the most recent payment attempt on the specified Payment Record failed or errored.

#### Details * Method: `post` * Path: `/v1/payment_records/{id}/report_payment_attempt_failed`

Link to this function

report_payment_attempt_guaranteed(id, params \\ %{}, opts \\ [])

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

Report that the most recent payment attempt on the specified Payment Record was guaranteed.

#### Details * Method: `post` * Path: `/v1/payment_records/{id}/report_payment_attempt_guaranteed`

Link to this function

report_payment_attempt_informational(id, params \\ %{}, opts \\ [])

View Source
@spec report_payment_attempt_informational(
  id :: binary(),
  params :: %{
    optional(:customer_details) => customer_details(),
    optional(:description) => binary() | binary(),
    optional(:expand) => [binary()],
    optional(:metadata) => %{optional(binary()) => binary()} | binary(),
    optional(:shipping_details) => shipping_details() | binary()
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Report informational updates on the specified Payment Record.

Details

  • Method: post
  • Path: /v1/payment_records/{id}/report_payment_attempt_informational
Link to this function

report_refund(id, params \\ %{}, opts \\ [])

View Source
@spec report_refund(
  id :: binary(),
  params :: %{
    optional(:amount) => amount(),
    optional(:expand) => [binary()],
    optional(:initiated_at) => integer(),
    optional(:metadata) => %{optional(binary()) => binary()} | binary(),
    optional(:outcome) => :refunded,
    optional(:processor_details) => processor_details(),
    optional(:refunded) => refunded()
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Report that the most recent payment attempt on the specified Payment Record was refunded.

#### Details * Method: `post` * Path: `/v1/payment_records/{id}/report_refund`

Link to this function

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

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

Retrieves a Payment Record with the given ID

Details

  • Method: get
  • Path: /v1/payment_records/{id}