From 522f862395728d8d08e6eb65f08587e95079630b Mon Sep 17 00:00:00 2001 From: Volodymyr Klymenko Date: Fri, 27 Aug 2021 07:49:36 +0300 Subject: [PATCH] VIPPS-390: Skip Capture for discounted order lines set to amount null --- Gateway/Command/CaptureCommand.php | 4 ++++ composer.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Gateway/Command/CaptureCommand.php b/Gateway/Command/CaptureCommand.php index cf275367..35c078ca 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 6a6dabce..173d1d33 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "type": "magento2-module", "description": "Vipps Payment Method", "license": "proprietary", - "version": "2.2.15", + "version": "2.2.16", "require": { "magento/framework": "101.0.*", "magento/module-sales": "101.0.*",