Skip to content

[PinPayments] Implemented test cases for authorize#139

Open
ravirocx wants to merge 12 commits into
pinpayfrom
pinpay-auth-test
Open

[PinPayments] Implemented test cases for authorize#139
ravirocx wants to merge 12 commits into
pinpayfrom
pinpay-auth-test

Conversation

@ravirocx

Copy link
Copy Markdown

Implemented test cases for good_card, bad_card and with card_token

@ravirocx ravirocx changed the title Implemented test cases for authorize [PinPayments] Implemented test cases for authorize Mar 28, 2018
@oyeb oyeb self-requested a review April 9, 2018 08:10

@oyeb oyeb left a comment

Copy link
Copy Markdown
Contributor

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

@oyeb oyeb Apr 9, 2018

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

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: "hi@hello.com",
ip_address: "1.1.1.1",
config: %{apiKey: "c4nxgznanW4XZUaEQhxS6g", pass: ""}

Copy link
Copy Markdown
Contributor

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]

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

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,

Copy link
Copy Markdown
Contributor

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: "hi@hello.com",
ip_address: "1.1.1.1",
config: %{apiKey: "c4nxgznanW4XZUaEQhxS6g"}
] ++ [address: @add]

Copy link
Copy Markdown
Contributor

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.

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.

2 participants