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

Shift4: update response mapping #5002

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

rachelkirk
Copy link
Contributor

@rachelkirk rachelkirk commented Jan 5, 2024

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 return responseCode: D. I've made some extensive updates to test cases and responses to more accurately reflect the gateway's responses in production transactions.

@rachelkirk rachelkirk requested a review from a team January 5, 2024 00:57
@rachelkirk rachelkirk force-pushed the CER-1094_update_shift4_response_mapping branch 2 times, most recently from eb89580 to ea9389e Compare January 5, 2024 23:40
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
@rachelkirk rachelkirk force-pushed the CER-1094_update_shift4_response_mapping branch from ea9389e to 0c4b05d Compare January 12, 2024 23:39
@rachelkirk rachelkirk requested a review from a team January 12, 2024 23:39
return unless success_from(action, response)

STANDARD_ERROR_CODE_MAPPING[response['primaryCode']]
code = response['result'].first&.dig('transaction', 'responseCode')
Copy link
Contributor

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

Copy link
Contributor

@yunnydang yunnydang left a 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

Copy link
Contributor

@DustinHaefele DustinHaefele left a 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.

@yunnydang
Copy link
Contributor

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."

@rachelkirk rachelkirk merged commit 456b261 into master Jan 18, 2024
0 of 5 checks passed
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