Makes an HTTP POST request to verification endpoint

@param array $data  data to be sent to endpoint
@return object  verification response
@throws \browserid\Exception
516904
protected function _post($data) {
		$ch = curl_init();
		curl_setopt_array($ch, array(
			CURLOPT_URL            => static::ENDPOINT,
			CURLOPT_POST           => true,
			CURLOPT_POSTFIELDS     => json_encode($data),
			CURLOPT_HEADER         => false,
			CURLOPT_RETURNTRANSFER => true,
			CURLOPT_SSL_VERIFYPEER => true,
			CURLOPT_SSL_VERIFYHOST => 2,
			CURLOPT_FOLLOWLOCATION => false,
			CURLOPT_HTTPHEADER => array('Content-Type: application/json')
		));

		$response = curl_exec($ch);
		curl_close($ch);

		if ($response === false) {
			throw new Exception('Failed to contact BrowserID verification service');
		}

		$decodedResponse = json_decode($response);
		if (!$decodedResponse) {
			throw new Exception('Response is not valid JSON');
		}

		return $decodedResponse;
	}
412714
public function verifySignature(array $data)
    {
        $signedData = array_intersect_key($data, array_flip(self::$validResponseParams));
        ksort($signedData);

        $queryString = $this->buildQueryString($signedData);
        $signature = base64_encode(hash_hmac('sha1', $queryString, $this->clientSecret, true));

        return hash_equals($signature, $data['h']);
    }
1289712
public function sendData ( $data )
	{
		
		// Test-API SSL cert issue
		$this->setSslVerification();
		
		$jsonData = json_encode( array( 
				'payment' => $data 
		) );
		
		$this->httpClient->setBaseUrl( $this->getUrl() . $this->endpoint . $this->getPaymentMethod() . '/payment/' );
		$request = $this->httpClient->post( null, null, $jsonData );
		$request->setAuth( $this->getMerchantId(), $this->getApiKey() );
		$request->setHeader( 'Content-type', 'application/json' );
		$request->addHeader( 'Accept', 'application/xml' );
		
		try {
			$httpResponse = $request->send();
		} catch ( BadResponseException $e ) {
			$e->getResponse()->getBody(1); // ugly; but else ->xml() will fail
			return new PurchaseResponse( $this, $e->getResponse()->xml() );
		}
		
		return new PurchaseResponse( $this, $httpResponse->xml() );
	}
210164
public function create(array $data)
    {
        $url = "https://api.weixin.qq.com/card/create?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, $data);
    }
133966
public function request(array $data) {
    // Create request
    $request = Loader::request($this->config, $data);
    // Return response
    return Loader::response(
      // Execute
      $this->getHttp()->post($this->getRequestUrl(), (string) $request)->json
      // Attach request
    )->attach('request', $request);
  }
582969
public function sendData($data)
    {
        $this->verifySignature();

        if ($this->params->has('notify_id')) {
            if ($this->verifyNotifyId) {
                $this->verifyNotifyId();
            }
        }

        return $this->response = new AopNotifyResponse($this, $data);
    }
688272
public function sendData($data)
    {
        $request = new AopNotifyRequest($this->httpClient, $this->httpRequest);
        $request->initialize($this->parameters->all());
        $request->setEndpoint($this->getEndpoint());
        $request->setParams($data);
        $request->setSort(false);
        $request->setEncodePolicy(Signer::ENCODE_POLICY_JSON);
        $request->setAlipayPublicKey($this->getAlipayPublicKey());

        /**
         * @var AopNotifyResponse $response
         */
        $response = $request->send();

        return $response;
    }
226611
public function post ($data)
		{
			$this->_options[ CURLOPT_POST ] = 1;
			$this->_options[ CURLOPT_POSTFIELDS ] = is_array($data) ? http_build_query($data) : $data;

			return $this->send();
		}
594328
public function sendData($data)
    {
        $httpResponse = $this->httpClient->post(
            $this->getEndpoint(),
            ['Content-Type' => 'text/xml; charset=utf-8'],
            $this->xmlSerialize($data)
        )->send();

        return $this->response = $this->newResponse( $httpResponse->xml() );
    }
