Elixir
Switch branches/tags
Nothing to show
Latest commit 0a5f543 Nov 8, 2017 @svileng svileng Merge pull request #1 from vic/patch-1
Fix typo
Permalink
Failed to load latest commit information.
lib Initial commit Aug 18, 2017
test Initial commit Aug 18, 2017
.gitignore Initial commit Aug 18, 2017
LICENSE Initial commit Aug 18, 2017
README.md Fix typo Aug 26, 2017
mix.exs Initial commit Aug 18, 2017
mix.lock Initial commit Aug 18, 2017

README.md

Stripy hex.pm hexdocs.pm

Stripy is a micro wrapper intended to be used for sending requests to Stripe's REST API. It is made for developers who prefer to work directly with the official API and provide their own abstractions on top if such are needed.

Stripy takes care of setting headers, encoding the data, configuration settings, etc (the usual boring boilerplate); it also provides a parse/1 helper function for decoding.

Some basic examples:

iex> Stripy.req(:get, "subscriptions")
{:ok, %HTTPoison.Response{...}}

iex> Stripy.req(:post, "customers", %{"email" => "a@b.c", "metadata[user_id]" => 1})
{:ok, %HTTPoison.Response{...}}

Where subscriptions and customers are REST API resources.

If you prefer to work with a higher-level library, check out "stripity_stripe" or "stripe_elixir" on Hex.

Installation

Add to your mix.exs as usual:

def deps do
  [{:stripy, "~> 1.0"}]
end

If you're not using application inference, then add :stripy to your applications list.

Then configure the stripy app per environment like so:

config :stripy,
  secret_key: "sk_test_xxxxxxxxxxxxx", # required
  endpoint: "https://api.stripe.com/v1/", # optional
  version: "2017-06-05" # optional

About

This project is sponsored by Heresy. We're always looking for great engineers to join our team, so if you love Elixir, open source and enjoy some challenge, drop us a line and say hello!

License

  • Stripy: See LICENSE file.
  • "Heresy" name and logo: Copyright © 2017 Heresy Software Ltd