VCST-5075: Reject capture/refund requests without a positive amount#495
Merged
Conversation
fix: Reject capture/refund requests without a positive amount
|
OlegoO
added a commit
that referenced
this pull request
May 13, 2026
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.

Description
fix: Reject capture/refund requests without a positive amount
References
QA-test:
Jira-link:
https://virtocommerce.atlassian.net/browse/VCST-5075
Artifact URL:
https://vc3prerelease.blob.core.windows.net/packages/VirtoCommerce.Orders_3.1008.0-pr-495-04a9.zip
Note
Medium Risk
Changes payment capture/refund request validation and semantics by no longer treating a missing amount as “full amount,” which may affect existing integrations sending null amounts.
Overview
PaymentFlowServicenow validatesCaptureOrderPaymentRequest.AmountandRefundOrderPaymentRequest.Amountand immediately returnsInvalidRequestErrorwhen the amount is missing or non-positive.The flow no longer defaults to
payment.Sumfor capture/refund amounts (usesrequest.Amount.Valuethroughout), adds a dedicatedPaymentErrorDescriber.AmountRequired()message, and includes unit tests covering null/zero/negative amounts for both operations.Reviewed by Cursor Bugbot for commit 04a9435. Bugbot is set up for automated code reviews on this repo. Configure here.