MollieEx.Payment (mollie_ex v0.4.0)

Copy Markdown View Source

Payment resource returned by the Mollie API.

Stable fields are exposed as snake_case struct fields. The original decoded Mollie response is preserved in raw with upstream JSON casing unchanged.

Summary

Functions

Returns true when the payment status is authorized.

Returns true when the payment status is canceled.

Returns the checkout URL when the payment has one.

Returns true when the payment status is expired.

Returns true when the payment status is failed.

Returns true when the payment has a chargebacks link.

Returns true when the payment has a refunds link.

Returns the mobile app checkout URL when the payment has one.

Returns true when the payment status is open.

Returns true when the payment has a paid_at timestamp.

Returns true when Mollie reports a remaining refundable amount.

Returns true when the payment status is pending.

Returns true when Mollie reports a remaining refundable amount.

Returns true when the payment sequence type is first.

Returns true when the payment sequence type is recurring.

Types

links()

@type links() :: %{optional(String.t()) => MollieEx.Types.Link.t() | term()}

t()

@type t() :: %MollieEx.Payment{
  amount: MollieEx.Types.Money.t() | nil,
  amount_captured: MollieEx.Types.Money.t() | nil,
  amount_charged_back: MollieEx.Types.Money.t() | nil,
  amount_refunded: MollieEx.Types.Money.t() | nil,
  amount_remaining: MollieEx.Types.Money.t() | nil,
  application_fee: term(),
  authorized_at: String.t() | nil,
  billing_address: term(),
  cancel_url: String.t() | nil,
  canceled_at: String.t() | nil,
  capture_before: String.t() | nil,
  capture_delay: String.t() | nil,
  capture_mode: String.t() | nil,
  country_code: String.t() | nil,
  created_at: String.t() | nil,
  customer_id: String.t() | nil,
  description: String.t() | nil,
  details: term(),
  expired_at: String.t() | nil,
  expires_at: String.t() | nil,
  failed_at: String.t() | nil,
  id: String.t(),
  is_cancelable: boolean() | nil,
  lines: term(),
  links: links(),
  locale: String.t() | nil,
  mandate_id: String.t() | nil,
  metadata: term(),
  method: String.t() | nil,
  mode: String.t() | nil,
  order_id: String.t() | nil,
  paid_at: String.t() | nil,
  profile_id: String.t() | nil,
  raw: map(),
  redirect_url: String.t() | nil,
  resource: String.t() | nil,
  restrict_payment_methods_to_country: String.t() | nil,
  routing: term(),
  sequence_type: String.t() | nil,
  settlement_amount: MollieEx.Types.Money.t() | nil,
  settlement_id: String.t() | nil,
  shipping_address: term(),
  status: String.t() | nil,
  status_reason: term(),
  subscription_id: String.t() | nil,
  webhook_url: String.t() | nil
}

Functions

authorized?(payment)

@spec authorized?(t() | term()) :: boolean()

Returns true when the payment status is authorized.

canceled?(payment)

@spec canceled?(t() | term()) :: boolean()

Returns true when the payment status is canceled.

checkout_url(payment)

@spec checkout_url(t() | term()) :: String.t() | nil

Returns the checkout URL when the payment has one.

expired?(payment)

@spec expired?(t() | term()) :: boolean()

Returns true when the payment status is expired.

failed?(payment)

@spec failed?(t() | term()) :: boolean()

Returns true when the payment status is failed.

has_chargebacks?(payment)

@spec has_chargebacks?(t() | term()) :: boolean()

Returns true when the payment has a chargebacks link.

has_refunds?(payment)

@spec has_refunds?(t() | term()) :: boolean()

Returns true when the payment has a refunds link.

mobile_app_checkout_url(payment)

@spec mobile_app_checkout_url(t() | term()) :: String.t() | nil

Returns the mobile app checkout URL when the payment has one.

open?(payment)

@spec open?(t() | term()) :: boolean()

Returns true when the payment status is open.

paid?(payment)

@spec paid?(t() | term()) :: boolean()

Returns true when the payment has a paid_at timestamp.

partially_refundable?(payment)

@spec partially_refundable?(t() | term()) :: boolean()

Returns true when Mollie reports a remaining refundable amount.

pending?(payment)

@spec pending?(t() | term()) :: boolean()

Returns true when the payment status is pending.

refundable?(payment)

@spec refundable?(t() | term()) :: boolean()

Returns true when Mollie reports a remaining refundable amount.

sequence_type_first?(payment)

@spec sequence_type_first?(t() | term()) :: boolean()

Returns true when the payment sequence type is first.

sequence_type_recurring?(payment)

@spec sequence_type_recurring?(t() | term()) :: boolean()

Returns true when the payment sequence type is recurring.