diff --git a/Magewire/Payment/Method/Creditcard.php b/Magewire/Payment/Method/Creditcard.php deleted file mode 100644 index 4c5acc5..0000000 --- a/Magewire/Payment/Method/Creditcard.php +++ /dev/null @@ -1,114 +0,0 @@ - 'Saving card type' - ]; - - protected $rules = [ - 'cardType' => 'required' - ]; - - protected $messages = [ - 'cardType:required' => 'A card type is required' - ]; - - protected SessionCheckout $sessionCheckout; - - protected CartRepositoryInterface $quoteRepository; - - protected ScopeConfigInterface $scopeConfig; - - protected MethodConfigProvider $methodConfigProvider; - - public function __construct( - Validator $validator, - SessionCheckout $sessionCheckout, - CartRepositoryInterface $quoteRepository, - ScopeConfigInterface $scopeConfig, - MethodConfigProvider $methodConfigProvider - ) { - parent::__construct($validator); - - $this->sessionCheckout = $sessionCheckout; - $this->quoteRepository = $quoteRepository; - $this->scopeConfig = $scopeConfig; - $this->methodConfigProvider = $methodConfigProvider; - } - - /** - * @throws LocalizedException - * @throws NoSuchEntityException - */ - public function mount(): void - { - $this->cardType = $this->sessionCheckout - ->getQuote() - ->getPayment() - ->getAdditionalInformation('card_type'); - } - - /** - * Listen for bank cardType been updated. - */ - public function updatedCardType(string $value): ?string - { - $this->validateOnly(); - $value = empty($value) ? null : $value; - - try { - $quote = $this->sessionCheckout->getQuote(); - $quote->getPayment()->setAdditionalInformation('card_type', $value); - - $this->quoteRepository->save($quote); - } catch (LocalizedException $exception) { - $this->dispatchErrorMessage($exception->getMessage()); - } - - return $value; - } - public function evaluateCompletion(EvaluationResultFactory $resultFactory): EvaluationResultInterface - { - if ($this->cardType === null) { - return $resultFactory->createErrorMessageEvent() - ->withCustomEvent('payment:method:error') - ->withMessage('A card type is required'); - } - - return $resultFactory->createSuccess(); - } - - public function getIssuers(): array - { - return $this->methodConfigProvider->formatIssuers(); - } - - public function displayAsSelect($storeId = null): bool - { - return $this->scopeConfig->getValue( - MethodIdeal::XPATH_IDEAL_SELECTION_TYPE, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $storeId - ) === '2'; - } -} diff --git a/etc/frontend/di.xml b/etc/frontend/di.xml index c3a6f08..ec283db 100644 --- a/etc/frontend/di.xml +++ b/etc/frontend/di.xml @@ -20,7 +20,6 @@ \Buckaroo\HyvaCheckout\Model\Magewire\Payment\PlaceOrderService \Buckaroo\HyvaCheckout\Model\Magewire\Payment\PlaceOrderService \Buckaroo\HyvaCheckout\Model\Magewire\Payment\PlaceOrderService - \Buckaroo\HyvaCheckout\Model\Magewire\Payment\PlaceOrderService \Buckaroo\HyvaCheckout\Model\Magewire\Payment\PlaceOrderService \Buckaroo\HyvaCheckout\Model\Magewire\Payment\PlaceOrderService \Buckaroo\HyvaCheckout\Model\Magewire\Payment\PlaceOrderService diff --git a/view/frontend/layout/hyva_checkout_components.xml b/view/frontend/layout/hyva_checkout_components.xml index 2e3d8a6..0553026 100644 --- a/view/frontend/layout/hyva_checkout_components.xml +++ b/view/frontend/layout/hyva_checkout_components.xml @@ -45,16 +45,6 @@ - - - - \Buckaroo\HyvaCheckout\Magewire\Payment\Method\Creditcard - - - - diff --git a/view/frontend/templates/component/payment/method/creditcard.phtml b/view/frontend/templates/component/payment/method/creditcard.phtml deleted file mode 100644 index f7d46e8..0000000 --- a/view/frontend/templates/component/payment/method/creditcard.phtml +++ /dev/null @@ -1,56 +0,0 @@ -getIssuers(); - -?> -
-
- displayAsSelect()) { ?> - - - -

escapeHtml(__('Select a Credit Card or Debit Card:')); ?>

- -
- " - value="escapeHtmlAttr($issuer["code"]) ?>" - /> - -
- - -
-