/** * @return array|Data\Provider[] */ protected function getProviders() { $providersXml = $this->loadFixture('GetProviders.xml'); $providersResponse = new GetProvidersResponse(); QPayXMLParser::parseResponse($providersXml, $providersResponse); return $providersResponse->getProviders(); }
/** * @param ResponseInterface|null $response * * @throws ApiErrorHappenException */ public function __construct(ResponseInterface $response = null) { if ($response) { $this->setXml($response->getBody()->getContents()); $this->response = QPayXMLParser::parseResponse($this->getXml(), $this); //response with failure code always thrown a exception if ($this->getErrorCode() > 0) { throw new ApiErrorHappenException($this->getErrorMessage()); } } }