public function convertToStdClass(CybersourceSOAPModel $request) { $contextOpts = ['http' => ['timeout' => $this->timeout]]; $context = stream_context_create($contextOpts); $soapOts = ['compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | SOAP_COMPRESSION_DEFLATE, 'encoding' => 'utf-8', 'exceptions' => true, 'connection_timeout' => $this->timeout, 'stream_context' => $context, 'cache_wsdl' => WSDL_CACHE_MEMORY]; try { $this->soapClient = $this->clientFactory->getInstance($soapOts); } catch (\SoapFault $sf) { throw new CybersourceConnectionException($sf->getMessage(), $sf->getCode()); } $this->soapClient->addWSSEToken(); return $request->toStdObject(); }
public function testGetInstanceReturnsSoapClient() { $client = $this->factory->getInstance(); $this->assertInstanceOf('Credibility\\LaravelCybersource\\SOAPClient', $client); }
/** * Static getInstance Method for updating SOAP options * @param array $options * @return SOAPClient */ public static function getInstance(array $options = []) { $factory = new SOAPClientFactory(static::$app); return $factory->getInstance($options); }