-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feat(connector): [FISERV] Added Integrity Check support for all Payment & Refund Flows #8075
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
Conversation
Changed Files
|
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.
Integrity checks LGTM!
|
||
let network_advice_code = first_error.message.clone(); | ||
|
||
let network_decline_code = first_error.code.clone(); | ||
|
||
let network_error_message = first_error.additional_info.clone(); |
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.
These fields are not equivalent to network error codes, If they are not present can you make them None instead of mapping to processor error. And also you can add network error codes in 2xx response.If webhooks are present please add it there as well.
…nt & Refund Flows
670e277
to
eca6ac4
Compare
Type of Change
Description
Populated network_advice_code, network_decline_code and network_error_response in ErrorResponse. Also added integrity check support for Authorize, Capture, Refund, PSync and RSync flows.
What is an integrity check?
A scenario where there is a discrepancy between the amount sent in the request and the amount received from the connector, which is checked during response handling.
https://developer.fiserv.com/product/CommerceHub/api/?type=post&path=/payments/v1/charges&branch=main&version=1.25.0400
Additional Changes
Motivation and Context
How did you test it?
For Integrity Checks
Case 1: Automatic Capture
cURL:
Response:
We hardcoded the amount at the connector level to a value greater than the one sent in the request. This is verified at response time, causing a discrepancy between the amount passed in the request and the amount passed to the connector, which triggers the integrity check.
cURL :
Response:
Reason: We hardcoded the amount in the code to an amount which is more than the one being sent in the connector request.
First, do a payments create( a successful one) and donot hardcode anything.
cURL :
Response of Payments - Create :
Now attempt a Refund with this payment_id. In code I have hardcoded the refund amount same as the captured amount but in the request will be passing an amount which will be less than that.
Refunds - Create cURL:
Response :
Checklist
cargo +nightly fmt --all
cargo clippy