Skip to content

StephaneRob/mangopay_ex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MangopayEx (WIP)

Elixir package for interacting with the version 2 of the Mangopay API.

Installation

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

Configuration

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.

Usage

# 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}}

Implementation

  • 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)
  • User emoney
    • view user emoney MangopayEx.Users.Emoney.view(user_id)
  • Wallets
    • Create MangopayEx.Wallets.create(%{})
    • View MangopayEx.Wallets.view(id)
    • Update MangopayEx.Wallets.update(id, %{})
    • List user wallets MangopayEx.Users.Wallets.list(user_id)
  • Payins
  • Transfers
    • Create MangopayEx.Transfers.create(%{})
    • View MangopayEx.Transfers.view(id)
  • Payouts
    • Create MangopayEx.Payouts.create(%{})
    • View MangopayEx.Payouts.view(id)
  • 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)
  • 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
  • Bank Account
    • View a bank account MangoPayEx.Users.Bankaccounts.view(user_id, id)
    • List user bank accounts MangoPayEx.Users.Bankaccounts.list(user_id)

Releases

No releases published

Packages

No packages published

Languages