fix(connector): [TRUSTPAY] Consuming Amount in PSync Response #8455
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
Currently, we are not consuming amount in BankRedirectSyncResponse. Hence during a force PSync, the status is getting updated but the amount is not being updated since we arent consuming that and there's no integrity check on the PSync response. It is only there for Webhook Response.
Additional Changes
Motivation and Context
Ref Doc : https://doc.trustpay.eu/aapi?_gl=1*7duol*_gcl_au*MTAzMDIwODQyMS4xNzQ5NTI5Mjg2&_ga=2.31332159.1618624945.1750787990-221210422.1741632166#v3-pay-information-refunded-amount
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
Refer to this PR to test integrity checks
How did you test it?
cURL :
Response:
On confirming the payment in redirect, do a PSync
cURL :
Response :
Now when force PSync will be done or we will receive Incoming Webhooks from connector, we will get an integrity check error if there's a discrepancy between the amount/currency field sent in request and received in the connector
Checklist
cargo +nightly fmt --all
cargo clippy