@@ -44,7 +44,7 @@ final class Curl implements GatewayInterface
4444 public const MAXREDIRS = CURLOPT_MAXREDIRS ;
4545 public const ENCODING = CURLOPT_ENCODING ;
4646 public const USERAGENT = CURLOPT_USERAGENT ;
47- public const HTTP_VERSION = CURLOPT_HTTP_VERSION ;
47+ // public const HTTP_VERSION = CURLOPT_HTTP_VERSION;
4848
4949 /**
5050 * @access private
@@ -428,7 +428,7 @@ public static function request(string $url, array $params = []) : array
428428 // Set options
429429 self ::setHeader ($ handle , $ header );
430430 self ::setTimeout ($ handle , $ timeout );
431- self ::setOpt ($ handle , self ::HTTP_VERSION , CURL_HTTP_VERSION_1_1 );
431+ // self::setOpt($handle, self::HTTP_VERSION, CURL_HTTP_VERSION_1_1);
432432
433433 if ( $ encoding ) {
434434 self ::setEncoding ($ handle , $ encoding );
@@ -443,6 +443,9 @@ public static function request(string $url, array $params = []) : array
443443 self ::verifyPeer ($ handle , false );
444444 }
445445
446+ // Force HTTP/1.1 to avoid HTTP/2 stream protocol errors
447+ self ::setOpt ($ handle , CURLOPT_HTTP_VERSION , CURL_HTTP_VERSION_1_1 );
448+
446449 if ( $ method == Client::POST ) {
447450 self ::setPost ($ handle );
448451 self ::setPostData ($ handle , $ body );
0 commit comments