iyzico v1.5.3 Iyzico.BinInquiry

Functions for inquirying cards from their BIN numbers to fetch superficial information.

Motivation

Before requesting to confirm a payment,

  • users could be interrogated with available installment options, or
  • one might need to show card family as an overlay in the user interface of an application, or
  • user interface might show a switch for 3D Secure preference of a user.

Emanating from those philosophical concerns, a superficial information could be fetched upon given BIN number, which is first 6 characters of a credit card number.

Performing inquiry

You can retrieve card information with providing a BIN number:

{:ok, inquiry, metadata} = perform_inquiry("450634", "123456789", "100.00")

If you already have a card, you can also supply it to the same function:

card = %Iyzico.Card{}

{:ok, inquiry, metadata} = perform_inquiry(card, "123456789", "100.00")

Common options

  • :api_key: API key to be used in authentication, optional. Configuration is used instead if not supplied.

  • :api_secret: API secret key to be used in authentication. Configuration is used instead if not supplied.

Link to this section Summary

Functions

Inquiries given BIN number/card with price, retrieves details and specifications for the given card, available installment options and shows whether usage of 3D Secure is mandatory

Link to this section Types

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

Link to this section Functions

Link to this function perform_inquiry(bin_or_card, conversation_id, price, currency, opts \\ [])
perform_inquiry(Iyzico.Card.t | binary, binary, binary, currency, Keyword.t) ::
  {:ok, Iyzico.Inquiry.t, Iyzico.Metadata.t} |
  {:error, atom}

Inquiries given BIN number/card with price, retrieves details and specifications for the given card, available installment options and shows whether usage of 3D Secure is mandatory.

Caveats

  • If the card appears to be a :debit card, 3D Secure is mandatory.
  • The underlying inquiry response represents a subset of the values found in Installment & Commission Management panel.
  • Local cards could not perform transactions in foreign currencies.

Options

See common options.