diff --git a/src/Assets/MollieCheckoutBlocksSupport.php b/src/Assets/MollieCheckoutBlocksSupport.php index 0f6e02fd..50fff97c 100644 --- a/src/Assets/MollieCheckoutBlocksSupport.php +++ b/src/Assets/MollieCheckoutBlocksSupport.php @@ -5,6 +5,7 @@ use Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType; use Mollie\WooCommerce\Gateway\MolliePaymentGatewayHandler; use Mollie\WooCommerce\Gateway\MolliePaymentGatewayI; +use Mollie\WooCommerce\PaymentMethods\PaymentFieldsStrategies\DefaultFieldsStrategy; use Mollie\WooCommerce\PaymentMethods\PaymentMethodI; use Mollie\WooCommerce\Shared\Data; @@ -126,9 +127,13 @@ public static function gatewayDataForWCBlocks(Data $dataService, array $deprecat $content = $method->getProcessedDescriptionForBlock(); $issuers = false; if ($method->getProperty('paymentFields') === true) { - $paymentFieldsService = $method->paymentFieldsService(); - $paymentFieldsService->setStrategy($method); - $issuers = $method->paymentFieldsService()->getStrategyMarkup($deprecatedGateway); + $className = 'Mollie\\WooCommerce\\PaymentMethods\\PaymentFieldsStrategies\\' . ucfirst($method->getProperty('id')) . 'FieldsStrategy'; + $paymentFieldsStrategy = class_exists($className) ? new $className( + $deprecatedGateway, + $gateway->get_description(), + $dataService + ) : new DefaultFieldsStrategy($deprecatedGateway, $gateway->get_description(), $dataService); + $issuers = $paymentFieldsStrategy->getFieldMarkup($deprecatedGateway, $dataService); } if ($gatewayId === 'creditcard') { $content .= $issuers; diff --git a/src/Gateway/GatewayModule.php b/src/Gateway/GatewayModule.php index e5c3225a..7143da94 100644 --- a/src/Gateway/GatewayModule.php +++ b/src/Gateway/GatewayModule.php @@ -13,26 +13,16 @@ use Inpsyde\Modularity\Module\ModuleClassNameIdTrait; use Inpsyde\Modularity\Module\ServiceModule; use Mollie\WooCommerce\BlockService\CheckoutBlockService; -use Mollie\WooCommerce\Buttons\ApplePayButton\AppleAjaxRequests; use Mollie\WooCommerce\Buttons\ApplePayButton\ApplePayDirectHandler; -use Mollie\WooCommerce\Buttons\ApplePayButton\ResponsesToApple; -use Mollie\WooCommerce\Buttons\PayPalButton\DataToPayPal; -use Mollie\WooCommerce\Buttons\PayPalButton\PayPalAjaxRequests; use Mollie\WooCommerce\Buttons\PayPalButton\PayPalButtonHandler; use Mollie\WooCommerce\Gateway\Voucher\MaybeDisableGateway; -use Mollie\WooCommerce\Notice\AdminNotice; -use Mollie\WooCommerce\Notice\NoticeInterface; -use Mollie\WooCommerce\PaymentMethods\PaymentFieldsStrategies\PaymentFieldsManager; use Mollie\WooCommerce\PaymentMethods\IconFactory; use Mollie\WooCommerce\PaymentMethods\PaymentMethodI; -use Mollie\WooCommerce\SDK\Api; use Mollie\WooCommerce\Settings\Settings; use Mollie\WooCommerce\Shared\Data; use Mollie\WooCommerce\Shared\GatewaySurchargeHandler; -use Mollie\WooCommerce\Subscription\MollieSubscriptionGatewayHandler; use Mollie\WooCommerce\PaymentMethods\Constants; use Psr\Container\ContainerInterface; -use Psr\Log\LoggerInterface as Logger; class GatewayModule implements ServiceModule, ExecutableModule, ExtendingModule { @@ -357,15 +347,12 @@ protected function instantiatePaymentMethods($container): array assert($settingsHelper instanceof Settings); $surchargeService = $container->get(Surcharge::class); assert($surchargeService instanceof Surcharge); - $paymentFieldsService = $container->get(PaymentFieldsManager::class); - assert($paymentFieldsService instanceof PaymentFieldsManager); foreach ($listAllAvailablePaymentMethods as $paymentMethodAvailable) { $paymentMethodId = $paymentMethodAvailable['id']; $paymentMethods[$paymentMethodId] = $this->buildPaymentMethod( $paymentMethodId, $iconFactory, $settingsHelper, - $paymentFieldsService, $surchargeService, $paymentMethodAvailable ); @@ -378,7 +365,6 @@ protected function instantiatePaymentMethods($container): array $paymentMethodId, $iconFactory, $settingsHelper, - $paymentFieldsService, $surchargeService, [] ); @@ -389,7 +375,6 @@ protected function instantiatePaymentMethods($container): array * @param string $id * @param IconFactory $iconFactory * @param Settings $settingsHelper - * @param PaymentFieldsManager $paymentFieldsService * @param Surcharge $surchargeService * @param array $paymentMethods * @return PaymentMethodI | array @@ -398,7 +383,6 @@ public function buildPaymentMethod( string $id, IconFactory $iconFactory, Settings $settingsHelper, - PaymentFieldsManager $paymentFieldsService, Surcharge $surchargeService, array $apiMethod ) { @@ -408,7 +392,6 @@ public function buildPaymentMethod( $paymentMethod = new $paymentMethodClassName( $iconFactory, $settingsHelper, - $paymentFieldsService, $surchargeService, $apiMethod ); diff --git a/src/Gateway/inc/services.php b/src/Gateway/inc/services.php index 030a11b5..9129d8dc 100644 --- a/src/Gateway/inc/services.php +++ b/src/Gateway/inc/services.php @@ -23,13 +23,12 @@ use Mollie\WooCommerce\PaymentMethods\InstructionStrategies\OrderInstructionsManager; use Mollie\WooCommerce\Payment\PaymentCheckoutRedirectService; use Mollie\WooCommerce\Payment\PaymentFactory; -use Mollie\WooCommerce\PaymentMethods\PaymentFieldsStrategies\PaymentFieldsManager; +use Mollie\WooCommerce\PaymentMethods\PaymentFieldsStrategies\DefaultFieldsStrategy; use Mollie\WooCommerce\Payment\PaymentProcessor; use Mollie\WooCommerce\PaymentMethods\Constants; use Mollie\WooCommerce\PaymentMethods\Icon\GatewayIconsRenderer; use Mollie\WooCommerce\PaymentMethods\IconFactory; use Mollie\WooCommerce\PaymentMethods\PaymentFieldsStrategies\NoopPaymentFieldsRenderer; -use Mollie\WooCommerce\PaymentMethods\PaymentFieldsStrategies\PaymentFieldsRenderer; use Mollie\WooCommerce\PaymentMethods\PaymentMethodI; use Mollie\WooCommerce\SDK\Api; use Mollie\WooCommerce\SDK\HttpResponse; @@ -155,11 +154,6 @@ OrderInstructionsManager::class => static function (): OrderInstructionsManager { return new OrderInstructionsManager(); }, - PaymentFieldsManager::class => static function (ContainerInterface $container): PaymentFieldsManager { - $data = $container->get('settings.data_helper'); - assert($data instanceof Data); - return new PaymentFieldsManager($data); - }, PaymentCheckoutRedirectService::class => static function ( ContainerInterface $container ): PaymentCheckoutRedirectService { @@ -428,15 +422,20 @@ static function ($filteredOption) { $paymentMethods = $container->get('gateway.paymentMethods'); $methodId = substr($gatewayId, strrpos($gatewayId, '_') + 1); $paymentMethod = $paymentMethods[$methodId]; - $oldGatewayInstances = $container->get('__deprecated.gateway_helpers'); //not all payment methods have a gateway if (!isset($oldGatewayInstances[$gatewayId])) { return new NoopPaymentFieldsRenderer(); } - $deprecatedGatewayHelper = $oldGatewayInstances[$gatewayId]; $gatewayDescription = $container->get('payment_gateway.' . $gatewayId . '.description'); - return new PaymentFieldsRenderer($paymentMethod, $deprecatedGatewayHelper, $gatewayDescription); + $dataHelper = $container->get('settings.data_helper'); + $deprecatedGatewayHelper = $oldGatewayInstances[$gatewayId]; + if (!$paymentMethod->getProperty('paymentFields')) { + return new DefaultFieldsStrategy($deprecatedGatewayHelper, $gatewayDescription, $dataHelper); + } else { + $className = 'Mollie\\WooCommerce\\PaymentMethods\\PaymentFieldsStrategies\\' . ucfirst($paymentMethod->getProperty('id')) . 'FieldsStrategy'; + return class_exists($className) ? new $className($deprecatedGatewayHelper, $gatewayDescription, $dataHelper) : new DefaultFieldsStrategy($deprecatedGatewayHelper, $gatewayDescription, $dataHelper); + } }; $dynamicServices["payment_gateway.$gatewayId.title"] = static function (ContainerInterface $container) use ($gatewayId) { diff --git a/src/PaymentMethods/AbstractPaymentMethod.php b/src/PaymentMethods/AbstractPaymentMethod.php index f9b1efa4..dc5da178 100644 --- a/src/PaymentMethods/AbstractPaymentMethod.php +++ b/src/PaymentMethods/AbstractPaymentMethod.php @@ -5,7 +5,6 @@ namespace Mollie\WooCommerce\PaymentMethods; use Mollie\WooCommerce\Gateway\Surcharge; -use Mollie\WooCommerce\PaymentMethods\PaymentFieldsStrategies\PaymentFieldsManager; use Mollie\WooCommerce\Settings\Settings; use Mollie\WooCommerce\Shared\SharedDataDictionary; @@ -31,10 +30,7 @@ abstract class AbstractPaymentMethod implements PaymentMethodI * @var Settings */ protected $settingsHelper; - /** - * @var PaymentFieldsManager - */ - protected $paymentFieldsService; + /** * @var Surcharge */ @@ -47,7 +43,6 @@ abstract class AbstractPaymentMethod implements PaymentMethodI public function __construct( IconFactory $iconFactory, Settings $settingsHelper, - PaymentFieldsManager $paymentFieldsService, Surcharge $surcharge, array $apiPaymentMethod ) { @@ -55,7 +50,6 @@ public function __construct( $this->id = $this->getIdFromConfig(); $this->iconFactory = $iconFactory; $this->settingsHelper = $settingsHelper; - $this->paymentFieldsService = $paymentFieldsService; $this->surcharge = $surcharge; $this->config = $this->getConfig(); $this->settings = $this->getSettings(); @@ -176,25 +170,6 @@ public function getAllFormFields() return $this->getFormFields($this->getSharedFormFields()); } - /** - * Sets the gateway's payment fields strategy based on payment method - * @param $deprecatedHelperGateway - * @return string - */ - public function paymentFieldsStrategy($deprecatedHelperGateway, $gatewayDescription) - { - $this->paymentFieldsService->setStrategy($this); - return $this->paymentFieldsService->executeStrategy($deprecatedHelperGateway, $gatewayDescription); - } - - /** - * @return PaymentFieldsManager - */ - public function paymentFieldsService(): PaymentFieldsManager - { - return $this->paymentFieldsService; - } - /** * Access the payment method processed description, surcharge included * @return mixed|string diff --git a/src/PaymentMethods/PaymentFieldsStrategies/AbstractPaymentFieldsRenderer.php b/src/PaymentMethods/PaymentFieldsStrategies/AbstractPaymentFieldsRenderer.php new file mode 100644 index 00000000..d2389b77 --- /dev/null +++ b/src/PaymentMethods/PaymentFieldsStrategies/AbstractPaymentFieldsRenderer.php @@ -0,0 +1,36 @@ +deprecatedHelperGateway = $deprecatedHelperGateway; + $this->gatewayDescription = $gateway; + $this->dataHelper = $dataHelper; + } + + /** + * @inheritDoc + */ + public function renderFields(): string + { + return ''; + } +} diff --git a/src/PaymentMethods/PaymentFieldsStrategies/BancomatpayFieldsStrategy.php b/src/PaymentMethods/PaymentFieldsStrategies/BancomatpayFieldsStrategy.php index 45bd8047..c1c30f4f 100644 --- a/src/PaymentMethods/PaymentFieldsStrategies/BancomatpayFieldsStrategy.php +++ b/src/PaymentMethods/PaymentFieldsStrategies/BancomatpayFieldsStrategy.php @@ -4,11 +4,13 @@ namespace Mollie\WooCommerce\PaymentMethods\PaymentFieldsStrategies; -class BancomatpayFieldsStrategy implements PaymentFieldsStrategyI +use Inpsyde\PaymentGateway\PaymentFieldsRendererInterface; + +class BancomatpayFieldsStrategy extends AbstractPaymentFieldsRenderer implements PaymentFieldsRendererInterface { const FIELD_PHONE = "billing_phone_bancomatpay"; - public function execute($deprecatedHelperGateway, $gatewayDescription, $dataHelper) + public function renderFields(): string { $showPhoneField = false; $isPhoneRequired = get_option('mollie_wc_is_phone_required_flag'); diff --git a/src/PaymentMethods/PaymentFieldsStrategies/BillieFieldsStrategy.php b/src/PaymentMethods/PaymentFieldsStrategies/BillieFieldsStrategy.php index 7f88f28f..ea8e8842 100644 --- a/src/PaymentMethods/PaymentFieldsStrategies/BillieFieldsStrategy.php +++ b/src/PaymentMethods/PaymentFieldsStrategies/BillieFieldsStrategy.php @@ -4,12 +4,13 @@ namespace Mollie\WooCommerce\PaymentMethods\PaymentFieldsStrategies; -class BillieFieldsStrategy implements PaymentFieldsStrategyI +use Inpsyde\PaymentGateway\PaymentFieldsRendererInterface; + +class BillieFieldsStrategy extends AbstractPaymentFieldsRenderer implements PaymentFieldsRendererInterface { const FIELD_COMPANY = "billing_company"; - public function execute($deprecatedHelperGateway, $gatewayDescription, $dataHelper): string - { + public function renderFields(): string { $showCompanyField = false; if (is_checkout_pay_page()) { diff --git a/src/PaymentMethods/PaymentFieldsStrategies/CreditcardFieldsStrategy.php b/src/PaymentMethods/PaymentFieldsStrategies/CreditcardFieldsStrategy.php index 4f79abb0..ba239091 100644 --- a/src/PaymentMethods/PaymentFieldsStrategies/CreditcardFieldsStrategy.php +++ b/src/PaymentMethods/PaymentFieldsStrategies/CreditcardFieldsStrategy.php @@ -4,16 +4,17 @@ namespace Mollie\WooCommerce\PaymentMethods\PaymentFieldsStrategies; +use Inpsyde\PaymentGateway\PaymentFieldsRendererInterface; use Mollie\WooCommerce\PaymentMethods\PaymentMethodI; -class CreditcardFieldsStrategy implements PaymentFieldsStrategyI +class CreditcardFieldsStrategy extends AbstractPaymentFieldsRenderer implements PaymentFieldsRendererInterface { - public function execute($deprecatedHelperGateway, $gatewayDescription, $dataHelper): string + public function renderFields(): string { - if (!$this->isMollieComponentsEnabled($deprecatedHelperGateway->paymentMethod())) { + if (!$this->isMollieComponentsEnabled($this->deprecatedHelperGateway->paymentMethod())) { return ''; } - $deprecatedHelperGateway->has_fields = true; + $this->deprecatedHelperGateway->has_fields = true; $allowedHtml = $this->svgAllowedHtml(); $output = '
'; @@ -23,8 +24,8 @@ public function execute($deprecatedHelperGateway, $gatewayDescription, $dataHelp '%1$s Secure payments provided by %2$s', 'mollie-payments-for-woocommerce' ), - wp_kses($this->lockIcon($dataHelper), $allowedHtml), - wp_kses($this->mollieLogo($dataHelper), $allowedHtml) + wp_kses($this->lockIcon($this->dataHelper), $allowedHtml), + wp_kses($this->mollieLogo($this->dataHelper), $allowedHtml) ); $output .= ''; diff --git a/src/PaymentMethods/PaymentFieldsStrategies/DefaultFieldsStrategy.php b/src/PaymentMethods/PaymentFieldsStrategies/DefaultFieldsStrategy.php index cf93bdc0..186df624 100644 --- a/src/PaymentMethods/PaymentFieldsStrategies/DefaultFieldsStrategy.php +++ b/src/PaymentMethods/PaymentFieldsStrategies/DefaultFieldsStrategy.php @@ -4,11 +4,13 @@ namespace Mollie\WooCommerce\PaymentMethods\PaymentFieldsStrategies; -class DefaultFieldsStrategy implements PaymentFieldsStrategyI +use Inpsyde\PaymentGateway\PaymentFieldsRendererInterface; + +class DefaultFieldsStrategy extends AbstractPaymentFieldsRenderer implements PaymentFieldsRendererInterface { - public function execute($deprecatedHelperGateway, $gatewayDescription, $dataHelper): string + public function renderFields(): string { - return $gatewayDescription; + return $this->gatewayDescription; } public function getFieldMarkup($gateway, $dataHelper) diff --git a/src/PaymentMethods/PaymentFieldsStrategies/GiftcardFieldsStrategy.php b/src/PaymentMethods/PaymentFieldsStrategies/GiftcardFieldsStrategy.php index bb262480..dc42a783 100644 --- a/src/PaymentMethods/PaymentFieldsStrategies/GiftcardFieldsStrategy.php +++ b/src/PaymentMethods/PaymentFieldsStrategies/GiftcardFieldsStrategy.php @@ -4,21 +4,23 @@ namespace Mollie\WooCommerce\PaymentMethods\PaymentFieldsStrategies; -class GiftcardFieldsStrategy implements PaymentFieldsStrategyI +use Inpsyde\PaymentGateway\PaymentFieldsRendererInterface; + +class GiftcardFieldsStrategy extends AbstractPaymentFieldsRenderer implements PaymentFieldsRendererInterface { use IssuersDropdownBehavior; - public function execute($deprecatedHelperGateway, $gatewayDescription, $dataHelper): string + public function renderFields(): string { - if (!$this->dropDownEnabled($deprecatedHelperGateway)) { - return $gatewayDescription; + if (!$this->dropDownEnabled($this->deprecatedHelperGateway)) { + return $this->gatewayDescription; } - $issuers = $this->getIssuers($deprecatedHelperGateway, $dataHelper); + $issuers = $this->getIssuers($this->deprecatedHelperGateway, $this->dataHelper); if (empty($issuers)) { - return $gatewayDescription; + return $this->gatewayDescription; } - $selectedIssuer = $deprecatedHelperGateway->paymentMethod()->getSelectedIssuer(); + $selectedIssuer = $this->deprecatedHelperGateway->paymentMethod()->getSelectedIssuer(); $html = ''; @@ -35,7 +37,7 @@ public function execute($deprecatedHelperGateway, $gatewayDescription, $dataHelp return wpautop(wptexturize($html)); } - return $this->renderIssuers($deprecatedHelperGateway, $issuers, $selectedIssuer); + return $this->renderIssuers($this->deprecatedHelperGateway, $issuers, $selectedIssuer); } public function getFieldMarkup($gateway, $dataHelper) diff --git a/src/PaymentMethods/PaymentFieldsStrategies/In3FieldsStrategy.php b/src/PaymentMethods/PaymentFieldsStrategies/In3FieldsStrategy.php index bbe3083e..137411da 100644 --- a/src/PaymentMethods/PaymentFieldsStrategies/In3FieldsStrategy.php +++ b/src/PaymentMethods/PaymentFieldsStrategies/In3FieldsStrategy.php @@ -4,14 +4,16 @@ namespace Mollie\WooCommerce\PaymentMethods\PaymentFieldsStrategies; -class In3FieldsStrategy implements PaymentFieldsStrategyI +use Inpsyde\PaymentGateway\PaymentFieldsRendererInterface; + +class In3FieldsStrategy extends AbstractPaymentFieldsRenderer implements PaymentFieldsRendererInterface { use PaymentFieldsStrategiesTrait; const FIELD_BIRTHDATE = "billing_birthdate_in3"; const FIELD_PHONE = "billing_phone_in3"; - public function execute($deprecatedHelperGateway, $gatewayDescription, $dataHelper): string + public function renderFields(): string { $showBirthdateField = false; $showPhoneField = false; diff --git a/src/PaymentMethods/PaymentFieldsStrategies/KbcFieldsStrategy.php b/src/PaymentMethods/PaymentFieldsStrategies/KbcFieldsStrategy.php index 7cf7ca1a..479b157a 100644 --- a/src/PaymentMethods/PaymentFieldsStrategies/KbcFieldsStrategy.php +++ b/src/PaymentMethods/PaymentFieldsStrategies/KbcFieldsStrategy.php @@ -4,21 +4,23 @@ namespace Mollie\WooCommerce\PaymentMethods\PaymentFieldsStrategies; -class KbcFieldsStrategy implements PaymentFieldsStrategyI +use Inpsyde\PaymentGateway\PaymentFieldsRendererInterface; + +class KbcFieldsStrategy extends AbstractPaymentFieldsRenderer implements PaymentFieldsRendererInterface { use IssuersDropdownBehavior; - public function execute($deprecatedHelperGateway, $gatewayDescription, $dataHelper): string + public function renderFields(): string { - if (!$this->dropDownEnabled($deprecatedHelperGateway)) { + if (!$this->dropDownEnabled($this->deprecatedHelperGateway)) { return ''; } - $issuers = $this->getIssuers($deprecatedHelperGateway, $dataHelper); + $issuers = $this->getIssuers($this->deprecatedHelperGateway, $this->dataHelper); - $selectedIssuer = $deprecatedHelperGateway->paymentMethod()->getSelectedIssuer(); + $selectedIssuer = $this->deprecatedHelperGateway->paymentMethod()->getSelectedIssuer(); - return $this->renderIssuers($deprecatedHelperGateway, $issuers, $selectedIssuer); + return $this->renderIssuers($this->deprecatedHelperGateway, $issuers, $selectedIssuer); } public function getFieldMarkup($gateway, $dataHelper) diff --git a/src/PaymentMethods/PaymentFieldsStrategies/PaymentFieldsManager.php b/src/PaymentMethods/PaymentFieldsStrategies/PaymentFieldsManager.php deleted file mode 100644 index a27788da..00000000 --- a/src/PaymentMethods/PaymentFieldsStrategies/PaymentFieldsManager.php +++ /dev/null @@ -1,50 +0,0 @@ -dataHelper = $dataHelper; - } - - public function setStrategy($paymentMethod) - { - if (!$paymentMethod->getProperty('paymentFields')) { - $this->strategy = new DefaultFieldsStrategy(); - } else { - $className = 'Mollie\\WooCommerce\\PaymentMethods\\PaymentFieldsStrategies\\' . ucfirst($paymentMethod->getProperty('id')) . 'FieldsStrategy'; - $this->strategy = class_exists($className) ? new $className() : new DefaultFieldsStrategy(); - } - } - - public function executeStrategy($deprecatedHelperGateway, $gatewayDescription) - { - return $this->strategy->execute($deprecatedHelperGateway, $gatewayDescription, $this->dataHelper); - } - - public function getStrategyMarkup($gateway) - { - return $this->strategy->getFieldMarkup($gateway, $this->dataHelper); - } -} diff --git a/src/PaymentMethods/PaymentFieldsStrategies/PaymentFieldsRenderer.php b/src/PaymentMethods/PaymentFieldsStrategies/PaymentFieldsRenderer.php deleted file mode 100644 index 156acc9b..00000000 --- a/src/PaymentMethods/PaymentFieldsStrategies/PaymentFieldsRenderer.php +++ /dev/null @@ -1,31 +0,0 @@ -paymentMethod = $paymentMethod; - $this->deprecatedGatewayHelper = $deprecatedGatewayHelper; - $this->gatewayDescription = $gateway; - } - - /** - * @inheritDoc - */ - public function renderFields(): string - { - return $this->paymentMethod->paymentFieldsStrategy($this->deprecatedGatewayHelper, $this->gatewayDescription); - } -} diff --git a/src/PaymentMethods/PaymentFieldsStrategies/RivertyFieldsStrategy.php b/src/PaymentMethods/PaymentFieldsStrategies/RivertyFieldsStrategy.php index de00e398..ddfb4658 100644 --- a/src/PaymentMethods/PaymentFieldsStrategies/RivertyFieldsStrategy.php +++ b/src/PaymentMethods/PaymentFieldsStrategies/RivertyFieldsStrategy.php @@ -4,14 +4,16 @@ namespace Mollie\WooCommerce\PaymentMethods\PaymentFieldsStrategies; -class RivertyFieldsStrategy implements PaymentFieldsStrategyI +use Inpsyde\PaymentGateway\PaymentFieldsRendererInterface; + +class RivertyFieldsStrategy extends AbstractPaymentFieldsRenderer implements PaymentFieldsRendererInterface { use PaymentFieldsStrategiesTrait; const FIELD_BIRTHDATE = "billing_birthdate_riverty"; const FIELD_PHONE = "billing_phone_riverty"; - public function execute($deprecatedHelperGateway, $gatewayDescription, $dataHelper): string + public function renderFields(): string { $showBirthdateField = false; $showPhoneField = false; diff --git a/src/PaymentMethods/PaymentMethodI.php b/src/PaymentMethods/PaymentMethodI.php index 375a1bb7..3f6a0d9e 100644 --- a/src/PaymentMethods/PaymentMethodI.php +++ b/src/PaymentMethods/PaymentMethodI.php @@ -4,8 +4,6 @@ namespace Mollie\WooCommerce\PaymentMethods; -use Mollie\WooCommerce\PaymentMethods\PaymentFieldsStrategies\PaymentFieldsManager; - interface PaymentMethodI { public function getProperty(string $propertyName); @@ -13,6 +11,5 @@ public function hasProperty(string $propertyName): bool; public function title(): string; public function hasPaymentFields(): bool; public function getProcessedDescriptionForBlock(): string; - public function paymentFieldsService(): PaymentFieldsManager; public function hasSurcharge(): bool; }