From fcc5ebe9057b1b2e069941806a80a310e9975d30 Mon Sep 17 00:00:00 2001 From: Marc-Jan Barnhoorn Date: Thu, 30 Aug 2018 15:50:15 +0200 Subject: [PATCH] add request type data --- src/LinkORB/Buckaroo/Request.php | 57 +++++++++++++++++--------------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/src/LinkORB/Buckaroo/Request.php b/src/LinkORB/Buckaroo/Request.php index fd3a870..0cc1bb3 100644 --- a/src/LinkORB/Buckaroo/Request.php +++ b/src/LinkORB/Buckaroo/Request.php @@ -32,13 +32,13 @@ class Request public function __construct($websiteKey = null, $testMode = false, array $soapOptions = array()) { - + $this->websiteKey = $websiteKey; $this->testMode = $testMode; - $wsdl_url = "https://checkout.buckaroo.nl/soap/soap.svc?wsdl"; - $this->soapClient = new SoapClientWSSEC($wsdl_url, array_merge(static::$defaultSoapOptions, $soapOptions)); - } + $wsdl_url = "https://checkout.buckaroo.nl/soap/soap.svc?wsdl"; + $this->soapClient = new SoapClientWSSEC($wsdl_url, array_merge(static::$defaultSoapOptions, $soapOptions)); + } public function loadPem($filename) { @@ -47,7 +47,7 @@ public function loadPem($filename) public function setChannel($channel) { - $this->channel = $channel; + $this->channel = $channel; } public function sendRequest($TransactionRequest, $type) @@ -95,39 +95,42 @@ public function sendRequest($TransactionRequest, $type) $soapHeaders[] = new \SOAPHeader('https://checkout.buckaroo.nl/PaymentEngine/', 'MessageControlBlock', $Header->MessageControlBlock); $soapHeaders[] = new \SOAPHeader('http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd', 'Security', $Header->Security); $this->soapClient->__setSoapHeaders($soapHeaders); - - if ($this->testMode) { - $this->soapClient->__SetLocation('https://testcheckout.buckaroo.nl/soap/'); - } else { - $this->soapClient->__SetLocation('https://checkout.buckaroo.nl/soap/'); - } + + if ($this->testMode) { + $this->soapClient->__SetLocation('https://testcheckout.buckaroo.nl/soap/'); + } else { + $this->soapClient->__SetLocation('https://checkout.buckaroo.nl/soap/'); + } $return = array(); - switch($type) { - case 'invoiceinfo': + switch($type) { + case 'invoiceinfo': $return['result'] = $this->soapClient->InvoiceInfo($TransactionRequest); - break; - case 'transaction': - $return['result'] = $this->soapClient->TransactionRequest($TransactionRequest); - break; + break; + case 'transaction': + $return['result'] = $this->soapClient->TransactionRequest($TransactionRequest); + break; case 'transactionstatus': $return['result'] = $this->soapClient->TransactionStatus($TransactionRequest); break; - case 'refundinfo': + case 'refundinfo': $return['result'] = $this->soapClient->RefundInfo($TransactionRequest); - break; - } + break; + case 'data': + $return['result'] = $this->soapClient->DataRequest($TransactionRequest); + break; + } - $return['response'] = $this->soapClient->__getLastResponse(); - $return['request'] = $this->soapClient->__getLastRequest(); - return $return; - } + $return['response'] = $this->soapClient->__getLastResponse(); + $return['request'] = $this->soapClient->__getLastRequest(); + return $return; + } /** * @param boolean $testMode * @return Request */ - public function setTestMode($testMode) + public function setTestMode($testMode) { $this->testMode = $testMode; @@ -137,7 +140,7 @@ public function setTestMode($testMode) /** * @return boolean */ - public function getTestMode() + public function getTestMode() { return $this->testMode; } @@ -156,7 +159,7 @@ public function setCulture($culture) /** * @return string */ - public function getCulture() + public function getCulture() { return $this->culture; }