Skip to content

VCST-5075: Reject capture/refund requests without a positive amount#495

Merged
OlegoO merged 1 commit into
devfrom
fix/VCST-5075
May 12, 2026
Merged

VCST-5075: Reject capture/refund requests without a positive amount#495
OlegoO merged 1 commit into
devfrom
fix/VCST-5075

Conversation

@OlegoO
Copy link
Copy Markdown
Contributor

@OlegoO OlegoO commented May 12, 2026

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
PaymentFlowService now validates CaptureOrderPaymentRequest.Amount and RefundOrderPaymentRequest.Amount and immediately returns InvalidRequestError when the amount is missing or non-positive.

The flow no longer defaults to payment.Sum for capture/refund amounts (uses request.Amount.Value throughout), adds a dedicated PaymentErrorDescriber.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.

fix: Reject capture/refund requests without a positive amount
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 12, 2026

@OlegoO OlegoO merged commit c469b36 into dev May 12, 2026
8 checks passed
@OlegoO OlegoO deleted the fix/VCST-5075 branch May 12, 2026 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant