{"id":13509546,"url":"https://github.com/aviabird/gringotts","last_synced_at":"2025-05-16T01:05:59.040Z","repository":{"id":41247849,"uuid":"114730000","full_name":"aviabird/gringotts","owner":"aviabird","description":"A complete payment library for Elixir and Phoenix Framework","archived":false,"fork":false,"pushed_at":"2025-04-18T17:24:02.000Z","size":985,"stargazers_count":488,"open_issues_count":38,"forks_count":53,"subscribers_count":36,"default_branch":"dev","last_synced_at":"2025-04-19T06:07:18.056Z","etag":null,"topics":["billing","elixir","elixir-phoenix","gateway","gringotts","payment","payment-gateway","payments","stripe"],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/gringotts/Gringotts.html","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aviabird.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-19T06:52:13.000Z","updated_at":"2025-04-18T17:20:14.000Z","dependencies_parsed_at":"2024-05-01T18:38:01.734Z","dependency_job_id":null,"html_url":"https://github.com/aviabird/gringotts","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aviabird%2Fgringotts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aviabird%2Fgringotts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aviabird%2Fgringotts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aviabird%2Fgringotts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aviabird","download_url":"https://codeload.github.com/aviabird/gringotts/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254448579,"owners_count":22072764,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["billing","elixir","elixir-phoenix","gateway","gringotts","payment","payment-gateway","payments","stripe"],"created_at":"2024-08-01T02:01:09.374Z","updated_at":"2025-05-16T01:05:54.029Z","avatar_url":"https://github.com/aviabird.png","language":"Elixir","funding_links":[],"categories":["Third Party APIs","Elixir","Payments \u0026 Integrations","\u003ca name=\"Elixir\"\u003e\u003c/a\u003eElixir"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"\" target='_blank'\u003e\n    \u003cimg alt=\"Gringotts Logo\" title=\"Gringotts Logo\" src=\"https://res.cloudinary.com/ashish173/image/upload/v1513770454/gringotts_logo.png\" width=\"200\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  Gringotts is a payment processing library in Elixir integrating various payment gateways, drawing motivation from Shopify's \u003ca href=\"https://github.com/activemerchant/active_merchant\"\u003e\u003ccode\u003eactivemerchant\u003c/code\u003e\u003c/a\u003e gem and \u003ca href=\"https://github.com/joshnuss/commerce_billing\"\u003e\u003ccode\u003ecommerce_billing\u003c/code\u003e\u003c/a\u003e. Checkout the \u003ca href=\"https://gringottspay.herokuapp.com/\" target=\"_\"\u003edemo here\u003c/a\u003e.\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n \u003ca href=\"https://travis-ci.org/aviabird/gringotts\"\u003e\u003cimg src=\"https://travis-ci.org/aviabird/gringotts.svg?branch=master\"  alt='Build Status' /\u003e\u003c/a\u003e  \u003ca href='https://coveralls.io/github/aviabird/gringotts?branch=master'\u003e\u003cimg src='https://coveralls.io/repos/github/aviabird/gringotts/badge.svg?branch=master' alt='Coverage Status' /\u003e\u003c/a\u003e \u003ca href=\"https://hex.pm/packages/gringotts\"\u003e\u003cimg src=\"https://img.shields.io/hexpm/v/gringotts.svg\"/\u003e\u003c/a\u003e \u003ca href=\"https://inch-ci.org/github/aviabird/gringotts\"\u003e\u003cimg src=\"http://inch-ci.org/github/aviabird/gringotts.svg?branch=master\" alt=\"Docs coverage\"\u003e\u003c/img\u003e\u003c/a\u003e \u003ca href=\"https://gitter.im/aviabird/gringotts\"\u003e\u003cimg src=\"https://badges.gitter.im/aviabird/gringotts.svg\"/\u003e\u003c/a\u003e\n \u003ca href=\"https://www.codetriage.com/aviabird/gringotts\"\u003e\u003cimg src=\"https://www.codetriage.com/aviabird/gringotts/badges/users.svg\" alt='Help Contribute to Open Source' /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nGringotts offers a **simple and unified API** to access dozens of different payment\ngateways with very different APIs, response schemas, documentation and jargon.\n\nThe project started out **as a fork of [`commerce_billing`][commerce-billing]** and\nthe notable differences are:\n1. No `GenServer` process to act as a \"payment worker\".\n2. Consistent docs and good amount of tests.\n3. Support many more payment gateways.\n\n[commerce-billing]: https://github.com/joshnuss/commerce_billing\n\n## Installation\n\n### From [`hex.pm`][hexpm]\n\nAdd `gringotts` to the list of dependencies of your application.\n```elixir\n# your mix.exs\n\ndef deps do\n  [\n    {:gringotts, \"~\u003e 1.1\"},\n    # ex_money provides an excellent Money library, and integrates\n    # out-of-the-box with Gringotts\n    {:ex_money, \"\u003e= 2.6.0\"}\n  ]\nend\n```\n\n## Usage\n\nThis simple example demonstrates how a `purchase` can be made using a sample\ncredit card using the [MONEI][monei] gateway.\n\nOne must \"register\" their account with `gringotts` ie, put all the\nauthentication details in the Application config. Usually via\n`config/config.exs`\n\n```elixir\n# config/config.exs\n\nconfig :gringotts, Gringotts.Gateways.Monei,\n    userId: \"your_secret_user_id\",\n    password: \"your_secret_password\",\n    entityId: \"your_secret_channel_id\"\n```\n\nCopy and paste this code in a module or an `IEx` session, or use this handy\n[`.iex.exs`][monei-bindings] for all the bindings.\n\n```elixir\nalias Gringotts.Gateways.Monei\nalias Gringotts.CreditCard\n\n# a fake sample card that will work now because the Gateway is by default\n# in \"test\" mode.\n\ncard = %CreditCard{\n  first_name: \"Harry\",\n  last_name: \"Potter\",\n  number: \"4200000000000000\",\n  year: 2099, month: 12,\n  verification_code:  \"123\",\n  brand: \"VISA\"\n}\n\n# a sum of $42\namount = Money.new(42, :USD)\n\ncase Gringotts.purchase(Monei, amount, card) do\n  {:ok,    %{id: id}} -\u003e\n    IO.puts(\"Payment authorized, reference token: '#{id}'\")\n\n  {:error, %{status_code: error, raw: raw_response}} -\u003e\n    IO.puts(\"Error: #{error}\\nRaw:\\n#{raw_response}\")\nend\n```\n\n[hexpm]: https://hex.pm/packages/gringotts\n[monei]: http://www.monei.net\n[monei-bindings]: https://gist.github.com/oyeb/a2e2ac5986cc90a12a6136f6bf1357e5\n\n## On the `Gringotts.Money` protocol and money representation\n\nAll financial applications must take proper care when representing money in\ntheir system. Using simple `float`ing values might lead to losses in the real\nworld due to [various reasons][floating-issues].\n\nMost payment gateways are strict about the formatting of the `amount` in the\nrequest, hence we cannot render arbitrary floating amounts like\n`$4.99999`. Moreover, such amounts might mean something to your application but\nthey don't have any value in the real world (since you can't charge someone for\na fraction of a US cent).\n\nYour application **must round** such amounts before invoking Gringotts **and manage\nany remainders sensibly** yourself.\n\n\u003e Gringotts may perform rounding using the [`half-even`][wiki-half-even]\nstrategy, but it will discard remainders if any.\n\n### Supported \"Money\" libraries\n\nGringotts does not ship with any library to work with monies. You are free to\nchoose any monie library you wish, as long as they implement the\n[`Gringotts.Money`][protocol] for their type!\n\nThat said, we recommend [`ex_money`][ex_money] (above [`v2.6.0`][2_6_0]) to\nrepresent monies. You just have to add it in your `deps()`.\n\n[protocol]: https://github.com/aviabird/gringotts/blob/dev/lib/gringotts/money.ex\n[floating-issues]: https://elixirforum.com/t/comparison-of-decimals-not-logical/770/21\n[wiki-half-even]: https://en.wikipedia.org/wiki/Rounding#Round_half_to_even\n[ex-money]: https://github.com/kipcole9/money\n[2_6_0]: https://github.com/kipcole9/money/releases/tag/v2.6.0\n\n## Supported Gateways\n\n| Gateway               | PCI compliance | `purchase` | `authorize` | `capture` | `void`   | `refund` | (card) `store` | (card) `unstore` |\n|-----------------------|----------------|------------|-------------|-----------|----------|----------|----------------|------------------|\n| [Authorize.Net][anet] | mandatory      | \u0026#9989;    | \u0026#9989;     | \u0026#9989;   | \u0026#9989;  | \u0026#9989;  | \u0026#9989;        | \u0026#9989;          |\n| [CAMS][cams]          | mandatory      | \u0026#9989;    | \u0026#9989;     | \u0026#9989;   | \u0026#9989;  | \u0026#9989;  | \u0026#10060;       | \u0026#10060;         |\n| [MONEI][monei]        | mandatory      | \u0026#9989;    | \u0026#9989;     | \u0026#9989;   | \u0026#9989;  | \u0026#9989;  | \u0026#9989;        | \u0026#10060;         |\n| [PAYMILL][paymill]    | optional       | \u0026#9989;    | \u0026#9989;     | \u0026#9989;   | \u0026#9989;  | \u0026#9989;  | \u0026#10060;       | \u0026#10060;         |\n| [Stripe][stripe]      | optional       | \u0026#9989;    | \u0026#9989;     | \u0026#9989;   | \u0026#9989;  | \u0026#9989;  | \u0026#9989;        | \u0026#9989;          |\n| [TREXLE][trexle]      | mandatory      | \u0026#9989;    | \u0026#9989;     | \u0026#9989;   | \u0026#10060; | \u0026#9989;  | \u0026#9989;        | \u0026#10060;         |\n\n[anet]: http://www.authorize.net/\n[cams]: https://www.centralams.com/\n[monei]: http://www.monei.net/\n[paymill]: https://www.paymill.com\n[stripe]: https://www.stripe.com/\n[trexle]: https://www.trexle.com/\n[wirecard]: http://www.wirecard.com\n[demo]: https://gringottspay.herokuapp.com/\n\n## [Road Map][roadmap]\n\nApart from supporting more and more gateways, we also keep a somewhat detailed\nplan for the future on our [wiki][roadmap].\n\n## FAQ\n\n#### 1. What's with the name? \"Gringotts\"?\n\nGringotts has a nice ring to it. Also [this][reason].\n\n[reason]: http://harrypotter.wikia.com/wiki/Gringotts\n\n## License\n\nMIT\n\n[roadmap]: https://github.com/aviabird/gringotts/wiki/Roadmap\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faviabird%2Fgringotts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faviabird%2Fgringotts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faviabird%2Fgringotts/lists"}