overture8 / mangoex

Elixir wrapper for the MangoPay API
3 stars 3 forks source link

Creates the emoney endpoint #3

Closed tosbourn closed 7 years ago

tosbourn commented 7 years ago

This PR creates access to the emoney endpoint.

This is how it is used;

Mangoex.Client.auth("CLIENT_ID", "PASSPHRASE")
Mangoex.Client.check_users_emoney("99999999", %{})
{:ok,
  %{"CreditedEMoney" => %{"Amount" => 0, "Currency" => "EUR"},
  "DebitedEMoney" => %{"Amount" => 0, "Currency" => "EUR"},
  "UserId" => "99999999"}}

Or with GBP being used (the default is Euro)

Mangoex.Client.auth("CLIENT_ID", "PASSPHRASE")
Mangoex.Client.check_users_emoney("99999999", %{Currency: "GBP"})
{:ok,
  %{"CreditedEMoney" => %{"Amount" => 0, "Currency" => "GBP"},
  "DebitedEMoney" => %{"Amount" => 0, "Currency" => "GBP"},
  "UserId" => "99999999"}}