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

Adyen: Add Cabal card #3361

Merged
merged 1 commit into from
Sep 26, 2019
Merged

Adyen: Add Cabal card #3361

merged 1 commit into from
Sep 26, 2019

Conversation

leila-alderman
Copy link
Contributor

Added the Cabal card to the Adyen gateway, including adding unit and
remote tests.

Currently, Adyen does not support recurring transactions for Cabal
cards, so additional logic was added to the store method to return an
error message when attempting to store a Cabal card. Since the store
method for Adyen uses the authorise action, even though Cabal cards
cannot be successfully stored, the response from the gateway is
successful and does not return any sort of error message.

CE-99

Unit:
40 tests, 193 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions,
0 notifications
100% passed

Remote:
68 tests, 214 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions,
0 notifications
100% passed

@leila-alderman leila-alderman requested review from curiousepic and a team September 19, 2019 21:03

initial_response = commit('authorise', post, options)

if initial_response.success? && card_not_stored?(initial_response)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍Nice refactor. This is a lot easier to read/understand.

@@ -33,6 +33,24 @@ def setup
:brand => 'elo'
)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a heads up in case you didn't notice -- there appear to be conflicts in this file now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I'm aware, but I generally hold off on rebasing until I'm all set to go.

def test_failed_store_with_cabal_card
assert response = @gateway.store(@cabal_credit_card, @options)
assert_failure response
assert_equal 'Recurring transactions are not supported for this card type.', response.message
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jasonxp
Copy link
Contributor

jasonxp commented Sep 25, 2019

Added a couple of minor recommendations, but looks good!

end

def card_not_stored?(response)
response.authorization ? response.authorization.split('#')[2].nil? : true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -459,6 +466,23 @@ def add_browser_info(browser_info, post)
userAgent: browser_info[:user_agent]
}
end

def unsupported_failure_response(initial_response)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

@jasonxp jasonxp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! :shipit:

Added the Cabal card to the Adyen gateway, including adding unit and
remote tests.

Currently, Adyen does not support recurring transactions for Cabal
cards, so additional logic was added to the `store` method to return an
error message when attempting to store a Cabal card. Since the `store`
method for Adyen uses the `authorise` action, even though Cabal cards
cannot be successfully stored, the response from the gateway is
successful and does not return any sort of error message. Therefore, the
response from the gateway is altered to accurately reflect when a card
is not successfully stored by Adyen.

CE-99

Unit:
40 tests, 193 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions,
0 notifications
100% passed

Remote:
72 tests, 232 assertions, 3 failures, 0 errors, 0 pendings, 0 omissions,
0 notifications
95.8333% passed

The two failing tests are
 - `test_successful_purchase_with_auth_data_via_threeds1_standalone`
 - `test_successful_purchase_with_auth_data_via_threeds2_standalone`

These two tests were recently added in #3294 and appear to have never
passed for Spreedly.
@leila-alderman leila-alderman merged commit f387a0b into master Sep 26, 2019
@leila-alderman leila-alderman deleted the CE-99_adyen_add_cabal branch September 26, 2019 13:51
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.

3 participants