All Projects → aviabird → Gringotts

aviabird / Gringotts

Licence: mit
A complete payment library for Elixir and Phoenix Framework

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to Gringotts

drf-stripe-subscription
An out-of-box Django REST framework solution for payment and subscription management using Stripe.
Stars: ✭ 42 (-89.39%)
Mutual labels:  stripe, payment, payments, billing
Commerce billing
A payment processing library for Elixir
Stars: ✭ 170 (-57.07%)
Mutual labels:  stripe, payment, billing, gateway
adyen-dotnet-api-library
Adyen API Library for .NET
Stars: ✭ 69 (-82.58%)
Mutual labels:  payment, payments, payment-gateway
subscribie
Collect recurring payments online - subscription payments collection automation
Stars: ✭ 36 (-90.91%)
Mutual labels:  stripe, payments, billing
python-daraja
Python Wrapper for interacting with the MPESA Daraja API. More Features to be implemented
Stars: ✭ 20 (-94.95%)
Mutual labels:  payment, payments, payment-gateway
paymentgateway
Dokumentace ČSOB platební brány a jejího eAPI pro platby platebními kartami, Apple Pay, mallpay a platebními tlačítky ČSOB.
Stars: ✭ 104 (-73.74%)
Mutual labels:  payment, payments, payment-gateway
Stripe Billing Typographic
⚡️Typographic is a webfont service (and demo) built with Stripe Billing.
Stars: ✭ 186 (-53.03%)
Mutual labels:  stripe, payments, billing
cybersource-android-sdk
The CyberSource InApp SDK enables developers to simply and securely incorporate mobile payments into their Android applications.
Stars: ✭ 25 (-93.69%)
Mutual labels:  payment, payments, payment-gateway
Laravel Paddle
Paddle.com API integration for Laravel with support for webhooks/events
Stars: ✭ 132 (-66.67%)
Mutual labels:  payment, payments, payment-gateway
cashier
Cashier is an Elixir library that aims to be an easy to use payment gateway, whilst offering the fault tolerance and scalability benefits of being built on top of Erlang/OTP
Stars: ✭ 43 (-89.14%)
Mutual labels:  payment, gateway, payment-gateway
adyen-python-api-library
Adyen API Library for Python
Stars: ✭ 41 (-89.65%)
Mutual labels:  payment, payments, payment-gateway
adyen-salesforce-commerce-cloud
Salesforce Commerce Cloud (formerly Demandware)
Stars: ✭ 63 (-84.09%)
Mutual labels:  payment, payments, payment-gateway
Jetstream Cashier Billing Portal
Jetstream Cashier Billing Portal is a simple scaffolding billing portal to manage subscriptions, invoices and payment methods, built on top of Jetstream & Cashier Register.
Stars: ✭ 45 (-88.64%)
Mutual labels:  stripe, payment, billing
Omnipay Pingpp
A Ping++ driver for the Omnipay PHP payment processing library. 一个聚合了支付宝(APP、Wap、PC、即时到账、扫码、企业付款),微信(APP、公众号、红包), 银联网关、银联企业网银、Apple Pay、QQ 钱包、易宝支付、百度钱包、京东支付、京东白条、招行一网通、分期支付等国内主流支付渠道的聚合支付网关(Ping++, also known as Pingpp/Pingxx/Pingplusplus)
Stars: ✭ 227 (-42.68%)
Mutual labels:  stripe, payment, payment-gateway
Dj Stripe
Django + Stripe Made Easy
Stars: ✭ 1,022 (+158.08%)
Mutual labels:  stripe, payments, billing
cybersource-sdk-java
Java SDK for CyberSource Simple Order API
Stars: ✭ 44 (-88.89%)
Mutual labels:  payment, payments, payment-gateway
Adyen Php Api Library
Adyen API Library for PHP
Stars: ✭ 93 (-76.52%)
Mutual labels:  payment, payments, payment-gateway
Sdk Dotnet
.Net SDK for Authorize.Net API
Stars: ✭ 124 (-68.69%)
Mutual labels:  payment, payments, payment-gateway
sep-pay
Pay.ir Payment Package for Laravel 5.3+
Stars: ✭ 17 (-95.71%)
Mutual labels:  payment, payments, payment-gateway
Sdk Php
PHP SDK for Authorize.Net API
Stars: ✭ 343 (-13.38%)
Mutual labels:  payment, payments, payment-gateway

