-
Notifications
You must be signed in to change notification settings - Fork 850
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add streaming methods to Service infra (#1155)
- Loading branch information
1 parent
8a5a311
commit 33317c9
Showing
12 changed files
with
258 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
namespace Stripe; | ||
|
||
/** | ||
* Interface for a Stripe client. | ||
*/ | ||
interface BaseStripeClientInterface | ||
{ | ||
/** | ||
* Gets the API key used by the client to send requests. | ||
* | ||
* @return null|string the API key used by the client to send requests | ||
*/ | ||
public function getApiKey(); | ||
|
||
/** | ||
* Gets the client ID used by the client in OAuth requests. | ||
* | ||
* @return null|string the client ID used by the client in OAuth requests | ||
*/ | ||
public function getClientId(); | ||
|
||
/** | ||
* Gets the base URL for Stripe's API. | ||
* | ||
* @return string the base URL for Stripe's API | ||
*/ | ||
public function getApiBase(); | ||
|
||
/** | ||
* Gets the base URL for Stripe's OAuth API. | ||
* | ||
* @return string the base URL for Stripe's OAuth API | ||
*/ | ||
public function getConnectBase(); | ||
|
||
/** | ||
* Gets the base URL for Stripe's Files API. | ||
* | ||
* @return string the base URL for Stripe's Files API | ||
*/ | ||
public function getFilesBase(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace Stripe\HttpClient; | ||
|
||
interface StreamingClientInterface | ||
{ | ||
/** | ||
* @param string $method The HTTP method being used | ||
* @param string $absUrl The URL being requested, including domain and protocol | ||
* @param array $headers Headers to be used in the request (full strings, not KV pairs) | ||
* @param array $params KV pairs for parameters. Can be nested for arrays and hashes | ||
* @param bool $hasFile Whether or not $params references a file (via an @ prefix or | ||
* CURLFile) | ||
* @param callable $readBodyChunkCallable a function that will be called with chunks of bytes from the body if the request is successful | ||
* | ||
* @throws \Stripe\Exception\ApiConnectionException | ||
* @throws \Stripe\Exception\UnexpectedValueException | ||
* | ||
* @return array an array whose first element is raw request body, second | ||
* element is HTTP status code and third array of HTTP headers | ||
*/ | ||
public function requestStream($method, $absUrl, $headers, $params, $hasFile, $readBodyChunkCallable); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace Stripe; | ||
|
||
/** | ||
* Interface for a Stripe client. | ||
*/ | ||
interface StripeStreamingClientInterface extends BaseStripeClientInterface | ||
{ | ||
public function requestStream($method, $path, $readBodyChunkCallable, $params, $opts); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.