iyzico v1.5.6 Iyzico.Payment

A module representing information for successful payment returned from the platform.

Link to this section Summary

Types

Currency of the payment. Currently only Turkish Lira (:try) is supported

Fraud status of the payment. If fraud checking authority is performing a wait in operation, the result is :awaiting. A suspicious operation will be flagged by the authority as :restrict

t()

A struct representing processed payment

Functions

Converts a given integer representation of a fraud status of a payment to respective type

Link to this section Types

Link to this type currency()
currency() :: :try

Currency of the payment. Currently only Turkish Lira (:try) is supported.

Link to this type fraud_status()
fraud_status() :: :restrict | :awaiting | :ok

Fraud status of the payment. If fraud checking authority is performing a wait in operation, the result is :awaiting. A suspicious operation will be flagged by the authority as :restrict.

A merchant should proceed to the transaction if and only if value is :ok.

Link to this type t()
t() :: %Iyzico.Payment{basket_id: binary, bin_id: binary, card_ref: Iyzico.CardReference.t, commission_amount: number, commission_fee: number, conversation_id: binary, currency: currency, fraud_status: fraud_status, id: binary, installment: integer, last_four_digits: binary, merchant_commission_amount: number, merchant_commission_rate: number, paid_price: number, price: number, transactions: list}

A struct representing processed payment.

Fields

  • :basket_id: Unique identifier of the basket.
  • :bin_id: Unique identifier of the current bin.
  • :card_ref: Card persistence reference if card is persisted.
  • :conversation_id: Unique identifier of the conversation.
  • :currency: Active currency of the transaction.
  • :installment: The number of applied installments.
  • :transactions: The transactions of subsequent items in the payment.
  • :commission_fee: Commission fee applied to this particular transaction group (payment).
  • :commission_amount: Commission amount applied to the total of transactions.
  • :last_four_digits: Last four digits of the payment card provided.
  • :merchant_commission_rate: Merchant commission rate of the payment.
  • :merchant_commission_amount: Merchant commission amount of the payment.
  • :paid_price: Transaction value.
  • :price: Transaction base value.
  • :id: Payment identifier.

Link to this section Functions

Link to this function to_fraud_status(status)
to_fraud_status(integer) :: fraud_status

Converts a given integer representation of a fraud status of a payment to respective type.

Discussion

A merchant should only proceed to the transaction if and only if the fraud status is :ok. A payments fraud status would be :awaiting if transaction safety is being processed in present. Transactions with fraud status with :restrict value should be avoided.

Examples

iex> Iyzico.Payment.to_fraud_status -1
:restrict

iex> Iyzico.Payment.to_fraud_status 0
:awaiting

iex> Iyzico.Payment.to_fraud_status 1
:ok