Gringotts Logo

Gringotts is a payment processing library in Elixir integrating various payment gateways, drawing motivation from Shopify's activemerchant gem and commerce_billing. Checkout the demo here.

Build Status Coverage Status Docs coverage Help Contribute to Open Source

Gringotts offers a simple and unified API to access dozens of different payment gateways with very different APIs, response schemas, documentation and jargon.

The project started out as a fork of commerce_billing and the notable differences are:

  1. No GenServer process to act as a "payment worker".
  2. Consistent docs and good amount of tests.
  3. Support many more payment gateways.

Installation

From hex.pm

Add gringotts to the list of dependencies of your application.

# your mix.exs

def deps do
  [
    {:gringotts, "~> 1.1"},
    # ex_money provides an excellent Money library, and integrates
    # out-of-the-box with Gringotts
    {:ex_money, ">= 2.6.0"}
  ]
end

Usage

This simple example demonstrates how a purchase can be made using a sample credit card using the MONEI gateway.

One must "register" their account with gringotts ie, put all the authentication details in the Application config. Usually via config/config.exs

# config/config.exs

config :gringotts, Gringotts.Gateways.Monei,
    userId: "your_secret_user_id",
    password: "your_secret_password",
    entityId: "your_secret_channel_id"

Copy and paste this code in a module or an IEx session, or use this handy .iex.exs for all the bindings.

alias Gringotts.Gateways.Monei
alias Gringotts.CreditCard

# a fake sample card that will work now because the Gateway is by default
# in "test" mode.

card = %CreditCard{
  first_name: "Harry",
  last_name: "Potter",
  number: "4200000000000000",
  year: 2099, month: 12,
  verification_code:  "123",
  brand: "VISA"
}

# a sum of $42
amount = Money.new(42, :USD)

case Gringotts.purchase(Monei, amount, card) do
  {:ok,    %{id: id}} ->
    IO.puts("Payment authorized, reference token: '#{id}'")

  {:error, %{status_code: error, raw: raw_response}} ->
    IO.puts("Error: #{error}\nRaw:\n#{raw_response}")
end

On the Gringotts.Money protocol and money representation

All financial applications must take proper care when representing money in their system. Using simple floating values might lead to losses in the real world due to various reasons.

Most payment gateways are strict about the formatting of the amount in the request, hence we cannot render arbitrary floating amounts like $4.99999. Moreover, such amounts might mean something to your application but they don't have any value in the real world (since you can't charge someone for a fraction of a US cent).

Your application must round such amounts before invoking Gringotts and manage any remainders sensibly yourself.

Gringotts may perform rounding using the half-even strategy, but it will discard remainders if any.

Supported "Money" libraries

Gringotts does not ship with any library to work with monies. You are free to choose any monie library you wish, as long as they implement the Gringotts.Money for their type!

That said, we recommend [ex_money][ex_money] (above v2.6.0) to represent monies. You just have to add it in your deps().

Supported Gateways

Gateway PCI compliance purchase authorize capture void refund (card) store (card) unstore
Authorize.Net mandatory
CAMS mandatory
MONEI mandatory
PAYMILL optional
Stripe optional
TREXLE mandatory

Road Map

Apart from supporting more and more gateways, we also keep a somewhat detailed plan for the future on our wiki.

FAQ

1. What's with the name? "Gringotts"?

Gringotts has a nice ring to it. Also this.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].