Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage in Production #47

Open
jsayegh opened this issue Mar 18, 2019 · 0 comments
Open

Usage in Production #47

jsayegh opened this issue Mar 18, 2019 · 0 comments

Comments

@jsayegh
Copy link

jsayegh commented Mar 18, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant