-
Notifications
You must be signed in to change notification settings - Fork 52
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Gringotts.Money
protocol more info Replace floating point numbers with a Money lib #62Fixes Replace floating point numbers with a Money lib #62, Fixes [money-protocol] Add integer and string methods #85, Fixes [ANet] Converts money to lossy float #90 and Fixes [ANet] Examples and tests don't "work" #91