/** * @param string $operation * @param TpMerchantConfig $config * @param TpDataApiRequest $request * @return TpDataApiResponse * @throws TpSoapException */ protected static function call($operation, TpMerchantConfig $config, TpDataApiRequest $request) { try { $options = array('features' => SOAP_SINGLE_ELEMENT_ARRAYS); $client = new SoapClient($config->dataWebServicesWsdl, $options); $signed = $request->toSignedSoapRequestArray(); $rawResponse = $client->{$operation}($signed); } catch (SoapFault $e) { throw new TpSoapException($e->getMessage()); } $response = TpDataApiResponseFactory::getResponse($operation, $config, $rawResponse); return $response; }
/** * @return array */ protected function configArray() { $configArray = parent::configArray(); $configArray['accountId'] = $this->_config->accountId; return $configArray; }