Add amount check in saman driver verify function #294
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.
Description
This pull request introduces a critical update to the Saman payment driver, ensuring the amount verification during the verify step matches the expected value. If there is a mismatch, the transaction is reversed to maintain data integrity and prevent inconsistencies.
Motivation and context
This change is required to address a scenario where the verified amount returned by the Saman gateway does not match the invoice amount. Previously, such discrepancies were not handled effectively, which could result in financial inaccuracies.
Saman payment gateway document specifically notes that in verify the merchant "SHOULD" check the amount and call reverse function if there is a Contradiction in returned amount and invoice amount.
This fix ensures:
Accurate amount verification.
Automatic reversal of transactions if discrepancies occur.
The added "password" parameter represents (رمز پذیرنده) , and the "ReverseTransaction" soap function in saman needs it .