From 287a2f1d6a4d856d4cdfdbb597068bd60526fcb2 Mon Sep 17 00:00:00 2001 From: Volodymyr Klymenko Date: Fri, 27 Aug 2021 07:46:03 +0300 Subject: [PATCH] VIPPS-390: Skip Capture for discounted order lines set to amount null --- Gateway/Command/CaptureCommand.php | 4 ++++ composer.json | 2 +- etc/module.xml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Gateway/Command/CaptureCommand.php b/Gateway/Command/CaptureCommand.php index cf275367..37679066 100644 --- a/Gateway/Command/CaptureCommand.php +++ b/Gateway/Command/CaptureCommand.php @@ -178,6 +178,10 @@ public function execute(array $commandSubject) $amount = $this->subjectReader->readAmount($commandSubject); $amount = (int)round($this->formatPrice($amount) * 100); + if ($amount === 0) { + return true; + } + $orderId = $this->subjectReader->readPayment($commandSubject)->getOrder()->getOrderIncrementId(); $transaction = $this->paymentDetailsProvider->get($orderId); diff --git a/composer.json b/composer.json index 5ec313b8..64b19a1b 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "type": "magento2-module", "description": "Vipps Payment Method", "license": "proprietary", - "version": "2.4.18", + "version": "2.4.19", "require": { "magento/framework": "103.0.*", "magento/module-sales": "103.0.*", diff --git a/etc/module.xml b/etc/module.xml index f56c9c42..ed2914b2 100644 --- a/etc/module.xml +++ b/etc/module.xml @@ -14,7 +14,7 @@ ~ IN THE SOFTWARE. --> - +