Skip to content

Commit

Permalink
PayPal: Only void orders via webhook if payment wasn't captured yet
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-Herzog committed May 22, 2024
1 parent 619d00c commit 9ee5ce9
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -488,9 +488,11 @@ private async Task HandleCaptureAsync(Order order, WebhookResource resource)
break;

case "declined":
order.CaptureTransactionResult = status;
order.PaymentStatus = PaymentStatus.Voided;
await _orderProcessingService.VoidOfflineAsync(order);
if (order.CanVoidOffline())
{
order.CaptureTransactionResult = status;
await _orderProcessingService.VoidOfflineAsync(order);
}
break;

case "refunded":
Expand Down

0 comments on commit 9ee5ce9

Please sign in to comment.