Coder Social home page Coder Social logo

mangopay_ex's Introduction

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.