MishkaPay.Payment.FraudReview (Mishka Pay v0.0.1)

Copy Markdown View Source

A payment the provider's fraud rules held for the seller to look at before it goes on (a review, prv_... at Stripe Radar). A guarded_struct the provider fills in, read with MishkaPay.fetch_fraud_review/3 and MishkaPay.list_fraud_reviews/3, and let through with MishkaPay.approve_fraud_review/3. Refunding the payment closes it the other way.

  • :id, :payment_id, :charge_id: the review and the payment it holds.
  • :open: whether it still waits for the seller.
  • :opened_reason: :rule (a fraud rule placed it) or :manual (someone did).
  • :reason: why it is open or how it closed, in the provider's words ("rule", "manual", "approved", "refunded", "refunded_as_fraud", "disputed", "redacted"...); :closed_reason only how it closed.
  • :ip_address: where the buyer paid from, when the provider knows.
  • :created_at.

Summary

Types

t()

The struct that builder/1 returns.

Functions

A sample %MishkaPay.Payment.FraudReview{} populated from defaults + type-based fallbacks.

Types

t()

@type t() :: %MishkaPay.Payment.FraudReview{
  charge_id: String.t() | nil,
  closed_reason: String.t() | nil,
  created_at: DateTime.t() | nil,
  id: String.t(),
  ip_address: String.t() | nil,
  open: boolean() | nil,
  opened_reason: (:rule | :manual) | nil,
  payment_id: String.t() | nil,
  provider: String.t(),
  reason: String.t() | nil
}

The struct that builder/1 returns.

FieldTypeRequiredDefaultDescriptionDerives
:providerString.t()yesvalidate(not_nil_value, string)
:idString.t()yesvalidate(not_nil_value, string, not_empty)
:payment_idString.t() | nilnovalidate(string)
:charge_idString.t() | nilnovalidate(string)
:openboolean() | nilnofalsevalidate(boolean)
:opened_reason:rule | :manual | nilnovalidate(enum=Atom[rule::manual])
:reasonString.t() | nilnovalidate(string)
:closed_reasonString.t() | nilnovalidate(string)
:ip_addressString.t() | nilnovalidate(string)
:created_atDateTime.t() | nilnovalidate(struct)

Functions

builder(attrs_or_input, error \\ false)

enforce_keys()

enforce_keys(field)

example()

A sample %MishkaPay.Payment.FraudReview{} populated from defaults + type-based fallbacks.

keys()

keys(field)