[PinPayments] Implemented test cases for authorize#139
Open
ravirocx wants to merge 12 commits into
Open
Conversation
`authorize/3` takes 3 parameters `amount`, `card` and `opts` addded documentations for `authorize/3` for merchants.
`def authorize(amount, card, opts) when is_binary(card) do`
…functions fucntions.
oyeb
requested changes
Apr 9, 2018
|
|
||
| alias Gringotts.Gateways.PinPayments, as: Gateway | ||
|
|
||
| #@moduletag :integration |
| @@ -0,0 +1,84 @@ | |||
| defmodule Gringotts.Integration.Gateways.PinpaymentsTest do | |||
| description: "hello", | ||
| email: "hi@hello.com", | ||
| ip_address: "1.1.1.1", | ||
| config: %{apiKey: "c4nxgznanW4XZUaEQhxS6g", pass: ""} |
Contributor
There was a problem hiding this comment.
Why is :pass in config, to best of my memory we removed it from the required_config.
| ip_address: "1.1.1.1", | ||
| config: %{apiKey: "c4nxgznanW4XZUaEQhxS6g", pass: ""} | ||
|
|
||
| ] ++ [address: @add] |
| assert response.status_code == 400 | ||
| end | ||
|
|
||
| test "[authorize] with bad CreditCard 2" do |
Contributor
There was a problem hiding this comment.
Remove this pointless test case, and @badcard2
| first_name: "Harry", | ||
| last_name: "Potter", | ||
| number: "4200000000000000", | ||
| year: 2019, |
Contributor
There was a problem hiding this comment.
This will become a bad card in a year. Please use a larger expiry year.
oyeb
requested changes
Apr 18, 2018
| email: "hi@hello.com", | ||
| ip_address: "1.1.1.1", | ||
| config: %{apiKey: "c4nxgznanW4XZUaEQhxS6g"} | ||
| ] ++ [address: @add] |
Contributor
There was a problem hiding this comment.
I've already pointed out in an earlier comment that you should not concat lists like this. The second list has only one element, moreover, the first list is being defined right there. You can simply move address: @add inside.
This file contains hidden or 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
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.
Implemented test cases for good_card, bad_card and with card_token