Skip to content

Commit

Permalink
force authorized amount is greater than 0 before capture
Browse files Browse the repository at this point in the history
  • Loading branch information
leon-zhang-awx committed Oct 18, 2024
1 parent 999cfc0 commit 67c2445
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Plugin/CapturePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function beforeCapture(CaptureOperation $subject, OrderPaymentInterface $
if (!$record) {
return;
}
if (empty($payment->getAmountAuthorized())) {
if (empty($payment->getAmountAuthorized()) or $payment->getAmountAuthorized() < 0) {
throw new LocalizedException(__('Authorized amount must be greater than 0.'));
}
}
Expand Down

0 comments on commit 67c2445

Please sign in to comment.