OpenNodex v0.1.1 OpenNodex View Source
Documentation for OpenNodex.
Link to this section Summary
Functions
Create a charge
Get a specific charge
Get charges
Retrieve the available currencies
Retrieve the exchange rates
Link to this section Functions
Link to this function
create_charge(amount, base_currency, callback_url, success_url) View Source
Create a charge.
Examples
iex> callback_url = "https://example.com/callback"
iex> success_url = "https://example.com/success"
iex> OpenNodex.create_charge(99.01, "USD", callback_url, success_url)
%OpenNodex.Charge{callback_url: nil, name: nil, notif_email: nil, amount: 2573293, auto_settle: false, chain_invoice: %OpenNodex.Charge.ChainInvoice{address: "3btcaddress", settled_at: nil}, created_at: 1546732008, currency: "USD", description: "N/A", fiat_value: 99, id: "abbacadabba-d123-456a-baba-99bfdcfb16a1", lightning_invoice: %OpenNodex.Charge.LightningInvoice{created_at: 1546732009, expires_at: 1546735609, payreq: "lnbcsomelonginvoicestring", settled_at: nil}, notes: "", order_id: "N/A", source_fiat_value: 99, status: "unpaid", success_url: "https://site.com/order/abc123"}
Link to this function
get_charge(id) View Source
Get a specific charge.
Examples
iex> OpenNodex.get_charge("abbacadabba-d123-456a-baba-99bfdcfb16a1")
%OpenNodex.Charge{callback_url: nil, name: nil, notif_email: nil, amount: 2573293, auto_settle: false, chain_invoice: %OpenNodex.Charge.ChainInvoice{address: "3btcaddress", settled_at: nil}, created_at: 1546732008, currency: "USD", description: "N/A", fiat_value: 99, id: "abbacadabba-d123-456a-baba-99bfdcfb16a1", lightning_invoice: %OpenNodex.Charge.LightningInvoice{created_at: 1546732009, expires_at: 1546735609, payreq: "lnbcsomelonginvoicestring", settled_at: nil}, notes: "", order_id: "N/A", source_fiat_value: 99, status: "unpaid", success_url: "https://site.com/order/abc123"}
Link to this function
get_charges() View Source
Get charges.
Examples
iex> OpenNodex.get_charges()
[%OpenNodex.Charge{callback_url: nil, name: nil, notif_email: nil, amount: 2573293, auto_settle: false, chain_invoice: %OpenNodex.Charge.ChainInvoice{address: "3btcaddress", settled_at: nil}, created_at: 1546732008, currency: "USD", description: "N/A", fiat_value: 99, id: "abbacadabba-d123-456a-baba-99bfdcfb16a1", lightning_invoice: %OpenNodex.Charge.LightningInvoice{created_at: 1546732009, expires_at: 1546735609, payreq: "lnbcsomelonginvoicestring", settled_at: nil}, notes: "", order_id: "N/A", source_fiat_value: 99, status: "unpaid", success_url: "https://site.com/order/abc123"}]
Link to this function
get_currencies() View Source
Retrieve the available currencies.
Examples
iex> OpenNodex.get_currencies()
["USD", "EUR", "RUB", "HKD", "CAD"]
Link to this function
get_rates() View Source
Retrieve the exchange rates.
Examples
iex> OpenNodex.get_rates()
%{"BTCUSD" => %{"USD" => 3845.30}, "BTCEUR" => %{"EUR" => 2890.95}}