Elixir package for interacting with the version 2 of the Mangopay API.
If available in Hex, the package can be installed
by adding mangopay_ex
to your list of dependencies in mix.exs
:
def deps do
[{:mangopay_ex, "~> 0.1.0"}]
end
use Mix.Config
config :mangopay_ex,
api_base: "https://api.sandbox.mangopay.com/v2.01",
client_id: System.get_env("MANGOPAY_CLIENT_ID"),
client_pass: System.get_env("MANGOPAY_CLIENT_PASS")
For security reason, use environment variables rather than hard coding your account credentials.
# Create a wallet
MangopayEx.Wallets.create(%{owners: ["USER_ID"], description: "Main wallet", currency: "EUR"})
{:ok,
%{balance: %{amount: 0, currency: "EUR"}, creation_date: 1503057903,
currency: "EUR", description: "Main wallet", funds_type: "DEFAULT", id: "WALLET_ID",
owners: ["USER_ID"], tag: nil}}
- Users
- Create natural user
MangopayEx.Users.Natural.create(%{})
- Update natural user
MangopayEx.Users.Natural.update(id, %{})
- Create legal user
MangopayEx.Users.Legal.create(%{})
- Update legal user
MangopayEx.Users.Legal.update(id, %{})
- View a user
MangopayEx.Users.view(id)
- List a user
MangopayEx.Users.list(id)
- Create natural user
- User emoney
- view user emoney
MangopayEx.Users.Emoney.view(user_id)
- view user emoney
- Wallets
- Create
MangopayEx.Wallets.create(%{})
- View
MangopayEx.Wallets.view(id)
- Update
MangopayEx.Wallets.update(id, %{})
- List user wallets
MangopayEx.Users.Wallets.list(user_id)
- Create
- Payins
- Transfers
- Create
MangopayEx.Transfers.create(%{})
- View
MangopayEx.Transfers.view(id)
- Create
- Payouts
- Create
MangopayEx.Payouts.create(%{})
- View
MangopayEx.Payouts.view(id)
- Create
- KYC Document
- View
MangopayEx.KycDocuments.view(id)
- list
MangopayEx.KycDocuments.list
- Create a kyc document for a user
MangopayEx.Users.KycDocuments.create(user_id, %{})
- Create a kyc page for a user
MangopayEx.Users.KycDocuments.create(:page, user_id, document_id, %{})
- Submit a kyc
MangopayEx.Users.KycDocuments.list(user_id, document_id, %{})
- List kyc for a user
MangopayEx.Users.KycDocuments.list(user_id)
- View
- Hooks
- Transactions
- List user's Transactions
MangopayEx.Users.Transactions.list(user_id)
- List wallets's Transactions
MangopayEx.Wallets.Transactions.list(user_id)
- List dispute's Transactions
- List Client's Transactions
- List Client wallet's Transactions
- List user's Transactions
- Bank Account
- View a bank account
MangoPayEx.Users.Bankaccounts.view(user_id, id)
- List user bank accounts
MangoPayEx.Users.Bankaccounts.list(user_id)
- View a bank account