Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds option to configure authorization URL #11

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -76,6 +75,18 @@ if (!isset($_GET['code'])) {

```

### Set a custom `urlAuthorize`

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}',
'urlAuthorize' => 'https://connect.stripe.com/express/oauth/authorize',
]);
```

## Testing

``` bash
Expand All @@ -95,4 +106,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.
The MIT License (MIT). Please see [License File](https://github.com/adam-paterson/oauth2-stripe/blob/master/LICENSE) for more information.
7 changes: 6 additions & 1 deletion src/Provider/Stripe.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,19 @@ class Stripe extends AbstractProvider
{
use BearerAuthorizationTrait;

/**
* @var string
*/
public $urlAuthorize = 'https://connect.stripe.com/oauth/authorize';

/**
* Get authorization url to begin OAuth flow
*
* @return string
*/
public function getBaseAuthorizationUrl()
{
return 'https://connect.stripe.com/oauth/authorize';
return $this->urlAuthorize;
}

/**
Expand Down