Update Stripe lib to 10.7.0

This commit is contained in:
Laurent Destailleur
2023-04-24 18:42:04 +02:00
parent 06f8291e07
commit 936512d0bb
256 changed files with 8077 additions and 2978 deletions

View File

@@ -12,6 +12,11 @@ abstract class AbstractService
*/
protected $client;
/**
* @var \Stripe\StripeStreamingClientInterface
*/
protected $streamingClient;
/**
* Initializes a new instance of the {@link AbstractService} class.
*
@@ -20,6 +25,7 @@ abstract class AbstractService
public function __construct($client)
{
$this->client = $client;
$this->streamingClient = $client;
}
/**
@@ -32,6 +38,16 @@ abstract class AbstractService
return $this->client;
}
/**
* Gets the client used by this service to send requests.
*
* @return \Stripe\StripeStreamingClientInterface
*/
public function getStreamingClient()
{
return $this->streamingClient;
}
/**
* Translate null values to empty strings. For service methods,
* we interpret null as a request to unset the field, which
@@ -59,11 +75,21 @@ abstract class AbstractService
return $this->getClient()->request($method, $path, static::formatParams($params), $opts);
}
protected function requestStream($method, $path, $readBodyChunkCallable, $params, $opts)
{
return $this->getStreamingClient()->requestStream($method, $path, $readBodyChunkCallable, static::formatParams($params), $opts);
}
protected function requestCollection($method, $path, $params, $opts)
{
return $this->getClient()->requestCollection($method, $path, static::formatParams($params), $opts);
}
protected function requestSearchResult($method, $path, $params, $opts)
{
return $this->getClient()->requestSearchResult($method, $path, static::formatParams($params), $opts);
}
protected function buildPath($basePath, ...$ids)
{
foreach ($ids as $id) {