Giter VIP home page Giter VIP logo

spreedly-elixir's People

Contributors

directionalpad avatar duff avatar jknipp avatar knewter avatar thalagyrt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

spreedly-elixir's Issues

API credential leakage

Hiya,

You have live Spreedly API credentials committed to config/test.exs. I'm assuming this isn't a live Spreedly account, but it still gives people access to your Spreedly account which is less than ideal. I noticed this while running tests and wondering how anything was actually passing since it all appears to make live HTTP requests. I'd recommend revoking these credentials.

Cheers,
James

Error in Spreedly.Base process_response never matches. (Critical)

So it looks like the spreedly elixir library might be broken. It was working for us until today.

Screen Shot 2020-01-24 at 3 43 42 PM

it looks like the httpoison response in Spreedly.Base never matches parse_response. i threw a debugger and the api_request method in the Base module returns only an HTTPoison Struct. It doesn't return an ok or error tuple which parse_response expects.

i put in a catch all at the bottom

defp process_response(error) do IO.inspect(error) end

which just returns a %HTTPoison.Response{} instead of {_status, %HTTPoison.Response{}}

Using HTTPoison 1.6.2 in according to mix.lock

Add invocation style that requires parameters on each call

Hello, I've recently stumbled upon your library. Unofficial or not, it's under the hat of Spreedly so I'm very interested in using it.

That being said, going through the README I noticed you're storing the credentials in an Environment struct and then you require that struct in order to call operations.

I'm not gonna argue OOP vs. FP here because it's a matter of taste -- but would you be open to add wrappers to your Environment functions, directly in the Spreedly module? Something like this:

defmodule Spreedly do
  ...
  def purchase(key, secret, ...) do
    Spreedly.Environment.new(key, secret).purchase(...)
  end
  ...
end

I'd personally would be much more comfortable using it with more concise calls (only using Spreedly. as a prefix) and being able to do so statelessly (not storing credentials in objects between requests).

If you like the idea, you might not just add wrappers but simply change the core style to this? Up to you.

Additional food for thought might be adding bang functions (purchase!) which do the pattern matching internally and raise an error when the {:error, reason} tuple is returned.

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.