public function sendData($data)
 {
     // don't throw exceptions for 4xx errors
     $this->httpClient->getEventDispatcher()->addListener('request.error', function ($event) {
         if ($event['response']->isClientError()) {
             $event->stopPropagation();
         }
     });
     $httpRequest = $this->httpClient->post($this->getEndpoint() . '/api/v1/confirm', array('Accept' => 'application/json'), Gateway::generateQueryString($data));
     $httpResponse = $httpRequest->setAuth($this->getAppId(), $this->getAppSecret())->send();
     return $this->response = new CompletePurchaseResponse($this, $httpResponse->json(), $this->httpRequest->get('resource_id'));
 }
Пример #2
0
 public function sendData($data)
 {
     $httpRequest = $this->httpClient->post($this->getEndpoint() . '/api/v1/bills', array('Accept' => 'application/json'), Gateway::generateQueryString($data));
     $httpResponse = $httpRequest->setHeader('Authorization', 'bearer ' . $this->getAccessToken())->send();
     return $this->response = new CaptureResponse($this, $httpResponse->json());
 }
 public function send()
 {
     $httpRequest = $this->httpClient->post($this->getEndpoint() . '/api/v1/confirm', array('Accept' => 'application/json'), Gateway::generateQueryString($this->getData()));
     $httpResponse = $httpRequest->setAuth($this->getAppId(), $this->getAppSecret())->send();
     return $this->response = new CompletePurchaseResponse($this, $httpResponse->json(), $this->httpRequest->get('resource_id'));
 }
Пример #4
0
 public function getRedirectUrl()
 {
     return $this->getRequest()->getEndpoint() . '/connect/pre_authorizations/new?' . Gateway::generateQueryString($this->data);
 }
Пример #5
0
 /**
  * Generate a signature for the data array
  */
 public function generateSignature($data)
 {
     return hash_hmac('sha256', Gateway::generateQueryString($data), $this->getAppSecret());
 }