From 2d68e8880a4d00722632f380b293759d9495aea1 Mon Sep 17 00:00:00 2001 From: Greno Date: Tue, 1 Oct 2024 11:28:33 +0200 Subject: [PATCH] Add proxy options to Soap client in Comfortpay --- src/ComfortPay/Gateway.php | 40 +++++++++++++++++ .../Message/AbstractSoapRequest.php | 44 +++++++++++++++++++ 2 files changed, 84 insertions(+) diff --git a/src/ComfortPay/Gateway.php b/src/ComfortPay/Gateway.php index f84e4b6..a8ecc49 100644 --- a/src/ComfortPay/Gateway.php +++ b/src/ComfortPay/Gateway.php @@ -106,6 +106,46 @@ public function setCertPass($value) return $this->setParameter('certPass', $value); } + public function getProxyHost() + { + return $this->getParameter('proxyHost'); + } + + public function setProxyHost($value) + { + return $this->setParameter('proxyHost', $value); + } + + public function getProxyPort() + { + return $this->getParameter('proxyPort'); + } + + public function setProxyPort($value) + { + return $this->setParameter('proxyPort', $value); + } + + public function getProxyLogin() + { + return $this->getParameter('proxyLogin'); + } + + public function setProxyLogin($value) + { + return $this->setParameter('proxyLogin', $value); + } + + public function getProxyPass() + { + return $this->getParameter('proxyPass'); + } + + public function setProxyPass($value) + { + return $this->setParameter('proxyPass', $value); + } + public function purchase(array $parameters = array()) { return $this->createRequest(\Omnipay\ComfortPay\Message\PurchaseRequest::class, $parameters); diff --git a/src/ComfortPay/Message/AbstractSoapRequest.php b/src/ComfortPay/Message/AbstractSoapRequest.php index ca573b2..22aeaea 100644 --- a/src/ComfortPay/Message/AbstractSoapRequest.php +++ b/src/ComfortPay/Message/AbstractSoapRequest.php @@ -27,6 +27,46 @@ public function setCertPass($value) return $this->setParameter('certPass', $value); } + public function getProxyHost() + { + return $this->getParameter('proxyHost'); + } + + public function setProxyHost($value) + { + return $this->setParameter('proxyHost', $value); + } + + public function getProxyPort() + { + return $this->getParameter('proxyPort'); + } + + public function setProxyPort($value) + { + return $this->setParameter('proxyPort', $value); + } + + public function getProxyLogin() + { + return $this->getParameter('proxyLogin'); + } + + public function setProxyLogin($value) + { + return $this->setParameter('proxyLogin', $value); + } + + public function getProxyPass() + { + return $this->getParameter('proxyPass'); + } + + public function setProxyPass($value) + { + return $this->setParameter('proxyPass', $value); + } + public function getData() { $this->validate('certPath', 'certPass'); @@ -48,6 +88,10 @@ protected function getSoapClient() 'keep_alive' => false, 'soap_version' => SOAP_1_2, 'cache_wsdl' => WSDL_CACHE_NONE, + 'proxy_host' => $this->getParameter('proxyHost'), + 'proxy_port' => $this->getParameter('proxyPort'), + 'proxy_login' => $this->getParameter('proxyLogin'), + 'proxy_password' => $this->getParameter('proxyPassword'), 'stream_context' => stream_context_create([ 'ssl' => [ 'verify_peer' => false,