From 7f02c74676aec417c7a678e09a6dafeeb13c30a8 Mon Sep 17 00:00:00 2001 From: zhiqiang Date: Fri, 7 Jun 2024 14:40:49 +0800 Subject: [PATCH] docs: paypal --- README.md | 5 ++++- README_EN.md | 21 +++++++++++++++++++++ src/Providers/PayPal.php | 3 ++- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index daaf7ba..cf11299 100644 --- a/README.md +++ b/README.md @@ -466,7 +466,10 @@ $config = [ ### [PayPal](https://developer.paypal.com/docs/log-in-with-paypal/) -您需要额外配置 `team_url` 为您的团队域名,例如: +您可能需要设置responseType,可以使用`withResponseType`函数进行设置,默认是`code` 还可以设置为`id_token` 或`code` & `id_token` + +> https://developer.paypal.com/docs/log-in-with-paypal/integrate/generate-button/ + ```php $config = [ diff --git a/README_EN.md b/README_EN.md index c653435..0363c05 100644 --- a/README_EN.md +++ b/README_EN.md @@ -443,6 +443,26 @@ $config = [ ]; ``` +### [PayPal](https://developer.paypal.com/docs/log-in-with-paypal/) + +You may need to set the responseType, which can be set using the `withResponseType` function. The default is `code` and can also be set to `id_token` or `code` & `id_token` + +> https://developer.paypal.com/docs/log-in-with-paypal/integrate/generate-button/ + + +```php +$config = [ + 'paypal' => [ + 'client_id' => 'AT******************', + 'client_secret' => 'EK**************', + 'sandbox' => false, + 'redirect_url'=>"nativexo://paypalpay", + ], +]; +``` + + + ## Some Skill ### Scopes @@ -627,6 +647,7 @@ $user = $socialite->userFromToken($accessToken); - [Tapd - 用户授权说明](https://www.tapd.cn/help/show#1120003271001000093) - [Line - OAuth 2.0](https://developers.line.biz/en/docs/line-login/integrate-line-login/) - [Gitee - OAuth文档](https://gitee.com/api/v5/oauth_doc#/) +- [PayPal - OAuth文档](https://developer.paypal.com/docs/log-in-with-paypal/) [![Sponsor me](https://github.com/overtrue/overtrue/blob/master/sponsor-me.svg?raw=true)](https://github.com/sponsors/overtrue) diff --git a/src/Providers/PayPal.php b/src/Providers/PayPal.php index 5b46942..3ee65aa 100644 --- a/src/Providers/PayPal.php +++ b/src/Providers/PayPal.php @@ -46,8 +46,9 @@ public function __construct(array $config) } /** - * @param string|null $response_type + * @param string|null $responseType * @return $this + * @see https://developer.paypal.com/docs/log-in-with-paypal/integrate/generate-button/ */ public function withResponseType(?string $responseType) {