From 75160b12821f7f4299cce7f0b69c83c1502ae071 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Mon, 27 May 2024 13:08:29 +0200 Subject: 2024-02-19 upstream --- vendor/stripe/stripe-php/lib/OAuth.php | 202 ++++++++++++++++----------------- 1 file changed, 101 insertions(+), 101 deletions(-) (limited to 'vendor/stripe/stripe-php/lib/OAuth.php') diff --git a/vendor/stripe/stripe-php/lib/OAuth.php b/vendor/stripe/stripe-php/lib/OAuth.php index 7b0886e..71deeae 100644 --- a/vendor/stripe/stripe-php/lib/OAuth.php +++ b/vendor/stripe/stripe-php/lib/OAuth.php @@ -1,101 +1,101 @@ -request( - 'post', - '/oauth/token', - $params, - null - ); - - return Util\Util::convertToStripeObject($response->json, $opts); - } - - /** - * Disconnects an account from your platform. - * - * @param null|array $params - * @param null|array $opts - * - * @throws \Stripe\Exception\OAuth\OAuthErrorException if the request fails - * - * @return StripeObject object containing the response from the API - */ - public static function deauthorize($params = null, $opts = null) - { - $params = $params ?: []; - $base = ($opts && \array_key_exists('connect_base', $opts)) ? $opts['connect_base'] : Stripe::$connectBase; - $requestor = new ApiRequestor(null, $base); - $params['client_id'] = self::_getClientId($params); - list($response, $apiKey) = $requestor->request( - 'post', - '/oauth/deauthorize', - $params, - null - ); - - return Util\Util::convertToStripeObject($response->json, $opts); - } - - private static function _getClientId($params = null) - { - $clientId = ($params && \array_key_exists('client_id', $params)) ? $params['client_id'] : null; - if (null === $clientId) { - $clientId = Stripe::getClientId(); - } - if (null === $clientId) { - $msg = 'No client_id provided. (HINT: set your client_id using ' - . '"Stripe::setClientId()". You can find your client_ids ' - . 'in your Stripe dashboard at ' - . 'https://dashboard.stripe.com/account/applications/settings, ' - . 'after registering your account as a platform. See ' - . 'https://stripe.com/docs/connect/standard-accounts for details, ' - . 'or email support@stripe.com if you have any questions.'; - - throw new Exception\AuthenticationException($msg); - } - - return $clientId; - } -} +request( + 'post', + '/oauth/token', + $params, + null + ); + + return Util\Util::convertToStripeObject($response->json, $opts); + } + + /** + * Disconnects an account from your platform. + * + * @param null|array $params + * @param null|array $opts + * + * @throws \Stripe\Exception\OAuth\OAuthErrorException if the request fails + * + * @return StripeObject object containing the response from the API + */ + public static function deauthorize($params = null, $opts = null) + { + $params = $params ?: []; + $base = ($opts && \array_key_exists('connect_base', $opts)) ? $opts['connect_base'] : Stripe::$connectBase; + $requestor = new ApiRequestor(null, $base); + $params['client_id'] = self::_getClientId($params); + list($response, $apiKey) = $requestor->request( + 'post', + '/oauth/deauthorize', + $params, + null + ); + + return Util\Util::convertToStripeObject($response->json, $opts); + } + + private static function _getClientId($params = null) + { + $clientId = ($params && \array_key_exists('client_id', $params)) ? $params['client_id'] : null; + if (null === $clientId) { + $clientId = Stripe::getClientId(); + } + if (null === $clientId) { + $msg = 'No client_id provided. (HINT: set your client_id using ' + . '"Stripe::setClientId()". You can find your client_ids ' + . 'in your Stripe dashboard at ' + . 'https://dashboard.stripe.com/account/applications/settings, ' + . 'after registering your account as a platform. See ' + . 'https://stripe.com/docs/connect/standard-accounts for details, ' + . 'or email support@stripe.com if you have any questions.'; + + throw new Exception\AuthenticationException($msg); + } + + return $clientId; + } +} -- cgit v1.2.3