unilink_client v1.0.1 UnilinkClient behaviour View Source
Documentation for UnilinkClient.
Link to this section Summary
Types
Profit map returned by Unilink service in callback when user requests payout.
Should be used in handle_profit/1
callback to add user balance
Functions
Returns URL to which we should redirect user so he can login seemlessly to Unilink
Finds secret for given api_key (from settings provided by UnilinkClient implementation)
Callbacks
Invoked on lazy work to delay it
Invoked at server start to delay startup
Invoked to get API keys and secrets. Allows to setup multiple platforms
Invoked when user requests withdrawal of his affiliation funds
Link to this section Types
Profit map returned by Unilink service in callback when user requests payout.
Should be used in handle_profit/1
callback to add user balance.
Link to this section Functions
Returns URL to which we should redirect user so he can login seemlessly to Unilink
Finds secret for given api_key (from settings provided by UnilinkClient implementation)
Link to this section Callbacks
get_server_lazy_work_delay() :: integer()
Invoked on lazy work to delay it
get_server_start_delay() :: integer()
Invoked at server start to delay startup
get_settings() :: [UnilinkClient.Setting.t()] | UnilinkClient.Setting.t()
Invoked to get API keys and secrets. Allows to setup multiple platforms.
Typically you want to implement it to return just UnilinkClient.Setting
struct.
It is possible to return multiple UnilinkClient.Setting
structs (in a list)
if you handle multiple Unilink accounts in one service.
Invoked when user requests withdrawal of his affiliation funds.
Unilink follows at least once delivery semantics and will retry requests until successful response is received. Client Platform may receive the same request more than once and SHOULD make sure that users profit is assigned only once for each unique ID of payout request. Client Platform SHOULD respond with code 202 upon receival of already processed payout request.