Skip to content

Commit

Permalink
Revert "Release v1.1.1-rc (aviabird#172)" (aviabird#174)
Browse files Browse the repository at this point in the history
This reverts commit b54a9bb.
@oyeb should have done a rebase merge for aviabird#172, he did a squash instead.
:(
  • Loading branch information
oyeb authored Jun 8, 2018
1 parent b54a9bb commit ce5e4c9
Show file tree
Hide file tree
Showing 39 changed files with 1,126 additions and 1,219 deletions.
6 changes: 5 additions & 1 deletion .credo.exs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,11 @@

# Deprecated checks (these will be deleted after a grace period)
#
{Credo.Check.Readability.Specs, false}
{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},

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

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

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

### Core
Remove the protocol implementation for `ex_money` since they implement it for us
[e1cb32](https://github.com/kipcole9/money/commit/e1cb325a28a8318864ff1cbfbbb67574379a82c0).
* **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])

### 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]).
## Changed

* **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 @@ -35,39 +19,37 @@ Remove the protocol implementation for `ex_money` since they implement it for us
[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
[joses-feedback]:https://elixirforum.com/t/gringotts-a-complete-payment-library-for-elixir-and-phoenix-framework/11054/41
[jose-feedback]:https://elixirforum.com/t/gringotts-a-complete-payment-library-for-elixir-and-phoenix-framework/11054/41

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

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

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

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

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

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

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

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

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

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

[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: 25 additions & 49 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 here</a>.
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.
</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.1"},
{:gringotts, "~> 1.0"},
# ex_money provides an excellent Money library, and integrates
# out-of-the-box with Gringotts
{:ex_money, ">= 2.6.0"}
{:ex_money, "~> 1.1.0"}
]
end
```
Expand All @@ -51,12 +51,11 @@ config :gringotts, Gringotts.Gateways.Monei,
entityId: "your_secret_channel_id"
```

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

```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 @@ -84,51 +83,18 @@ 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 | 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; |
| 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 |

[anet]: http://www.authorize.net/
[cams]: https://www.centralams.com/
Expand All @@ -139,7 +105,7 @@ represent monies. You just have to add it in your `deps()`.
[wirecard]: http://www.wirecard.com
[demo]: https://gringottspay.herokuapp.com/

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

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

Please sign in to comment.