From 9f7521e0ec46fd9ad798b8cc72a971d8821ac398 Mon Sep 17 00:00:00 2001 From: Jason Hee Date: Mon, 26 Oct 2020 21:03:45 +0800 Subject: [PATCH] Allow one to specify timeout options when constructing PaymentClient --- src/PaymentClient.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/PaymentClient.php b/src/PaymentClient.php index 026eb73..8fff77f 100644 --- a/src/PaymentClient.php +++ b/src/PaymentClient.php @@ -59,7 +59,10 @@ public function __construct(array $context = null) }else{ $this->context = new ClientContext(); } - $this->httpClient = ClientFactory::buildCurlClient(); + $this->httpClient = ClientFactory::buildCurlClient( + $context['connection_time_out'] ?? 10, + $context['request_time_out'] ?? 100 + ); $this->interceptors = array(); }