-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adyen: Fix
error_code_from
for unknown errors
Updated `error_code_from` to respond with default gateway error code in case error is not listed in `STANDARD_ERROR_CODE_MAPPING`. CE-2512 Remote: 123 tests, 440 assertions, 2 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 98.374% passed Unit: 5146 tests, 75480 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 100% passed Rubocop: 739 files inspected, no offenses detected
- Loading branch information
1 parent
b90037b
commit f7b0d5f
Showing
4 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -638,6 +638,24 @@ def test_successful_authorize_and_capture_with_unionpay_card | |
assert_equal '[capture-received]', capture.message | ||
end | ||
|
||
def test_error_code_render_from_response | ||
options = { | ||
order_id: '123', | ||
email: '[email protected]', | ||
billing_address: { | ||
address2: 'address2', | ||
zip: '31331', | ||
city: 'Wanaque', | ||
state: 'NJ', | ||
country: 'IE' | ||
}, | ||
delivery_date: 'invalid' | ||
} | ||
response = @gateway.authorize(@amount, @credit_card, options) | ||
assert_failure response | ||
assert_equal '702', response.error_code | ||
end | ||
|
||
def test_partial_capture | ||
auth = @gateway.authorize(@amount, @credit_card, @options) | ||
assert_success auth | ||
|
This file contains 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