Skip to content

Commit a6fe005

Browse files
committed
fix reference payment usage
1 parent d457168 commit a6fe005

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

src/Application/Actions/Common/Catalog/CartAction.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use App\Domain\Service\Catalog\Exception\OrderShippingLimitException;
77
use App\Domain\Service\Catalog\Exception\WrongEmailValueException;
88
use App\Domain\Service\Catalog\Exception\WrongPhoneValueException;
9+
use App\Domain\Types\ReferenceTypeType;
910
use Doctrine\DBAL\ParameterType;
1011

1112
class CartAction extends CatalogAction
@@ -61,6 +62,9 @@ protected function action(): \Slim\Psr7\Response
6162
$data['delivery']['address'] = implode(', ', $data['delivery']['address']);
6263
}
6364

65+
// find payment method
66+
$data['payment'] = $data['payment'] ? $this->referenceService->read(['uuid' => $data['payment'], 'type' => ReferenceTypeType::TYPE_PAYMENT]) : null;
67+
6468
if ($this->isRecaptchaChecked()) {
6569
try {
6670
if (($limit = $this->parameter('catalog_order_limit', 0)) > 0) {

src/Application/Actions/Common/Catalog/CatalogAction.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use App\Domain\Service\Catalog\OrderService as CatalogOrderService;
88
use App\Domain\Service\Catalog\ProductService as CatalogProductService;
99
use App\Domain\Service\Notification\NotificationService;
10+
use App\Domain\Service\Reference\ReferenceService;
1011
use App\Domain\Service\User\UserService;
1112
use Psr\Container\ContainerInterface;
1213

@@ -22,6 +23,8 @@ abstract class CatalogAction extends AbstractAction
2223

2324
protected NotificationService $notificationService;
2425

26+
protected ReferenceService $referenceService;
27+
2528
public function __construct(ContainerInterface $container)
2629
{
2730
parent::__construct($container);
@@ -31,5 +34,6 @@ public function __construct(ContainerInterface $container)
3134
$this->catalogProductService = $container->get(CatalogProductService::class);
3235
$this->catalogOrderService = $container->get(CatalogOrderService::class);
3336
$this->notificationService = $container->get(NotificationService::class);
37+
$this->referenceService = $container->get(ReferenceService::class);
3438
}
3539
}

0 commit comments

Comments
 (0)