-
Notifications
You must be signed in to change notification settings - Fork 848
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3a95278
commit 75d25f8
Showing
10 changed files
with
212 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v146 |
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,78 @@ | ||
<?php | ||
|
||
// File generated from our OpenAPI spec | ||
|
||
namespace Stripe\Apps; | ||
|
||
/** | ||
* Secret Store is an API that allows Stripe Apps developers to securely persist | ||
* secrets for use by UI Extensions and app backends. | ||
* | ||
* The primary resource in Secret Store is a <code>secret</code>. Other apps can't | ||
* view secrets created by an app. Additionally, secrets are scoped to provide | ||
* further permission control. | ||
* | ||
* All Dashboard users and the app backend share <code>account</code> scoped | ||
* secrets. Use the <code>account</code> scope for secrets that don't change | ||
* per-user, like a third-party API key. | ||
* | ||
* A <code>user</code> scoped secret is accessible by the app backend and one | ||
* specific Dashboard user. Use the <code>user</code> scope for per-user secrets | ||
* like per-user OAuth tokens, where different users might have different | ||
* permissions. | ||
* | ||
* Related guide: <a | ||
* href="https://stripe.com/docs/stripe-apps/store-auth-data-custom-objects">Store | ||
* data between page reloads</a>. | ||
* | ||
* @property string $id Unique identifier for the object. | ||
* @property string $object String representing the object's type. Objects of the same type share the same value. | ||
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. | ||
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode. | ||
* @property string $name A name for the secret that's unique within the scope. | ||
* @property null|string $payload The plaintext secret value to be stored. | ||
* @property \Stripe\StripeObject $scope | ||
*/ | ||
class Secret extends \Stripe\ApiResource | ||
{ | ||
const OBJECT_NAME = 'apps.secret'; | ||
|
||
use \Stripe\ApiOperations\All; | ||
use \Stripe\ApiOperations\Create; | ||
|
||
/** | ||
* @param null|array $params | ||
* @param null|array|string $opts | ||
* | ||
* @throws \Stripe\Exception\ApiErrorException if the request fails | ||
* | ||
* @return \Stripe\Apps\Secret the deleted secret | ||
*/ | ||
public static function deleteWhere($params = null, $opts = null) | ||
{ | ||
$url = static::classUrl() . '/delete'; | ||
list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); | ||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); | ||
$obj->setLastResponse($response); | ||
|
||
return $obj; | ||
} | ||
|
||
/** | ||
* @param null|array $params | ||
* @param null|array|string $opts | ||
* | ||
* @throws \Stripe\Exception\ApiErrorException if the request fails | ||
* | ||
* @return \Stripe\Apps\Secret the finded secret | ||
*/ | ||
public static function find($params = null, $opts = null) | ||
{ | ||
$url = static::classUrl() . '/find'; | ||
list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); | ||
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); | ||
$obj->setLastResponse($response); | ||
|
||
return $obj; | ||
} | ||
} |
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,25 @@ | ||
<?php | ||
|
||
// File generated from our OpenAPI spec | ||
|
||
namespace Stripe\Service\Apps; | ||
|
||
/** | ||
* Service factory class for API resources in the Apps namespace. | ||
* | ||
* @property SecretService $secrets | ||
*/ | ||
class AppsServiceFactory extends \Stripe\Service\AbstractServiceFactory | ||
{ | ||
/** | ||
* @var array<string, string> | ||
*/ | ||
private static $classMap = [ | ||
'secrets' => SecretService::class, | ||
]; | ||
|
||
protected function getServiceClass($name) | ||
{ | ||
return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; | ||
} | ||
} |
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,68 @@ | ||
<?php | ||
|
||
// File generated from our OpenAPI spec | ||
|
||
namespace Stripe\Service\Apps; | ||
|
||
class SecretService extends \Stripe\Service\AbstractService | ||
{ | ||
/** | ||
* List all secrets stored on the given scope. | ||
* | ||
* @param null|array $params | ||
* @param null|array|\Stripe\Util\RequestOptions $opts | ||
* | ||
* @throws \Stripe\Exception\ApiErrorException if the request fails | ||
* | ||
* @return \Stripe\Collection<\Stripe\Apps\Secret> | ||
*/ | ||
public function all($params = null, $opts = null) | ||
{ | ||
return $this->requestCollection('get', '/v1/apps/secrets', $params, $opts); | ||
} | ||
|
||
/** | ||
* Create or replace a secret in the secret store. | ||
* | ||
* @param null|array $params | ||
* @param null|array|\Stripe\Util\RequestOptions $opts | ||
* | ||
* @throws \Stripe\Exception\ApiErrorException if the request fails | ||
* | ||
* @return \Stripe\Apps\Secret | ||
*/ | ||
public function create($params = null, $opts = null) | ||
{ | ||
return $this->request('post', '/v1/apps/secrets', $params, $opts); | ||
} | ||
|
||
/** | ||
* Deletes a secret from the secret store by name and scope. | ||
* | ||
* @param null|array $params | ||
* @param null|array|\Stripe\Util\RequestOptions $opts | ||
* | ||
* @throws \Stripe\Exception\ApiErrorException if the request fails | ||
* | ||
* @return \Stripe\Apps\Secret | ||
*/ | ||
public function deleteWhere($params = null, $opts = null) | ||
{ | ||
return $this->request('post', '/v1/apps/secrets/delete', $params, $opts); | ||
} | ||
|
||
/** | ||
* Finds a secret in the secret store by name and scope. | ||
* | ||
* @param null|array $params | ||
* @param null|array|\Stripe\Util\RequestOptions $opts | ||
* | ||
* @throws \Stripe\Exception\ApiErrorException if the request fails | ||
* | ||
* @return \Stripe\Apps\Secret | ||
*/ | ||
public function find($params = null, $opts = null) | ||
{ | ||
return $this->request('get', '/v1/apps/secrets/find', $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
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