536594
public static function createExisting($data)
    {
        $newRequest = new static($data);
        $newRequest->setId($data['id']);
        $newRequest->setExists(true);

        return $newRequest;
    }
226723
public function verify(array $data)
    {
        if (is_callable($this->callback)) {
            return call_user_func($this->callback, $data);
        }

        return false;
    }
684026
public function sendData($data)
    {
        $this->httpClient->setConfig([
            'curl.options' => [
                CURLOPT_SSLVERSION => 1,
                CURLOPT_SSL_VERIFYHOST => 2,
                CURLOPT_SSL_VERIFYPEER => 1,
            ],
        ]);

        $httpResponse = $this->httpClient->post($this->getEndpoint(), null, $data)->send();
        $data['_result'] = $httpResponse->getBody(1);

        return $this->response = new CompletePurchaseResponse($this, $data);
    }
979479
public function requestIdn($data = array())
    {
        if (count($data) == 0) {
            $this->errorMessage[] = 'IDN DATA: EMPTY';
            return $this->nameData();
        }
        $data['MERCHANT'] = $this->merchantId;
        $this->refnoext = $data['REFNOEXT'];
        unset($data['REFNOEXT']);

        foreach ($this->hashFields as $fieldKey) {
            $data2[$fieldKey] = $data[$fieldKey];
        }
        $irnHash = $this->createHashString($data2);
        $data2['ORDER_HASH'] = $irnHash;
        $this->idnRequest = $data2;
        $this->logFunc("IDN", $this->idnRequest, $this->refnoext);

        $result = $this->startRequest($this->targetUrl, $this->idnRequest, 'POST');
        $this->debugMessage[] = 'IDN RESULT: ' . $result;

        if (is_string($result)) {
            $processed = $this->processResponse($result);
            $this->logFunc("IDN", $processed, $this->refnoext);
            return     $processed;
        }
        $this->debugMessage[] = 'IDN RESULT: NOT STRING';
        return false;
    }
834822
public function create($data)
    {
        $authService = $this->options->getAuthenticationService();

        if ($authService->hasIdentity()) {
            $authService->logout();
        }

        $result = $authService->login(
            $data[$this->options->getDataUsernameKey()],
            $data[$this->options->getDataPasswordKey()],
            isset($data[$this->options->getDataRememberMeKey()]) ? $data[$this->options->getDataRememberMeKey()]: false
        );
        if (!$result->isValid()) {
            throw new Exception\LoginFailedException(implode('. ', $result->getMessages()));
        }

        $this->response->getHeaders()->addHeader(
            Location::fromString(
                'Location: ' . $this->request->getUri()->getPath()
            )
        );

        return $this->model->setVariables($this->options->getSerializer()->toArray($result->getIdentity()));
    }
1105132
protected function makeSignedRequest($data) {
    if (!is_array($data)) {
      throw new InvalidArgumentException(
        'makeSignedRequest expects an array. Got: ' . print_r($data, true));
    }
    $data['algorithm'] = self::SIGNED_REQUEST_ALGORITHM;
    $data['issued_at'] = time();
    $json = json_encode($data);
    $b64 = self::base64UrlEncode($json);
    $raw_sig = hash_hmac('sha256', $b64, $this->getAppSecret(), $raw = true);
    $sig = self::base64UrlEncode($raw_sig);
    return $sig.'.'.$b64;
  }
126723
protected function createPayload($data = '')
    {
        $payload = $this->setMeta($data, 'id', $this->getRandomId());

        return $this->setMeta($payload, 'attempts', 1);
    }
651735
public function sendData($data)
    {
        $endpoint = $this->getEndpoint();
        $headers = array(
            'Content-Type' => 'text/xml; charset=utf-8',
            'SOAPAction' => $endpoint.'/'.$this->getMethod(),
        );

        $httpResponse = $this->httpClient->post($endpoint, $headers, $data)->send();

        return $this->createResponse($httpResponse->xml());
    }