From 010fae511fee8d785b47ddc3fe7bde4f9e2e987c Mon Sep 17 00:00:00 2001 From: Roman Zimin Date: Wed, 11 Sep 2024 18:25:14 +0300 Subject: [PATCH] SBERPAY, TPAY, ALFAPAY added to allowed payment methods --- src/Authorization.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/Authorization.php b/src/Authorization.php index 627d874..eb491db 100644 --- a/src/Authorization.php +++ b/src/Authorization.php @@ -11,6 +11,9 @@ class Authorization implements AuthorizationInterface const TYPE_FASTER_PAYMENTS = 'FASTER_PAYMENTS'; const TYPE_SOM = 'SOM'; + const TYPE_SBERPAY = 'SBERPAY'; + const TYPE_TPAY = 'TPAY'; + const TYPE_ALFAPAY = 'ALFAPAY'; /** * включить страницу оплаты Ypmn @@ -51,15 +54,24 @@ public function __construct(string $paymentMethodType, bool $isPaymentPageUsed) public function setPaymentMethod(string $paymentMethodType) : self { switch ($paymentMethodType) { - case 'CCVISAMC': + case self::TYPE_CCVISAMC: $this->paymentMethod = self::TYPE_CCVISAMC; break; - case 'FASTER_PAYMENTS': + case self::TYPE_FASTER_PAYMENTS: $this->paymentMethod = self::TYPE_FASTER_PAYMENTS; break; - case 'SOM': + case self::TYPE_SOM: $this->paymentMethod = self::TYPE_SOM; break; + case self::TYPE_SBERPAY: + $this->paymentMethod = self::TYPE_SBERPAY; + break; + case self::TYPE_TPAY: + $this->paymentMethod = self::TYPE_TPAY; + break; + case self::TYPE_ALFAPAY: + $this->paymentMethod = self::TYPE_ALFAPAY; + break; default: throw new PaymentException('Неверный тип оплаты в авторизации'); }