Skip to content

Commit

Permalink
Merge pull request #91 from MuriukiPM/MuriukiPM-default-tesla-adapter
Browse files Browse the repository at this point in the history
default tesla adapter
  • Loading branch information
manuelgeek authored Sep 14, 2021
2 parents d52bcf7 + 6951daf commit c3d9f33
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,18 @@ Available in Hex, the package can be installed by adding `at_ex` to your list of
```elixir
def deps do
[
{:at_ex, "~> 0.20.22"}
{:at_ex, "~> 0.20.22"},

# Optional, but recommended for prod
{:hackney, "~> 1.17", only: :prod}
]
end
```

## Configuration

- Create a `dev.exs` file under the `config` folder in the root of the project if you do not have it. like `touch config/dev.exs` to setup configs for development environment i.e, sandbox credentials check sample configuration below.
- Create a `prod.exs` file under the `config` folder in the root of the project if you dont have it. like `touch config/prod.exs` to setup `at_ex` configs for production environment i.e, live credentials check sample configuration below.
- Create a `prod.exs` file under the `config` folder in the root of the project if you dont have it. like `touch config/prod.exs` to setup `at_ex` configs for production environment i.e, live credentials. It is recommended that you also add `tesla` configuration, at least for your live environment. check sample configuration below.
- Copy the contents of `dev.sample.exs` into the `dev.exs` created above.
- Go to [Africas Talking](https://account.africastalking.com/auth/register) to register for an account.
- On signing up go to the `https://account.africastalking.com/apps/sandbox` to get an **api key**
Expand Down Expand Up @@ -83,6 +86,7 @@ config :at_ex,
bank_transfer_product_name: "AtEx",
card_checkout_product_name: "AtEx"

config :tesla, adapter: Tesla.Adapter.Hackney
```


Expand Down
4 changes: 4 additions & 0 deletions config/dev.sample.exs
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ config :at_ex,
bank_checkout_product_name: "AtEx",
bank_transfer_product_name: "AtEx",
card_checkout_product_name: "AtEx"

# Configure tesla to use the Hackney Adapter for
# your application and the at_ex module
config :tesla, adapter: Tesla.Adapter.Hackney
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ defmodule AtEx.MixProject do
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:tesla, "~> 1.2.1"},
{:tesla, "~> 1.4.3"},
{:jason, "~> 1.1"},
{:ex_doc, "~> 0.19", only: :dev, runtime: false}
]
Expand Down
6 changes: 3 additions & 3 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
%{
"earmark": {:hex, :earmark, "1.4.3", "364ca2e9710f6bff494117dbbd53880d84bebb692dafc3a78eb50aa3183f2bfd", [:mix], [], "hexpm", "8cf8a291ebf1c7b9539e3cddb19e9cef066c2441b1640f13c34c1d3cfc825fec"},
"ex_doc": {:hex, :ex_doc, "0.21.2", "caca5bc28ed7b3bdc0b662f8afe2bee1eedb5c3cf7b322feeeb7c6ebbde089d6", [:mix], [{:earmark, "~> 1.3.3 or ~> 1.4", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm", "f1155337ae17ff7a1255217b4c1ceefcd1860b7ceb1a1874031e7a861b052e39"},
"jason": {:hex, :jason, "1.1.2", "b03dedea67a99223a2eaf9f1264ce37154564de899fd3d8b9a21b1a6fd64afe7", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fdf843bca858203ae1de16da2ee206f53416bbda5dc8c9e78f43243de4bc3afe"},
"jason": {:hex, :jason, "1.2.2", "ba43e3f2709fd1aa1dce90aaabfd039d000469c05c56f0b8e31978e03fa39052", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "18a228f5f0058ee183f29f9eae0805c6e59d61c3b006760668d8d18ff0d12179"},
"makeup": {:hex, :makeup, "1.0.0", "671df94cf5a594b739ce03b0d0316aa64312cee2574b6a44becb83cd90fb05dc", [:mix], [{:nimble_parsec, "~> 0.5.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "a10c6eb62cca416019663129699769f0c2ccf39428b3bb3c0cb38c718a0c186d"},
"makeup_elixir": {:hex, :makeup_elixir, "0.14.0", "cf8b7c66ad1cff4c14679698d532f0b5d45a3968ffbcbfd590339cb57742f1ae", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "d4b316c7222a85bbaa2fd7c6e90e37e953257ad196dc229505137c5e505e9eff"},
"mime": {:hex, :mime, "1.3.1", "30ce04ab3175b6ad0bdce0035cba77bba68b813d523d1aac73d9781b4d193cf8", [:mix], [], "hexpm", "6cbe761d6a0ca5a31a0931bf4c63204bceb64538e664a8ecf784a9a6f3b875f1"},
"mime": {:hex, :mime, "1.6.0", "dabde576a497cef4bbdd60aceee8160e02a6c89250d6c0b29e56c0dfb00db3d2", [:mix], [], "hexpm", "31a1a8613f8321143dde1dafc36006a17d28d02bdfecb9e95a880fa7aabd19a7"},
"nimble_parsec": {:hex, :nimble_parsec, "0.5.2", "1d71150d5293d703a9c38d4329da57d3935faed2031d64bc19e77b654ef2d177", [:mix], [], "hexpm", "51aa192e0941313c394956718bdb1e59325874f88f45871cff90345b97f60bba"},
"tesla": {:hex, :tesla, "1.2.1", "864783cc27f71dd8c8969163704752476cec0f3a51eb3b06393b3971dc9733ff", [:mix], [{:exjsx, ">= 3.0.0", [hex: :exjsx, repo: "hexpm", optional: true]}, {:fuse, "~> 2.4", [hex: :fuse, repo: "hexpm", optional: true]}, {:hackney, "~> 1.6", [hex: :hackney, repo: "hexpm", optional: true]}, {:ibrowse, "~> 4.4.0", [hex: :ibrowse, repo: "hexpm", optional: true]}, {:jason, ">= 1.0.0", [hex: :jason, repo: "hexpm", optional: true]}, {:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:poison, ">= 1.0.0", [hex: :poison, repo: "hexpm", optional: true]}], "hexpm", "cfc7277b7a88955ed1f3b9a818d160ea055fd94f7d668e5a83eea18d52eef9ca"},
"tesla": {:hex, :tesla, "1.4.3", "f5a494e08fb1abe4fd9c28abb17f3d9b62b8f6fc492860baa91efb1aab61c8a0", [:mix], [{:castore, "~> 0.1", [hex: :castore, repo: "hexpm", optional: true]}, {:exjsx, ">= 3.0.0", [hex: :exjsx, repo: "hexpm", optional: true]}, {:finch, "~> 0.3", [hex: :finch, repo: "hexpm", optional: true]}, {:fuse, "~> 2.4", [hex: :fuse, repo: "hexpm", optional: true]}, {:gun, "~> 1.3", [hex: :gun, repo: "hexpm", optional: true]}, {:hackney, "~> 1.6", [hex: :hackney, repo: "hexpm", optional: true]}, {:ibrowse, "4.4.0", [hex: :ibrowse, repo: "hexpm", optional: true]}, {:jason, ">= 1.0.0", [hex: :jason, repo: "hexpm", optional: true]}, {:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:mint, "~> 1.0", [hex: :mint, repo: "hexpm", optional: true]}, {:poison, ">= 1.0.0", [hex: :poison, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm", "e0755bb664bf4d664af72931f320c97adbf89da4586670f4864bf259b5750386"},
}

0 comments on commit c3d9f33

Please sign in to comment.