/gocardless

Elixir wrapper for the GoCardless API

Primary LanguageElixir

Gocardless

Hex pm

Elixir wrapper for the GoCardless API.

Installation

  1. Add gocardless to your list of dependencies in mix.exs:
def deps do
  [{:gocardless, "~> 0.1.1"}]
end

then...

mix deps.get
  1. Ensure gocardless is started before your application:
def application do
  [applications: [:gocardless]]
end
  1. Add configuration to your app:
config :gocardless,
  api_base: "https://api-sandbox.gocardless.com/",
  api_version: "2015-07-06",
  access_token: "<your-token>"
  1. Example usage:
iex> params = %{
  email: "name@email.com",
  given_name: "Firstname",
  family_name: "Lastname",
  country_code: "GB"
}
iex> Gocardless.Client.create_customer(%{customers: params})
{:ok,
  %{"customers" => %{"address_line1" => nil, "address_line2" => nil,
      "address_line3" => nil, "city" => nil, "company_name" => nil,
      "country_code" => "GB", "created_at" => "2017-06-23T13:04:45.459Z",
      "email" => "name@email.com", "family_name" => "Lastname",
      "given_name" => "Firstname", "id" => "CU0009999999", "language" => "en",
      "metadata" => %{}, "postal_code" => nil, "region" => nil,
      "swedish_identity_number" => nil}}}

For more information, see the Hex docs

You can read the docs here

Implementation state

These are the priorities for us right now. If you want anything else feel free to add a pull request.

  • Customers
    • List
    • Get
    • Create
    • Update
  • Mandates
    • List
    • Get
    • Create
    • Update
    • Cancel
    • Reinstate
  • CustomerBankAccounts
    • List
    • Get
    • Create
    • Update
    • Disable
  • Payments
    • List
    • Get
    • Create
    • Update
    • Cancel
    • Retry