-
Notifications
You must be signed in to change notification settings - Fork 858
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
Add OAuthService #964
Add OAuthService #964
Conversation
aa89bfd
to
1e70240
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer if the requestConnect
stuff was kept inside OAuthService
, since it's OAuth specific and very unlikely to be used by any other services in future.
d48c5f2
to
11c7a38
Compare
ptal @ob-stripe -- I've addressed all your comments & moved 'connectRequest' out into OAuthService. Thanks for the careful review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more comments, but this is looking great already
8eb8095
to
5305de9
Compare
ptal @ob-stripe
|
lib/Service/OAuthService.php
Outdated
// Throw an exception for the convenience of anybody migrating to | ||
// \Stripe\Service\OAuthService from \Stripe\OAuth, where `connect_base` | ||
// was the name of the parameter that behaves as `api_base` does here. | ||
if (isset($opts->connect_base)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this will work. \Stripe\RequestOptions
does not have a connect_base
property, even if there is a connect_base
key in the array passed to RequestOptions::parse()
, so I think this condition will always be false. Mind adding a test for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops! Good catch. Fixed now.
ptal @ob-stripe fixed the $opts['connect_base'] check and added docblocks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
r? @ob-stripe
cc @stripe/api-libraries
Fixes #958 and adds
$stripe->oauth
withauthorizeUrl
,token
, anddeauthorize
methods.I chose to introduce
->requestConnect
into the StripeClientInterface, rather than overload->request
, because to my intuition this seems cleaner, but I'm interested in second opinions.