mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-12 12:31:26 +01:00
Update Stripe lib to 10.7.0
This commit is contained in:
@@ -45,6 +45,21 @@ trait Request
|
||||
return [$resp->json, $options];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $method HTTP method ('get', 'post', etc.)
|
||||
* @param string $url URL for the request
|
||||
* @param callable $readBodyChunk function that will receive chunks of data from a successful request body
|
||||
* @param array $params list of parameters for the request
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
protected function _requestStream($method, $url, $readBodyChunk, $params = [], $options = null)
|
||||
{
|
||||
$opts = $this->_opts->merge($options);
|
||||
static::_staticStreamingRequest($method, $url, $readBodyChunk, $params, $opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $method HTTP method ('get', 'post', etc.)
|
||||
* @param string $url URL for the request
|
||||
@@ -65,4 +80,21 @@ trait Request
|
||||
|
||||
return [$response, $opts];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $method HTTP method ('get', 'post', etc.)
|
||||
* @param string $url URL for the request
|
||||
* @param callable $readBodyChunk function that will receive chunks of data from a successful request body
|
||||
* @param array $params list of parameters for the request
|
||||
* @param null|array|string $options
|
||||
*
|
||||
* @throws \Stripe\Exception\ApiErrorException if the request fails
|
||||
*/
|
||||
protected static function _staticStreamingRequest($method, $url, $readBodyChunk, $params, $options)
|
||||
{
|
||||
$opts = \Stripe\Util\RequestOptions::parse($options);
|
||||
$baseUrl = isset($opts->apiBase) ? $opts->apiBase : static::baseUrl();
|
||||
$requestor = new \Stripe\ApiRequestor($opts->apiKey, $baseUrl);
|
||||
$requestor->requestStream($method, $url, $readBodyChunk, $params, $opts->headers);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user