From 954248104ccde5a3d1b2aa66f4dbcbc92af81cce Mon Sep 17 00:00:00 2001 From: kennethormandy Date: Tue, 17 Dec 2019 19:51:21 -0800 Subject: [PATCH 1/4] Adds option to configure authorization URL --- README.md | 14 +++++++++++++- src/Provider/Stripe.php | 7 ++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e873321..653bfd5 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,18 @@ if (!isset($_GET['code'])) { ``` +### Set a custom `baseUrl` + +For example, this for use with Stripe Connect Express accounts: + +```php +$provider = new \AdamPaterson\OAuth2\Client\Provider\Stripe([ + 'clientId' => '{stripe-client-id}', + 'clientSecret' => '{stripe-client-secret}', + 'baseUrl' => 'https://connect.stripe.com/express/', +]); +``` + ## Testing ``` bash @@ -95,4 +107,4 @@ Please see [CONTRIBUTING](https://github.com/adam-paterson/oauth2-stripe/blob/ma ## License -The MIT License (MIT). Please see [License File](https://github.com/adam-paterson/oauth2-stripe/blob/master/LICENSE) for more information. \ No newline at end of file +The MIT License (MIT). Please see [License File](https://github.com/adam-paterson/oauth2-stripe/blob/master/LICENSE) for more information. diff --git a/src/Provider/Stripe.php b/src/Provider/Stripe.php index 0c6f6e0..767b821 100644 --- a/src/Provider/Stripe.php +++ b/src/Provider/Stripe.php @@ -13,6 +13,11 @@ class Stripe extends AbstractProvider { use BearerAuthorizationTrait; + /** + * @var string + */ + private $urlAuthorize = 'https://connect.stripe.com/oauth/authorize'; + /** * Get authorization url to begin OAuth flow * @@ -20,7 +25,7 @@ class Stripe extends AbstractProvider */ public function getBaseAuthorizationUrl() { - return 'https://connect.stripe.com/oauth/authorize'; + return $this->urlAuthorize; } /** From 8b380d4ef47cbd9672bb218db053fd5c393947df Mon Sep 17 00:00:00 2001 From: kennethormandy Date: Fri, 7 Feb 2020 14:41:25 -0800 Subject: [PATCH 2/4] Removes Travis HHVM build, per https://github.com/composer/composer/issues/8127 --- .travis.yml | 1 - README.md | 1 - 2 files changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6b1593b..a73161a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,6 @@ php: - 5.6 - 7.0 - 7.1 - - hhvm # This triggers builds to run on the new TravisCI infrastructure. # See: http://docs.travis-ci.com/user/workers/container-based-infrastructure/ diff --git a/README.md b/README.md index 653bfd5..b268fce 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ [![Latest Version](https://img.shields.io/github/release/adam-paterson/oauth2-stripe.svg?style=flat-square)](https://github.com/adam-paterson/oauth2-stripe/releases) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md) [![Build Status](https://img.shields.io/travis/adam-paterson/oauth2-stripe/master.svg?style=flat-square)](https://travis-ci.org/adam-paterson/oauth2-stripe) -[![HHVM Status](https://img.shields.io/hhvm/adam-paterson/oauth2-stripe.svg?style=flat-square)](http://hhvm.h4cc.de/package/adam-paterson/oauth2-stripe) [![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/adam-paterson/oauth2-stripe.svg?style=flat-square)](https://scrutinizer-ci.com/g/adam-paterson/oauth2-stripe/code-structure) [![Quality Score](https://img.shields.io/scrutinizer/g/adam-paterson/oauth2-stripe.svg?style=flat-square)](https://scrutinizer-ci.com/g/adam-paterson/oauth2-stripe) [![Dependency Status](https://img.shields.io/versioneye/d/php/adam-paterson:oauth2-stripe/1.1.2.svg?style=flat-square)](https://www.versioneye.com/php/adam-paterson:oauth2-stripe/1.1.2) From aeb3f7af68e68e462ec9186e907a50aeaa942453 Mon Sep 17 00:00:00 2001 From: kennethormandy Date: Fri, 7 Feb 2020 17:55:42 -0800 Subject: [PATCH 3/4] Fixes default to be public --- src/Provider/Stripe.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Provider/Stripe.php b/src/Provider/Stripe.php index 767b821..49b0b96 100644 --- a/src/Provider/Stripe.php +++ b/src/Provider/Stripe.php @@ -16,7 +16,7 @@ class Stripe extends AbstractProvider /** * @var string */ - private $urlAuthorize = 'https://connect.stripe.com/oauth/authorize'; + public $urlAuthorize = 'https://connect.stripe.com/oauth/authorize'; /** * Get authorization url to begin OAuth flow From d4422fb9e4bce60eb7abd5094456b851fd451bc1 Mon Sep 17 00:00:00 2001 From: kennethormandy Date: Fri, 7 Feb 2020 17:55:47 -0800 Subject: [PATCH 4/4] Fixes example in README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b268fce..3eb1610 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ if (!isset($_GET['code'])) { ``` -### Set a custom `baseUrl` +### Set a custom `urlAuthorize` For example, this for use with Stripe Connect Express accounts: @@ -83,7 +83,7 @@ For example, this for use with Stripe Connect Express accounts: $provider = new \AdamPaterson\OAuth2\Client\Provider\Stripe([ 'clientId' => '{stripe-client-id}', 'clientSecret' => '{stripe-client-secret}', - 'baseUrl' => 'https://connect.stripe.com/express/', + 'urlAuthorize' => 'https://connect.stripe.com/express/oauth/authorize', ]); ```