fix(connector): [NMI] Added enum for Void Reason #7221
Merged
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
Previously, we were accepting void_reason as string, but since Nmi accepts specific values for void_reason, those values have been added to an enum.
Additional Changes
Motivation and Context
Issue Link: #7222
How did you test it?
Postman Tests
1. Create Payment
-Request
-Response
2. Psync
-Request
-Response
3. Cancel (Invalid Cancellation Reason)
-Request
-Response
4. Cancel (Valid Cancellation Reason)
-Request
-Response
5. Psync
-Request
-Response
Cypress Test Screenshots
No3DSAutoCapture
No3DSManualCapture
3DSAutoCapture
3DSManualCapture
Refund
Void
Headless Tests
Note: Please note that subsequent cypress tests for the same flows might fail because NMI has a validation from their end which prevents duplicate transactions from going through, and throws an error similar to "Duplicate transaction REFID:198369517" for the same.
Checklist
cargo +nightly fmt --all
cargo clippy