Skip to content

VCST-4564: Refactor payment processing to use async methods#485

Merged
OlegoO merged 3 commits intodevfrom
feat/VCST-4564
Feb 5, 2026
Merged

VCST-4564: Refactor payment processing to use async methods#485
OlegoO merged 3 commits intodevfrom
feat/VCST-4564

Conversation

@OlegoO
Copy link
Contributor

@OlegoO OlegoO commented Feb 5, 2026

Description

feat: Refactor payment processing to use async methods

References

QA-test:

Jira-link:

https://virtocommerce.atlassian.net/browse/VCST-4564

Artifact URL:

https://vc3prerelease.blob.core.windows.net/packages/VirtoCommerce.Orders_3.867.0-pr-485-b5bb.zip


Note

Medium Risk
Touches payment capture/refund/void paths and an API endpoint signature, so behavior/regressions depend on the new async Payment module methods and client compatibility with the added CancellationToken parameter.

Overview
Refactors order payment flows to use the Payment module’s async APIs: post-processing (ValidatePostProcessRequestAsync/PostProcessPaymentAsync), capture/refund (CaptureProcessPaymentAsync/RefundProcessPaymentAsync), and order payment cancellation now voids/refunds via async calls.

Updates the processPayment controller actions to accept a CancellationToken and call ProcessPaymentAsync, and bumps Payment module package/dependency versions to 3.813.0 (plus a minor manifest copyright year update).

Written by Cursor Bugbot for commit ad31072. This will update automatically on new commits. Configure here.

feat: Refactor payment processing to use async methods
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 5, 2026

Copy link
Contributor

@vc-ci vc-ci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test Suite: Test Suites/Modules/module_Assets
Tests: 13
Failures: 0
Errors: 0
Time: 7.781
Timestamp: 05-02-2026T16:16:29

@OlegoO OlegoO merged commit ac7b47f into dev Feb 5, 2026
2 of 3 checks passed
@OlegoO OlegoO deleted the feat/VCST-4564 branch February 5, 2026 16:26
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

var paymentToCancel = order.InPayments.FirstOrDefault(x => x.Id.EqualsIgnoreCase(jobArgument.PaymentId));
if (paymentToCancel != null && !paymentToCancel.IsCancelled)
{
#pragma warning disable VC0012
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Async method unnecessarily blocks via sync-over-async wrapper

Medium Severity

The async method TryToCancelOrderPaymentsAsync calls the deprecated synchronous CancelPayment method, which internally uses .GetAwaiter().GetResult() to block on CancelPaymentAsync. This sync-over-async pattern inside an async method is inefficient and contradicts the PR's purpose of using async methods. The async method could directly await CancelPaymentAsync(paymentToCancel, order) instead of calling the blocking wrapper.

Additional Locations (1)

Fix in Cursor Fix in Web

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.

2 participants