feat(connector): [FISERV] Added Integrity Check support for all Payment & Refund Flows#8075
Merged
likhinbopanna merged 2 commits intomainfrom Jun 2, 2025
Merged
Conversation
Changed Files
|
Comment on lines
+193
to
+198
|
|
||
| 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(); |
Contributor
There was a problem hiding this comment.
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.
deepanshu-iiitu
previously approved these changes
May 20, 2025
…nt & Refund Flows
670e277 to
eca6ac4
Compare
deepanshu-iiitu
approved these changes
May 30, 2025
sahkal
approved these changes
May 30, 2025
This was referenced Sep 1, 2025
Open
[FEATURE] : [BAMBORA] Add Integrity Check Support for Authorize, PSync, Refund and RSync Flows
#9146
Open
This was referenced Sep 1, 2025
Open
Open
Open
Open
Open
Open
Open
[FEATURE] : [TOKENIO] Add Integrity Check Support for Authorize, PSync, Refund and RSync Flows
#9227
Open
Closed
Open
This was referenced Oct 5, 2025
This was referenced Oct 7, 2025
14 tasks
14 tasks
14 tasks
Atharva-Varpe
added a commit
to Atharva-Varpe/hyperswitch
that referenced
this pull request
Oct 24, 2025
- Add integrity checks for Authorize, PSync, Capture, Refund Execute, and RSync flows - Update response structs with operation_amount and operation_currency fields - Follow patterns from Fiserv (juspay#8075) and Xendit (juspay#8049) PRs
9 tasks
14 tasks
14 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 --allcargo clippy