Indacoin v1.0.1 Indacoin View Source

An Elixir interface to the Indacoin API.

List Of Requests Params

  • cur_from :: string – Currency code which defines the currency in which customer wish to do the payment; used to define price parameter. Possible values: USD, EURO, RUB.
  • cur_in :: string ^^^
  • cur_to :: string – Cryptocurrency code which defines the currency in which customer wish to receive payouts. Currency conversions are done at Indacoin. Full list of supported cryptocurrencies
  • cur_out :: string ^^^
  • amount :: decimal – The price set by the customer. Example: 299.99 The minimum transaction limit is 50 USD/EUR. The maximum transaction limit is 3000 USD/EUR.
  • amount_in :: decimal ^^^
  • address :: string – Wallet address for receiving payouts.
  • target_address :: string ^^^
  • partner :: string – Indacoin Affiliate Program member.
  • user_id :: string – Customer custom ID. Using a unique value or email is strongly recommended.

Transaction Statuses

  • NotFound
  • Chargeback
  • Declined
  • Cancelled
  • Failed
  • Draft
  • Paid
  • Verification
  • FundsSent
  • Finished

Link to this section Summary

Functions

Fetches Indacoin API host from the application config

Retrieves a list of all available coins sorted by ticker

Drafts payment transaction and returns its ID

Generates a link that forwards a user directly to the payment form without creating transaction via API

Fetches Indacoin API key (a partner name) from the application config

Fetches Indacoin API secret key from the application config

Retrieves transaction info by its id

Generates a link that forwards a user to the payment form. To create the request you need to get transaction ID via create_transaction/1 method

Gets value of amount that customer will get once payment transaction finished

Retrieves a list of transactions

Indacoin will send a callback to your application’s exposed URL when a customer makes a payment

Link to this section Functions

Fetches Indacoin API host from the application config.

Retrieves a list of all available coins sorted by ticker.

Link to this function construct_signature(nonce \\ Enum.random(100000..1000000)) View Source
Link to this function create_transaction(params) View Source

Drafts payment transaction and returns its ID.

Signed API request.

“STANDARD INTEGRATION”

params

Required request params:

  • user_id :: string
  • cur_in :: string
  • cur_out :: string
  • target_address :: string
  • amount_in :: decimal

Generates a link that forwards a user directly to the payment form without creating transaction via API.

Example

“LIGHT INTEGRATION”

params

Required request params:

  • cur_from :: string
  • cur_to :: string
  • amount :: decimal
  • address :: string
  • partner :: string

Optional request params:

  • user_id :: string

Fetches Indacoin API key (a partner name) from the application config.

Fetches Indacoin API secret key from the application config.

Retrieves transaction info by its id.

Signed API request.

Link to this function transaction_link(transaction_id) View Source

Generates a link that forwards a user to the payment form. To create the request you need to get transaction ID via create_transaction/1 method.

Signed API request.

Example

params

Required request params:

  • transaction_id :: integer
Link to this function transaction_price(params \\ %{}) View Source

Gets value of amount that customer will get once payment transaction finished.

params

Required request params:

  • cur_from :: string
  • cur_to :: string
  • amount :: decimal

Optional request params:

  • partner :: string
  • user_id :: string
Link to this function transaction_price_request_url(params \\ %{}) View Source

false

Link to this function transactions_history(params \\ %{}) View Source

Retrieves a list of transactions.

Signed API request.

Paging Through Results Using Offset and Limit

  • limit=10 -> Returns the first 10 records.
  • offset=5&limit=5 -> Returns records 6..10.
  • offset=10 -> Returns records 11..61 (the default number of the returned records is 50).

params

All params are optional:

  • user_id :: string
  • tx_id :: string
  • status :: string
  • created_at :: integer / timestamp
  • hash :: string
  • cur_in :: string
  • cur_out :: string
  • amount_in :: decimal
  • amount_out :: decimal
  • target_address :: string
  • limit :: integer
  • offset :: integer
Link to this function valid_callback_signature?(indacoin_signature, indacoin_nonce, user_id, tx_id) View Source

Indacoin will send a callback to your application’s exposed URL when a customer makes a payment.

While testing, you can accept all incoming callbacks, but in production, you’ll need to verify the authenticity of incoming requests.

params

Required request params:

  • indacoin_signature :: string
  • indacoin_nonce :: integer
  • user_id :: string
  • tx_id :: integer