View Source WebmaniaNfe.Invoice (WebmaniaNfe v0.2.0)
Documentation for WebmaniaNfe.Invoice, is used by WebmaniaNfe.
Usage
Before using the WebmaniaNfe SDk, you need to configure it with your credentials.
The simplest way to do this is via WebmaniaNfe.Client.Config.new/5:
iex> config = WebmaniaNfe.Client.Config.new("https://webmaniabr.com/api/", "CONSUMER_KEY", "CONSUMER_SECRET", "ACCESS_TOKEN", "ACCESS_TOKEN_SECRET")
%WebmaniaNfe.Client.Config{
base_url: "https://webmaniabr.com/api/",
consumer_key: "CONSUMER_KEY",
consumer_secret: "CONSUMER_SECRET",
access_token: "ACCESS_TOKEN",
access_token_secret: "ACCESS_TOKEN_SECRET"
}Config is used to create the client:
iex> config |> WebmaniaNfe.Client.new()
%WebmaniaNfe.Client{
config: %WebmaniaNfe.Client.Config{
base_url: "https://webmaniabr.com/api/",
consumer_key: "CONSUMER_KEY",
consumer_secret: "CONSUMER_SECRET",
access_token: "ACCESS_TOKEN",
access_token_secret: "ACCESS_TOKEN_SECRET"
},
headers: [
{"Content-Type", "application/json"},
{"X-Consumer-Key", "CONSUMER_KEY"},
{"X-Consumer-Secret", "CONSUMER_SECRET"},
{"X-Access-Token", "ACCESS_TOKEN"},
{"X-Access-Token-Secret", "ACCESS_TOKEN_SECRET"}
],
request: nil,
response: nil
}You can create the client directly also:
iex> WebmaniaNfe.Client.new("https://webmaniabr.com/api/", "CONSUMER_KEY", "CONSUMER_SECRET", "ACCESS_TOKEN", "ACCESS_TOKEN_SECRET")
%WebmaniaNfe.Client{
config: %WebmaniaNfe.Client.Config{
base_url: "https://webmaniabr.com/api/",
consumer_key: "CONSUMER_KEY",
consumer_secret: "CONSUMER_SECRET",
access_token: "ACCESS_TOKEN",
access_token_secret: "ACCESS_TOKEN_SECRET"
},
headers: [
{"Content-Type", "application/json"},
{"X-Consumer-Key", "CONSUMER_KEY"},
{"X-Consumer-Secret", "CONSUMER_SECRET"},
{"X-Access-Token", "ACCESS_TOKEN"},
{"X-Access-Token-Secret", "ACCESS_TOKEN_SECRET"}
],
request: nil,
response: nil
}