-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Adyen: Add Cabal card #3361
Conversation
|
||
initial_response = commit('authorise', post, options) | ||
|
||
if initial_response.success? && card_not_stored?(initial_response) |
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.
👍Nice refactor. This is a lot easier to read/understand.
@@ -33,6 +33,24 @@ def setup | |||
:brand => 'elo' | |||
) | |||
|
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.
Just a heads up in case you didn't notice -- there appear to be conflicts in this file now.
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.
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 |
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.
👍
Added a couple of minor recommendations, but looks good! |
end | ||
|
||
def card_not_stored?(response) | ||
response.authorization ? response.authorization.split('#')[2].nil? : true |
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.
👍
@@ -459,6 +466,23 @@ def add_browser_info(browser_info, post) | |||
userAgent: browser_info[:user_agent] | |||
} | |||
end | |||
|
|||
def unsupported_failure_response(initial_response) |
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.
👍
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.
Looks great!
c73e733
to
b566590
Compare
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.
b566590
to
f387a0b
Compare
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 anerror message when attempting to store a Cabal card. Since the
store
method for Adyen uses the
authorise
action, even though Cabal cardscannot 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