Scrip v1.0.0 Scrip.Config View Source
Handles the configuration
Link to this section Summary
Types
Http Client, must implement Scrip.Client behaviour
Json encoder, must implement encode!/1,decode!/1 functions like Jason does
Opts to be passed in to the verify/3 function. Will be merged with the config
Your app's shared secret (a hexadecimal string). Use this field only for receipts that contain auto-renewable subscriptions.
Will be passed to the http adapter. Useful for setting timeouts etc.
Configuration
Link to this section Types
Specs
client() :: module()
Http Client, must implement Scrip.Client behaviour
Defaults to Scrip.Client.HTTPoison wrapping HTTPoison
Specs
json_encoder() :: module()
Json encoder, must implement encode!/1,decode!/1 functions like Jason does
Defaults to Jason
Specs
opts() ::
{:client, client()}
| {:json_encoder, json_encoder()}
| {:production_url, String.t()}
| {:sandbox_url, String.t()}
| {:password, password()}
| {:request_opts, keyword()}
Opts to be passed in to the verify/3 function. Will be merged with the config
Specs
password() :: String.t()
Your app's shared secret (a hexadecimal string). Use this field only for receipts that contain auto-renewable subscriptions.
Specs
request_opts() :: keyword()
Will be passed to the http adapter. Useful for setting timeouts etc.
Are dependant on the http client
Specs
t() :: %Scrip.Config{
client: client(),
json_encoder: json_encoder(),
password: password(),
production_url: String.t(),
request_opts: request_opts(),
sandbox_url: String.t()
}
Configuration
Link to this section Functions
Struct that holds the configuration
See the types for what values can be passed in
Specs
Build new config struct. Any key in the struct can be passed in to new/1 as a keyword list
to override the defaults.