-
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
Shift4: update response mapping #5002
Conversation
eb89580
to
ea9389e
Compare
CER_1094 This change updates a few response method to return more accurate codes and messages instead of the currently existing standard error code mapping
ea9389e
to
0c4b05d
Compare
return unless success_from(action, response) | ||
|
||
STANDARD_ERROR_CODE_MAPPING[response['primaryCode']] | ||
code = response['result'].first&.dig('transaction', 'responseCode') |
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.
good work! Looks adequately guarded
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.
Approving but highly recommended a member from Pathfinder to also grant their blessings
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 looks good to me. I like pulling the error codes from the actual response. The only question I have is there any need to notify customers since some of the error messages are changing to a more generic "Transaction declined"? ... I'm approving since that is more in your team's wheel house to make that decision but I wanted to mention it.
Heya @DustinHaefele just responding on Rachels behalf since shes out today, but here's what she said: "Transaction Declined will actually be more specific unless a hostResponse is not returned." |
CER_1094
This change updates a few response methods to return more accurate codes and messages instead of the currently existing standard error code mapping. The previously implemented standard error code mapping was not great. It was returning messages not direct from the gateway, which was perhaps an old standard but there have been requests to make the messages returned aligned with the gateway's actual response.
Failed sandbox transactions do not return the
hostResponse
, which is from the card networks, but they do returnresponseCode: D
. I've made some extensive updates to test cases and responses to more accurately reflect the gateway's responses in production transactions.