Coder Social home page Coder Social logo

mangopay-elixir's Introduction

CircleCI GitHub license Coverage Status Inline docs Hex.pm

MangoPay

TODO: Add description

Installation

An Elixir library for MangoPay.

The package can be installed by adding mangopay to your list of dependencies in mix.exs:

def deps do
  [
    {:mangopay, "~> 0.1.0"}
  ]
end

Usage

Install the dependency:

{:mangopay, "~> 0.1.0"}

Next, add to your applications:

defp application do
  [applications: [:mangopay]]
end

Configuration

To call mangopay your needs your client id and passphrase.

use Mix.Config

config :mangopay, client_id: "YOUR CLIENT ID"
config :mangoapy, passphrase: "YOUR KEY"

The API

The full documentation of the API is avaiable here

Contributing

Feedback, feature requests are welcome.

License

Please see LICENSE for licensing details.

mangopay-elixir's People

Contributors

homologist avatar socfoot avatar

Stargazers

 avatar  avatar

mangopay-elixir's Issues

Should the library decode the response body?

Hello,

I'm currently trying to use your library in one of my projects, so thanks for your work.

I've seen that the lib is not automatically decoding the response body even if Poison is one of the current dependencies. Should it be done eventually by the library?

Usage in Production

Hello,

Was this library ever meant to be used for production?
Because I'm was using this library in one of my projects, and i noticed that i didn't work in production environment.

So i dug a little bit in the source code, and i found those points :

  1. I see that in this function:

    defp filter_and_send(method, url, body, headers, query, bang) do
    cond do
    bang ->
    case {Mix.env, method} do
    {:dev, _} -> HTTPoison.request!(method, url, body, headers, [params: query, timeout: 4600, recv_timeout: 5000])
    {:test, _} -> HTTPoison.request!(method, url, body, headers, [params: query, timeout: 500000, recv_timeout: 500000])
    end
    true ->
    case {Mix.env, method, query} do
    {:dev, _, _} -> HTTPoison.request(method, url, body, headers, [params: query, timeout: 4600, recv_timeout: 5000])
    {:test, _, _} -> HTTPoison.request(method, url, body, headers, [params: query, timeout: 500000, recv_timeout: 500000])
    end
    end

    you're not taking into consideration the prod env. This will cause an error in prod and in my case i can't create a mango user.

  2. I found in this line that you're always using the sandbox url:

    @doc """
    Returns MANGOPAY_BASE_URL
    """
    def base_url do
    "https://api.sandbox.mangopay.com"
    end

So i was wondering if i missed something? Before i submit any pull requests.

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.