diff --git a/src/OAuth/OAuth2Authenticator.php b/src/OAuth/OAuth2Authenticator.php index 23f1680..101bf4f 100644 --- a/src/OAuth/OAuth2Authenticator.php +++ b/src/OAuth/OAuth2Authenticator.php @@ -268,7 +268,7 @@ private function generateQueryParemeterStringForAuthorizationCodeURL() : string 'response_type' => 'code', 'state' => $this->getState() ); - return http_build_query($parameters, null, '&', PHP_QUERY_RFC3986); + return http_build_query($parameters, '', '&', PHP_QUERY_RFC3986); } public function setState($state) diff --git a/src/PaymentClient.php b/src/PaymentClient.php index 026eb73..b102a44 100644 --- a/src/PaymentClient.php +++ b/src/PaymentClient.php @@ -59,7 +59,11 @@ public function __construct(array $context = null) }else{ $this->context = new ClientContext(); } - $this->httpClient = ClientFactory::buildCurlClient(); + $this->httpClient = ClientFactory::buildCurlClient( + isset($context['connection_time_out']) ? $context['connection_time_out'] : 10, + isset($context['request_time_out']) ? $context['request_time_out'] : 100, + isset($context['is_verify']) ? $context['is_verify'] : false + ); $this->interceptors = array(); } @@ -92,7 +96,6 @@ public function charge(Charge $charge, string $requestId = "") : ResponseInterfa } $request = ChargeOperations::createChargeRequest($charge, $requestId, $this->getContext()); - $response = $this->httpClient->send($request); $this->before($request, $this); $response = $this->httpClient->send($request); $this->after($response, $this); @@ -107,7 +110,6 @@ public function voidChargeTransaction(string $chargeRequestId, string $requestId } $request = ChargeOperations::voidTransaction($chargeRequestId, $requestId, $this->getContext()); - $this->httpClient->send($request); $this->before($request, $this); $response = $this->httpClient->send($request); $this->after($response, $this);