Apruve v0.1.0 Apruve.Order View Source
Module for Apruve orders.
Link to this section Summary
Functions
Get all orders. Optionally only ones matching a certain merchant_order_id
Create an order
Convert a JSON string to an Order struct or list of Order structs
Get an order by the Apruve order id
Calculates the secure hash
Link to this section Types
t() :: %Apruve.Order{
accepts_payment_terms: term(),
accepts_payments_via: term(),
amount_cents: term(),
created_at: term(),
currency: term(),
default_payment_method: term(),
expire_at: term(),
final_state_at: term(),
finalize_on_create: term(),
id: term(),
invoice_on_create: term(),
links: term(),
merchant_id: term(),
merchant_order_id: term(),
order_items: term(),
payment_term: term(),
payment_terms: term(),
secure_hash: term(),
shipping_cents: term(),
shopper_id: term(),
status: term(),
tax_cents: term(),
updated_at: term()
}
Link to this section Functions
Get all orders. Optionally only ones matching a certain merchant_order_id.
A merchant order id is the order id used by the merchant.
Results can be limited to the first 25 orders by the server side API.
create(t(), Apruve.ClientConfig.t() | :from_app_config) :: {:ok, t()} | {:error, any()}
Create an order.
Convert a JSON string to an Order struct or list of Order structs.
get(order_id(), Apruve.ClientConfig.t() | :from_app_config) :: {:ok, Apruve.Order.t()} | {:error, any()}
Get an order by the Apruve order id.
iex> {:ok, order} = Apruve.Order.get("719101ae45b8fab4fb542ed65b455635", test_config())
iex> order.id
"02b263350ba2a8f59b0d6e00645cc251"
secure_hash_for_order_and_api_key( t(), String.t() | Apruve.ClientConfig.t() | :from_app_config ) :: String.t()
Calculates the secure hash.
Takes an order and one of: an API key, an Apruve.ClientConfig struct or :from_app_config
See https://docs.apruve.com/docs/merchant-integration-tutorial-1 for more details.
to_json(%Apruve.Order{
accepts_payment_terms: term(),
accepts_payments_via: term(),
amount_cents: term(),
created_at: term(),
currency: term(),
default_payment_method: term(),
expire_at: term(),
final_state_at: term(),
finalize_on_create: term(),
id: term(),
invoice_on_create: term(),
links: term(),
merchant_id: term(),
merchant_order_id: term(),
order_items: term(),
payment_term: term(),
payment_terms: term(),
secure_hash: term(),
shipping_cents: term(),
shopper_id: term(),
status: term(),
tax_cents: term(),
updated_at: term()
}) :: {:ok, String.t()} | {:error, any()}