diff --git a/src/Service/Cart/Voucher/VoucherCartCollector.php b/src/Service/Cart/Voucher/VoucherCartCollector.php index 149a28ef9..be541bce7 100644 --- a/src/Service/Cart/Voucher/VoucherCartCollector.php +++ b/src/Service/Cart/Voucher/VoucherCartCollector.php @@ -3,6 +3,7 @@ namespace Kiener\MolliePayments\Service\Cart\Voucher; use Kiener\MolliePayments\Handler\Method\VoucherPayment; +use Kiener\MolliePayments\Repository\PaymentMethodRepository; use Kiener\MolliePayments\Service\CustomFieldsInterface; use Kiener\MolliePayments\Struct\LineItem\LineItemAttributes; use Kiener\MolliePayments\Struct\Voucher\VoucherType; @@ -21,7 +22,7 @@ class VoucherCartCollector implements CartDataCollectorInterface public const VOUCHER_PERMITTED = 'mollie-voucher-permitted'; /** - * @var EntityRepository + * @var PaymentMethodRepository */ private $repoPaymentMethods; @@ -33,9 +34,9 @@ class VoucherCartCollector implements CartDataCollectorInterface /** * @param VoucherService $voucherService - * @param EntityRepository $paymentMethodRepository + * @param PaymentMethodRepository $paymentMethodRepository */ - public function __construct(VoucherService $voucherService, EntityRepository $paymentMethodRepository) + public function __construct(VoucherService $voucherService, PaymentMethodRepository $paymentMethodRepository) { $this->voucherService = $voucherService; $this->repoPaymentMethods = $paymentMethodRepository; @@ -111,7 +112,7 @@ private function getVoucherID(Context $context): string // Get payment methods /** @var array $paymentMethods */ - $paymentMethods = $this->repoPaymentMethods->searchIds($criteria, $context)->getIds(); + $paymentMethods = $this->repoPaymentMethods->getRepository()->searchIds($criteria, $context)->getIds(); return (string)$paymentMethods[0]; }