From fdb44547554deb502c2de3c553ca8498749f04e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20P=C5=82otka?= Date: Wed, 17 Aug 2022 16:02:50 +0200 Subject: [PATCH] Create new payment lazy to avoid creating to many transactions. --- src/Action/CaptureAction.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Action/CaptureAction.php b/src/Action/CaptureAction.php index 263be12..98c7c2d 100644 --- a/src/Action/CaptureAction.php +++ b/src/Action/CaptureAction.php @@ -74,8 +74,6 @@ public function execute($request): void $token = $request->getToken(); $payUdata = $this->prepareOrder($token, $order); - $result = $this->openPayUBridge->create($payUdata); - if (null !== $model['orderId']) { /** @var mixed $response */ $response = $this->openPayUBridge->retrieve((string) $model['orderId'])->getResponse(); @@ -89,6 +87,8 @@ public function execute($request): void } } + $result = $this->openPayUBridge->create($payUdata); + if (null !== $result) { /** @var mixed $response */ $response = $result->getResponse();