diff --git a/Helper/PaymentMethods/PaymentMethodFactory.php b/Helper/PaymentMethods/PaymentMethodFactory.php index 32497defb..db4bd7d3d 100644 --- a/Helper/PaymentMethods/PaymentMethodFactory.php +++ b/Helper/PaymentMethods/PaymentMethodFactory.php @@ -42,6 +42,8 @@ public static function createAdyenPaymentMethod(string $txVariant): PaymentMetho return new AmazonPayPaymentMethod($txVariantObject->getCard()); case GooglePayPaymentMethod::TX_VARIANT: return new GooglePayPaymentMethod($txVariantObject->getCard()); + case TwintPaymentMethod::TX_VARIANT: + return new TwintPaymentMethod(); default: $message = sprintf('Unknown txVariant: %s', $txVariant); self::$adyenLogger->debug($message); diff --git a/Helper/PaymentMethods/TwintPaymentMethod.php b/Helper/PaymentMethods/TwintPaymentMethod.php new file mode 100644 index 000000000..c31f04f71 --- /dev/null +++ b/Helper/PaymentMethods/TwintPaymentMethod.php @@ -0,0 +1,58 @@ + + */ +namespace Adyen\Payment\Helper\PaymentMethods; + +class TwintPaymentMethod implements PaymentMethodInterface +{ + const TX_VARIANT = 'twint'; + const NAME = 'TWINT'; + + public function getTxVariant(): string + { + return self::TX_VARIANT; + } + + public function getPaymentMethodName(): string + { + return self::NAME; + } + + public function supportsRecurring(): bool + { + return true; + } + + public function supportsManualCapture(): bool + { + return true; + } + + public function supportsAutoCapture(): bool + { + return true; + } + + public function supportsCardOnFile(): bool + { + return false; + } + + public function supportsSubscription(): bool + { + return true; + } + + public function supportsUnscheduledCardOnFile(): bool + { + return true; + } +} diff --git a/Model/Config/Source/TokenizedPaymentMethods.php b/Model/Config/Source/TokenizedPaymentMethods.php index 0af6ee7ca..20a6708dc 100644 --- a/Model/Config/Source/TokenizedPaymentMethods.php +++ b/Model/Config/Source/TokenizedPaymentMethods.php @@ -34,6 +34,10 @@ public function toOptionArray() 'value' => PaymentMethods\SepaPaymentMethod::TX_VARIANT, 'label' => PaymentMethods\SepaPaymentMethod::NAME ], + [ + 'value' => PaymentMethods\TwintPaymentMethod::TX_VARIANT, + 'label' => PaymentMethods\TwintPaymentMethod::NAME + ] ]; } }