From ab4122e08d499731291b8d6cb1f362d67813d5df Mon Sep 17 00:00:00 2001 From: prog5 Date: Sun, 22 Jan 2023 18:41:53 +0300 Subject: [PATCH] Added features field to AuthorizeRequest.php, updated OrderStatusResponse.php, temporary change endpoint protocol for test environment --- src/Gateway.php | 4 +++- src/Message/AuthorizeRequest.php | 20 +++++++++++++++++++- src/Message/OrderStatusResponse.php | 2 +- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/Gateway.php b/src/Gateway.php index 7ea6525..23d8bae 100644 --- a/src/Gateway.php +++ b/src/Gateway.php @@ -62,8 +62,10 @@ public function getDefaultParameters() */ public function setTestMode($testMode) { + //TODO + //temp set http for test env! $this->setEndPoint( - $testMode ? 'https://3dsec.sberbank.ru/payment/rest/' : 'https://securepayments.sberbank.ru/payment/rest/' + $testMode ? 'http://3dsec.sberbank.ru/payment/rest/' : 'https://securepayments.sberbank.ru/payment/rest/' ); return $this->setParameter('testMode', $testMode); diff --git a/src/Message/AuthorizeRequest.php b/src/Message/AuthorizeRequest.php index 0f7e5c0..c027442 100644 --- a/src/Message/AuthorizeRequest.php +++ b/src/Message/AuthorizeRequest.php @@ -35,7 +35,8 @@ public function getData() 'jsonParams', 'sessionTimeoutSecs', 'expirationDate', - 'bindingId' + 'bindingId', + 'features', ]; return $this->specifyAdditionalParameters($data, $additionalParams); @@ -229,6 +230,23 @@ public function setBindingId($value) return $this->setParameter('bindingId', $value); } + /** + * @return mixed + */ + public function getFeatures() + { + return $this->getParameter('features'); + } + + /** + * @param $value + * @return mixed + */ + public function setFeatures($value) + { + return $this->setParameter('features', $value); + } + /** * @param mixed $data * @return object|\Omnipay\Common\Message\ResponseInterface diff --git a/src/Message/OrderStatusResponse.php b/src/Message/OrderStatusResponse.php index 415ad1b..f06a88a 100644 --- a/src/Message/OrderStatusResponse.php +++ b/src/Message/OrderStatusResponse.php @@ -137,7 +137,7 @@ public function getIp() */ public function getBindingInfo() { - return array_key_exists('BindingInfo', $this->data) ? $this->data['BindingInfo'] : []; + return array_key_exists('bindingInfo', $this->data) ? $this->data['bindingInfo'] : []; } /**