예제 #1
0
파일: Manager.php 프로젝트: gpupo/stelo-sdk
 protected function factoryFromCreateResponse(Response $response)
 {
     $dataRaw = $response->getData();
     $linkList = [];
     foreach ($dataRaw->getLink() as $link) {
         $linkList[$link['@rel']] = $link['@href'];
     }
     $data = ['id' => current($dataRaw->getOrderData()), 'checkoutUrl' => $linkList['urlWallet']];
     return new Transaction($data);
 }
예제 #2
0
파일: Manager.php 프로젝트: gpupo/adyen-sdk
 protected function processExecute(Request $request, Response $response)
 {
     if (300 > $response->getHttpStatusCode()) {
         $decorator = $this->resolveDecorator($request);
     } else {
         $decorator = $this->getFullyQualifiedDecoratorName('ProblematicDecorator');
     }
     $data = $response->getData()->toArray();
     $instance = new $decorator($data);
     $instance->setCode($response->getHttpStatusCode());
     return $instance;
 }
예제 #3
0
 /**
  * Executa a chamada http.
  *
  * @param Request $request Objeto com a requisição
  *
  * @return Response Objeto com a resposta da requisição
  */
 protected function exec(Request $request)
 {
     try {
         $data = $request->exec();
         $response = new Response($data);
         $response->setLogger($this->getLogger());
         $response->validate();
         $this->debug('Client Execution', ['request' => $request->toLog(), 'response' => $response->toLog()]);
         return $response;
     } catch (RequestException $e) {
         $this->error('Execucao fracassada', ['exception' => $e->toLog(), 'request' => $request->toLog()]);
         throw $e;
     }
 }
예제 #4
0
 protected function factoryCustomer(Response $response)
 {
     $data = $response->getData()->toArray();
     return new Customer($data);
 }
예제 #5
0
 protected function processResponse(Response $response)
 {
     return $response->getData();
 }