Skip to content

Commit

Permalink
Release v1.1.1-rc (aviabird#172)
Browse files Browse the repository at this point in the history
The release candidate does some much-needed spring cleaning! 🌬️
Gringotts is now totally (compile-time) warning free (upto elixir
1.6.5) :yay:

Core
----
Remove our implementation of the `Gringotts.Money` protocol as ex_money
(`v2.6.0`) implements (and tests!) it for us.
Updated various docs and cleaned up some code smell.

Gateways
--------
1. Refactor `Paymill`, makes it much more readable and also completes
   all the pending functionality (`refund/3`)
2. Remove/Deprecate `Wirecard` as it does not meet the standards of
   this library.

Closes aviabird#104
Closes aviabird#106
  • Loading branch information
oyeb authored Jun 7, 2018
1 parent cb4b19a commit b54a9bb
Show file tree
Hide file tree
Showing 39 changed files with 1,219 additions and 1,126 deletions.
6 changes: 1 addition & 5 deletions .credo.exs
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,7 @@

# Deprecated checks (these will be deleted after a grace period)
#
{Credo.Check.Readability.Specs, false},
{Credo.Check.Warning.NameRedeclarationByAssignment, false},
{Credo.Check.Warning.NameRedeclarationByCase, false},
{Credo.Check.Warning.NameRedeclarationByDef, false},
{Credo.Check.Warning.NameRedeclarationByFn, false},
{Credo.Check.Readability.Specs, false}

# Custom checks can be created using `mix credo.gen.check`.
#
Expand Down
4 changes: 2 additions & 2 deletions .scripts/post-commit
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ RED='\033[1;31m'
LGRAY='\033[1;30m'
NC='\033[0m' # No Color

printf "${RED}Running 'mix credo --strict --format=oneline' on project...${NC}\n"
mix credo --strict --format=oneline
printf "${RED}Running 'mix credo --strict' on project...${NC}\n"
mix credo --strict
echo
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ matrix:
- elixir: "1.5.3"
script:
- mix coveralls.json
- elixir: "1.6.2"
- elixir: "1.6.5"

notifications:
email:
recipients:
- [email protected]
- [email protected]
76 changes: 47 additions & 29 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
# [`v1.1.0`][tag-1_1_0] (2018-04-22)
# Changelog

## Added
## [`v1.1.1-rc`][tag-1_1_1-rc] (2018-06-04)

* **api** Introduces a `Money` protocol ([#71][pr#71])
* **core** Introduces Response.t ([#119][pr#91])
* **development** Adds a useful mix task gringotts.new ([#78][pr#78])
* **docs** Adds changelog, contributing guide ([#117][pr#117])
### Core
Remove the protocol implementation for `ex_money` since they implement it for us
[e1cb32](https://github.com/kipcole9/money/commit/e1cb325a28a8318864ff1cbfbbb67574379a82c0).

## Changed
### Gateways
- Refactored `Paymill`. Added missing API functions.
- Remove support of [Wirecard](http://wirecard.com/) as it fails to meet the
standards of this library and it is not at all usable. It is being archived
in [`wirecard`](https://github.com/aviabird/gringotts/tree/wirecard) branch.

## [`v1.1.0`][tag-1_1_0] (2018-04-22)

### Core
* Introduces the `Gringotts.Money` protocol ([#71][pr#71])
- Deprecates use of `floats` for money amounts, see [#62][iss#62] for
motivation.
* Removes payment worker! No application, no worker as per the community's
[suggestion][joses-feedback] ([#118][pr#118]).

### Miscellaneous
* Introduces `Response.t` ([#119][pr#91]).
* Adds a useful mix task `gringotts.new` ([#78][pr#78]) to help with adding more
gateways!
* Adds changelog, contributing guide ([#117][pr#117]).

* **api** Deprecates use of `floats` for money amounts, check issue [#62][iss#62] ([#71][pr#71])
* **core** Removes payment worker, no application, no worker now after josevalim [pointed it][jose-feedback] ([#118][pr#118])

[iss#62]: https://github.com/aviabird/gringotts/issues/62
[pr#71]: https://github.com/aviabird/gringotts/pulls/71
Expand All @@ -19,37 +35,39 @@
[pr#117]: https://github.com/aviabird/gringotts/pulls/117
[pr#78]:https://github.com/aviabird/gringotts/pulls/78
[pr#86]:https://github.com/aviabird/gringotts/pulls/86
[jose-feedback]:https://elixirforum.com/t/gringotts-a-complete-payment-library-for-elixir-and-phoenix-framework/11054/41
[joses-feedback]:https://elixirforum.com/t/gringotts-a-complete-payment-library-for-elixir-and-phoenix-framework/11054/41

# [`v1.0.2`][tag-1_0_2]
## [`v1.0.2`][tag-1_0_2] (2017-12-27)

## Added
### Core
* Reduced arity of public API calls by 1
- No need to pass the name of the `worker` as argument.

* New Gateway: **Trexle**
### Gateways
* Gringotts now supports [Trexle](http://trexle.com/) as well :tada:

## Changed
## [`v1.0.1`][tag-1_0_1] (2017-12-23)

* Reduced arity of public API calls by 1
- No need to pass the name of the `worker` as argument.
### Core

# [`v1.0.1`][tag-1_0_1]
* Improved documentation by making them consistent across gateways.
* Improved test coverage, though tests need some more :heart:

## Added
## [`v1.0.0`][tag-1_0_0] (2017-12-20)

* Improved documentation - made consistent accross gateways
* Improved test coverage
### Initial public API release

# [`v1.0.0`][tag-1_0_0]
### Core
* Single worker architecture, config fetched from `config.exs`.

* Initial public API release.
* Single worker architecture, config fetched from `config.exs`
* Supported Gateways:
- Stripe
- MONEI
- Paymill
- WireCard
- CAMSa
### Gateways
- [Stripe](http://stripe.com/)
- [MONEI](http://monei.net/)
- [Paymill](https://www.paymill.com/en/)
- [WireCard](http://wirecard.com/)
- [CAMS](http://www.centralams.com/)

[tag-1_1_1_rc]: https://github.com/aviabird/gringotts/releases/tag/v1.1.1-rc
[tag-1_1_0]: https://github.com/aviabird/gringotts/compare/1.1.0...1.0.2
[tag-1_0_2]: https://github.com/aviabird/gringotts/compare/1.0.2...1.0.1
[tag-1_0_1]: https://github.com/aviabird/gringotts/compare/1.0.1...1.0.0
Expand Down
74 changes: 49 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</p>

<p align="center">
Gringotts is a payment processing library in Elixir integrating various payment gateways, drawing motivation for Shopify's <a href="https://github.com/activemerchant/active_merchant"><code>activemerchant</code></a> gem. Checkout the <a href="https://gringottspay.herokuapp.com/" target="_">Demo</a> here.
Gringotts is a payment processing library in Elixir integrating various payment gateways, drawing motivation for Shopify's <a href="https://github.com/activemerchant/active_merchant"><code>activemerchant</code></a> gem. Checkout the <a href="https://gringottspay.herokuapp.com/" target="_">demo here</a>.
</p>
<p align="center">
<a href="https://travis-ci.org/aviabird/gringotts"><img src="https://travis-ci.org/aviabird/gringotts.svg?branch=master" alt='Build Status' /></a> <a href='https://coveralls.io/github/aviabird/gringotts?branch=master'><img src='https://coveralls.io/repos/github/aviabird/gringotts/badge.svg?branch=master' alt='Coverage Status' /></a> <a href=""><img src="https://img.shields.io/hexpm/v/gringotts.svg"/></a> <a href="https://inch-ci.org/github/aviabird/gringotts"><img src="http://inch-ci.org/github/aviabird/gringotts.svg?branch=master" alt="Docs coverage"></img></a> <a href="https://gitter.im/aviabird/gringotts"><img src="https://badges.gitter.im/aviabird/gringotts.svg"/></a>
Expand All @@ -25,10 +25,10 @@ Add `gringotts` to the list of dependencies of your application.

def deps do
[
{:gringotts, "~> 1.0"},
{:gringotts, "~> 1.1"},
# ex_money provides an excellent Money library, and integrates
# out-of-the-box with Gringotts
{:ex_money, "~> 1.1.0"}
{:ex_money, ">= 2.6.0"}
]
end
```
Expand All @@ -51,11 +51,12 @@ config :gringotts, Gringotts.Gateways.Monei,
entityId: "your_secret_channel_id"
```

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

```elixir
alias Gringotts.Gateways.Monei
alias Gringotts.{CreditCard}
alias Gringotts.CreditCard

# a fake sample card that will work now because the Gateway is by default
# in "test" mode.
Expand Down Expand Up @@ -83,18 +84,51 @@ end

[hexpm]: https://hex.pm/packages/gringotts
[monei]: http://www.monei.net
[monei-bindings]: https://gist.github.com/oyeb/a2e2ac5986cc90a12a6136f6bf1357e5

## On the `Gringotts.Money` protocol and money representation

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

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`][wiki-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`][protocol] for their type!

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

[protocol]: https://github.com/aviabird/gringotts/blob/dev/lib/gringotts/money.ex
[floating-issues]: https://elixirforum.com/t/comparison-of-decimals-not-logical/770/21
[wiki-half-even]: https://en.wikipedia.org/wiki/Rounding#Round_half_to_even
[ex-money]: https://github.com/kipcole9/money
[2_6_0]: https://github.com/kipcole9/money/releases/tag/v2.6.0

## Supported Gateways

| Gateway | Supported countries |
| ------ | ----- |
| [Authorize.Net][anet] | AD, AT, AU, BE, BG, CA, CH, CY, CZ, DE, DK, ES, FI, FR, GB, GB, GI, GR, HU, IE, IT, LI, LU, MC, MT, NL, NO, PL, PT, RO, SE, SI, SK, SM, TR, US, VA |
| [CAMS][cams] | AU, US |
| [MONEI][monei] | DE, EE, ES, FR, IT, US |
| [PAYMILL][paymill] | AD, AT, BE, BG, CH, CY, CZ, DE, DK, EE, ES, FI, FO, FR, GB, GI, GR, HU, IE, IL, IS, IT, LI, LT, LU, LV, MT, NL, NO, PL, PT, RO, SE, SI, SK, TR, VA |
| [Stripe][stripe] | AT, AU, BE, CA, CH, DE, DK, ES, FI, FR, GB, IE, IN, IT, LU, NL, NO, SE, SG, US |
| [TREXLE][trexle] | AD, AE, AT, AU, BD, BE, BG, BN, CA, CH, CY, CZ, DE, DK, EE, EG, ES, FI, FR, GB, GI, GR, HK, HU, ID, IE, IL, IM, IN, IS, IT, JO, KW, LB, LI, LK, LT, LU, LV, MC, MT, MU, MV, MX, MY, NL, NO, NZ, OM, PH, PL, PT, QA, RO, SA, SE, SG, SI, SK, SM, TR, TT, UM, US, VA, VN, ZA |
| [Wirecard][wirecard] | AD, AT, BE, BG, CH, CY, CZ, DE, DK, EE, ES, FI, FR, GB, GI, GR, HU, IE, IL, IM, IS, IT, LI, LT, LU, LV, MC, MT, NL, NO, PL, PT, RO, SE, SI, SK, SM, TR, VA |
| Gateway | PCI compliance | `purchase` | `authorize` | `capture` | `void` | `refund` | (card) `store` | (card) `unstore` |
|-----------------------|----------------|------------|-------------|-----------|----------|----------|----------------|------------------|
| [Authorize.Net][anet] | mandatory | &#9989; | &#9989; | &#9989; | &#9989; | &#9989; | &#9989; | &#9989; |
| [CAMS][cams] | mandatory | &#9989; | &#9989; | &#9989; | &#9989; | &#9989; | &#10060; | &#10060; |
| [MONEI][monei] | mandatory | &#9989; | &#9989; | &#9989; | &#9989; | &#9989; | &#9989; | &#10060; |
| [PAYMILL][paymill] | optional | &#9989; | &#9989; | &#9989; | &#9989; | &#9989; | &#10060; | &#10060; |
| [Stripe][stripe] | optional | &#9989; | &#9989; | &#9989; | &#9989; | &#9989; | &#9989; | &#9989; |
| [TREXLE][trexle] | mandatory | &#9989; | &#9989; | &#9989; | &#10060; | &#9989; | &#9989; | &#10060; |

[anet]: http://www.authorize.net/
[cams]: https://www.centralams.com/
Expand All @@ -105,7 +139,7 @@ end
[wirecard]: http://www.wirecard.com
[demo]: https://gringottspay.herokuapp.com/

## Road Map
## [Road Map][roadmap]

Apart from supporting more and more gateways, we also keep a somewhat detailed
plan for the future on our [wiki][roadmap].
Expand All @@ -116,16 +150,6 @@ plan for the future on our [wiki][roadmap].

Gringotts has a nice ring to it. Also [this][reason].

#### 2. What is the worker doing in the middle?

We wanted to "supervise" our payments, and power utilities to process recurring
payments, subscriptions with it. But yes, as of now, it is a bottle neck and
unnecessary.

It's slated to be removed in [`v2.0.0`][milestone-2_0_0_alpha] and any supervised / async /
parallel work can be explicitly managed via native elixir constructs.

[milestone-2_0_0_alpha]: https://github.com/aviabird/gringotts/milestone/3
[reason]: http://harrypotter.wikia.com/wiki/Gringotts

## License
Expand Down
Loading

0 comments on commit b54a9bb

Please sign in to comment.