-
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
[PinPayments] Implemented test cases for authorize #139
base: pinpay
Are you sure you want to change the base?
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please write some meaningful tests to validate presence and correctness of required fields in opts
.
Please rebase your branch!
|
||
alias Gringotts.Gateways.PinPayments, as: Gateway | ||
|
||
#@moduletag :integration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please uncomment this line.
@@ -0,0 +1,84 @@ | |||
defmodule Gringotts.Integration.Gateways.PinpaymentsTest do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo in module name.
description: "hello", | ||
email: "[email protected]", | ||
ip_address: "1.1.1.1", | ||
config: %{apiKey: "c4nxgznanW4XZUaEQhxS6g", pass: ""} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't concat lists like this.
assert response.status_code == 400 | ||
end | ||
|
||
test "[authorize] with bad CreditCard 2" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this pointless test case, and @badcard2
first_name: "Harry", | ||
last_name: "Potter", | ||
number: "4200000000000000", | ||
year: 2019, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will become a bad card in a year. Please use a larger expiry year.
email: "[email protected]", | ||
ip_address: "1.1.1.1", | ||
config: %{apiKey: "c4nxgznanW4XZUaEQhxS6g"} | ||
] ++ [address: @add] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Implemented test cases for good_card, bad_card and with card_token