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

[Mercadopago] Implemented void #156

Closed
wants to merge 59 commits into from
Closed

[Mercadopago] Implemented void #156

wants to merge 59 commits into from

Conversation

subpal
Copy link
Contributor

@subpal subpal commented Apr 18, 2018

  1. Implemented void
  2. Added test cases for void
  3. Added docs

pkrawat1 and others added 30 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
* Fixes #1: Introducing `Response.t`

with docs

* [monei] Adapted for new `Response.t`

* Refactored `commit`, `respond` for readability

* [monei] Updated test cases

* Corrected specs

* [bogus] Adapted for Response.t
* Gringotts does not start any process now
* Removed `adapter` key from config as it was redundant.
* Updated docs and mix task.
- Updated dependency `xml_builder`. The new `generate/2` provides a
`format: :none | :indented` option.
- `:format` is set to `:none` to produce "minified" network requests.

* This is almost a complete rewrite to reduce code duplication.
  - check_response_type() was acting as guard that matched only against
some response types. It did not handle the scenario when a non-supported
response would be obtained. It really served no purpose
  - check_response_type -> extract_gateway_response
    + This guards as well as fetches, previously the fetch was being
done multiple times.
* Moved all response handling inside the `ResponseHandler`.
* Since we now have a struct, and want to deprecate `:success`, `Response.success/1` and `Response.error/1`, helpers now act on structs.
* `errorCode` and `errorText` are used to build `:reason`.

+ Removed pointless asserts from tests.
Also added CAVV result filed to the response which is nil for
MaasterCards (as per ANet docs).
oyeb and others added 25 commits March 21, 2018 16:04
* Trexle does not seem to provide fraud risk, AVS, CVV validation
results. There are no docs for this.
* Refactored ResponseHandler, updated Response.t
* CAMS now parses AVS and CVV response - that was missing till now.
* Removes unnecessary `parse` clause.
* Mock tests shouldn't use gringotts.ex
* Update travis config, add .formater.exs

* Migrate to CodeCov
* Travis will run the formatter check
* Add git-hooks and update contribution guide
* Changed credo lin-length config from 80 to 100
* Ran the formatter on the project
* Fix credo warnings
[global-collect] Layout, docs and code refactor
===============================================

New features
------------
Risk, AVS, CVS fields added in `Response` struct!

Layout, docs
-----------
* `credo` issues resolved.
* Corrected `amount` in examples
* Ran the elixir 1.6 code formatter
  - Used sigils in mocks

Code refactors
--------------
* Removed unnecessary functions
  - Reduced arity of `add_money`
* Refactored Timex usage
* Removed a test on `validate_config` as it is already tested.
Created all the helper functions, body for HTTPoison requests, response methods.
1. Completed the docs
2. Used predefined CreditCard and Money data type
3. Added brand in CreditCard
1. Implemented authorize
2. Completed docs
3. Used CreditCard and Money datatype
1. Used commit for HTTPoison requests.
2. Handled network and arguement errors.
3. Updated docs
1. Used commit for HTTPoison requests.
2. Handled network and arguement errors.
3. Updated docs
1. Used commit for HTTPoison requests.
2. Handled network and arguement errors.
3. Updated docs
1. Used commit for HTTPoison requests.
2. Handled network and arguement errors.
3. Updated docs
1. functions are renamed
2. if else replaced with case
3. docs updated
1. changed if else to case
2. changed function name
3. updated docs
1. Added default value of `installments` in function `authorize_params/6` as 1.
2. Added `headers` and `respond`function call in commit function itself.
3. Used `reason` in `respond` function, in case of network error.
4. Removed block quotes '>'.
5. Added money processing note.
1. Removed unnecessary `opts` from arguements of error `respond` function.
2. Used fifth arguement in `HTTPoison.Request` to send part of url as keyword list.
3. Added @SPEC for `commit` function.
1. Implemented capture
2. Added test cases for capture
1. added purchase
2. added test cases
1. Added void function
2. Added test cases
@oyeb oyeb force-pushed the mercadopago branch 3 times, most recently from bacbafd to b8692ba Compare April 25, 2018 11:48
@mandarvaze mandarvaze closed this Apr 18, 2020
@mandarvaze
Copy link
Collaborator

Superceded by #185

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.

10 participants