protected function execute ($method_name, $resource, $fields = [], $date = null, $nonce = null) {
    $url_encoded_fields = http_build_query($fields, null, "&");

    $headers = $this->generateTelesignHeaders(
      $this->customer_id,
      $this->api_key,
      $method_name,
      $resource,
      $url_encoded_fields,
      $date,
      $nonce,
      $this->user_agent
    );

    $option = in_array($method_name, [ "POST", "PUT" ]) ? "body" : "query";

    return new Response($this->client->request($method_name, $resource, [
      "headers" => $headers,
      $option => $url_encoded_fields,
      "http_errors" => false
    ]));
  }
protected function execute ($method_name, $resource, $fields = [], $date = null, $nonce = null) {
    $url_encoded_fields = http_build_query($fields, null, "&");

    $headers = $this->generateTelesignHeaders(
      $this->customer_id,
      $this->api_key,
      $method_name,
      $resource,
      $url_encoded_fields,
      $date,
      $nonce,
      $this->user_agent
    );

    $option = in_array($method_name, [ "POST", "PUT" ]) ? "body" : "query";

    return new Response($this->client->request($method_name, $resource, [
      "headers" => $headers,
      $option => $url_encoded_fields,
      "http_errors" => false
    ]));
  }
protected function execute ( $ method_name , $ resource , $ fields = [ ] , $ date = null , $ nonce = null ) { $ url_encoded_fields = http_build_query ( $ fields , null , "&" ) ; $ headers = $ this -> generateTelesignHeaders ( $ this -> customer_id , $ this -> api_key , $ method_name , $ resource , $ url_encoded_fields , $ date , $ nonce , $ this -> user_agent ) ; $ option = in_array ( $ method_name , [ "POST" , "PUT" ] ) ? "body" : "query" ; return new Response ( $ this -> client -> request ( $ method_name , $ resource , [ "headers" => $ headers , $ option => $ url_encoded_fields , "http_errors" => false ] ) ) ; }
Generic TeleSign REST API request handler

@param string $resource The partial resource URI to perform the request against
@param array  $fields   Body of query params to perform the HTTP request with
@param string $date     The date and time of the request
@param string $nonce    A unique cryptographic nonce for the request

@return \telesign\sdk\rest\Response The RestClient Response object
Generic TeleSign REST API request handler