Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds the Money protocol and a mix task #110

Merged
merged 23 commits into from
Jan 25, 2018
Merged

Adds the Money protocol and a mix task #110

merged 23 commits into from
Jan 25, 2018

Conversation

pkrawat1
Copy link
Member

@pkrawat1 pkrawat1 commented Jan 25, 2018

pkrawat1 and others added 23 commits December 30, 2017 01:37
* Also re-ordered the deps list, groups runtime deps on top.
[CodeTriage](https://www.codetriage.com/) is an app I have maintained
for the past 4-5 years with the goal of getting people involved in
Open Source projects like this one. The app sends subscribers a random
open issue for them to help "triage". For some languages you can also
suggested areas to add documentation.

The initial approach was inspired by seeing the work of the small
core team spending countless hours asking "what version was
this in" and "can you give us an example app". The idea is to
outsource these small interactions to a huge team of volunteers
and let the core team focus on their work.

I want to add a badge to the README of this project. The idea is to
provide an easy link for people to get started contributing to this
project. A badge indicates the number of people currently subscribed
to help the repo. The color is based off of open issues in the project.

Here are some examples of other projects that have a badge in their
README:

- https://github.com/crystal-lang/crystal
- https://github.com/rails/rails
- https://github.com/codetriage/codetriage

Thanks for building open source software, I would love to help you find some helpers.
* separate payment into credit card and address struct
* set default currency if currency not passed in options
* add guard clause when source params is token or customer
* Change stripe docs according to new credit card and address struct
* Updated Readme
* Fixed specs
* Address and Credit Card struct usage
Added tests for authorize net library for the functions
authorize, capture, refund, void, store and unstore.
Added mock responses for the authorize net library for
functions authorize, capture, refund, void, store and
unstore. Added ResponseHandler module to parse gateway
responses. Added specs.
Building on the discussion in #62, this PR introduces a protocol to replace amount argument, and removes the need to specify currency in config or opts.

Supporting `ex_money` and `monetized` money libs out of the box.

Usage:-
Money can now be passed like this while calling the public API methods.

money = %{amount: Decimal.new(2017.18), currency: "USD"}

Conversation for this happened here on elixir forum and https://elixirforum.com/t/gringotts-a-complete-payment-library-for-elixir-and-phoenix-framework/11054
* Generates a barebones implementation
* Also generates docs dynamically,
  - If no required_keys are supplied when the task is run, the docs do
not contain an empty table.
  - Otherwise, the table and config examples include the keys.
* Adds `to_string` and `to_integer` to the protocol
* Fixes #62 and #85
* Implements all protocol methods for `ex_money`
* Adds integration test with ex_money
* Adapted Monei with protocol updates
* Adds test for `Any`
* The default rounding strategy for implementations of Gringotts.Money
protocol is HALF-EVEN.
* Updated public API docs with "perils of rounding".
Added mix task to generate test file for the gateways, add
a file to define the mock responses and also to generate
integration test.
* Validates currency, test for unsupported currency

* Added EUR to the supported currencies.

* Refactored expansion and validation of extras

* Removed duplicate code that extracted auth_info from opts

* Part of the params to Monei are built in the methods, all extra params
are built and validated in commit.

* [extra-params] All optional params covered: billing, shipping and merchant, invoice_id, category, transaction_id, custom, register, customer

* Added examples of these in docs and integration tests

* The inclusion was (partially) implicitly tested in the integration tests, but I moved it to more visible mock tests.
Used Gringotts.Money for Authorize Net currency support.
* Corrected use of money protocol and examples

Fixes #90 and Fixes #91
Adds a new Response field: authorization.
It is set to ["transactionResponse"]["transId"]

* Uses Gringotts.Money.to_string instead of converting to lossy Float
* doc examples updated (authorize, capture, purchase)
* reworded confusing store doc

* Improved docs, stripped whitespace

* Ran the elixir 1.6 formatter

* Used the ~s sigil in mocks
* Also removed an invisible unicode codepoint from mock strings
* Integrated Money protocol with trexle

* token and message added to Response

* Used `~s` sigils in mocks
* Added money protocol for CAMS gateway.

* Modified methods according to money protocol.

* Modified test data as per money protocol.

* Corrected protocol usage, docs and some bugs

* Updated docs
* Corrected capture args order
* Mock tests now use the worker
* Corrected capture args order
* Fixed arg order in capture

* fixes some patterns in function clauses

* Prompts for filename

* Added a missing comma in integration template
@pkrawat1 pkrawat1 changed the title Dev Dev to master merge 25th Jan Jan 25, 2018
@oyeb oyeb changed the title Dev to master merge 25th Jan Adds the Money protocol and a mix task Jan 25, 2018
@pkrawat1 pkrawat1 merged commit 10ba1d0 into master Jan 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants