Current section

Files

Jump to
polarex lib polarex schemas refund_create.ex
Raw

lib/polarex/schemas/refund_create.ex

defmodule Polarex.RefundCreate do
@moduledoc """
Provides struct and type for a RefundCreate
"""
@type t :: %__MODULE__{
amount: integer,
comment: String.t() | nil,
metadata: Polarex.Metadata.t() | nil,
order_id: String.t(),
reason: String.t(),
revoke_benefits: boolean | nil
}
defstruct [:amount, :comment, :metadata, :order_id, :reason, :revoke_benefits]
@doc false
@spec __fields__(atom) :: keyword
def __fields__(type \\ :t)
def __fields__(:t) do
[
amount: :integer,
comment: {:union, [{:string, :generic}, :null]},
metadata: {Polarex.Metadata, :t},
order_id: {:string, :generic},
reason:
{:enum,
[
"duplicate",
"fraudulent",
"customer_request",
"service_disruption",
"satisfaction_guarantee",
"dispute_prevention",
"other"
]},
revoke_benefits: :boolean
]
end
end