diff --git a/src/Gateways/AbstractGateway.php b/src/Gateways/AbstractGateway.php index 0ec9fb2d..9e07f200 100644 --- a/src/Gateways/AbstractGateway.php +++ b/src/Gateways/AbstractGateway.php @@ -444,4 +444,26 @@ public static function isSupportedTransaction(string $txType, string $paymentMod return in_array($paymentModel, static::$supportedTransactions[$txType], true); } + + /** + * @inheritDoc + */ + public static function getSupportedPaymentModels(): array + { + if (!isset(static::$supportedTransactions[PosInterface::TX_PAY])) { + return []; + } + + if (is_bool(static::$supportedTransactions[PosInterface::TX_PAY])) { + return [ + PosInterface::MODEL_NON_SECURE, + PosInterface::MODEL_3D_SECURE, + PosInterface::MODEL_3D_HOST, + PosInterface::MODEL_3D_PAY, + PosInterface::MODEL_3D_PAY_HOSTING, + ]; + } + + return static::$supportedTransactions[PosInterface::TX_PAY]; + } } diff --git a/src/PosInterface.php b/src/PosInterface.php index 280cc46f..ca0287c3 100644 --- a/src/PosInterface.php +++ b/src/PosInterface.php @@ -247,4 +247,9 @@ public function getAccount(): AbstractPosAccount; * @return bool */ public static function isSupportedTransaction(string $txType, string $paymentModel): bool; + + /** + * @return array + */ + public static function getSupportedPaymentModels(): array; }