public function echoOutput($dataProviderIndex, Request $request, Response $response = null)
 {
     if ($this->isOutput) {
         echo "\r\n-- " . strtoupper($dataProviderIndex . " " . $request->getOperation()) . " " . str_repeat("-", 80 - (4 + strlen($dataProviderIndex . " " . $request->getOperation()))) . "\r\n";
         echo "Request Details: " . json_encode($request->all(), JSON_PRETTY_PRINT) . "\r\n";
         if (!is_null($response)) {
             echo "Response Details: \r\nStatus: " . $response->getHttpResponseStatus() . "  Resaon: " . $response->getHttpResponseReason() . "\r\nSignature Validation Results: " . json_encode($response->getSignatureViladtionResults(), JSON_PRETTY_PRINT) . "\r\nResults: " . json_encode($response->all(), JSON_PRETTY_PRINT) . "\r\n";
         }
     }
 }
Ejemplo n.º 2
0
 /**
  * @param Request $request
  * @return array $httpResponseHeader, $rawResponseData, $decodeResponseData
  */
 protected function makeHttpClientCall(Request $request)
 {
     //function broken out for testing (mock this method)
     return list($httpResponseHeader, $rawResponseData) = Httpclient\CurlClient::postRequest($this->endpoint . '/' . $request->getOperation(), $request->all());
 }