goldendeveloper / paypal
Laravel Socialite 的 PayPal OAuth2 提供者
1.0
2022-08-11 14:30 UTC
Requires
- php: ^7.4 || ^8.0
- ext-json: *
- socialiteproviders/manager: ~4.0
README
composer require goldendeveloper/paypal
安装与基本用法
请参阅基本安装指南,然后按照以下特定提供者的说明操作。
将配置添加到 config/services.php
'paypal' => [ 'client_id' => env('PAYPAL_CLIENT_ID'), 'client_secret' => env('PAYPAL_CLIENT_SECRET'), 'redirect' => env('PAYPAL_REDIRECT_URI') ],
添加提供者事件监听器
配置包的监听器以监听 SocialiteWasCalled 事件。
将事件添加到您的 app/Providers/EventServiceProvider 中的 listen[] 数组。有关详细说明,请参阅基本安装指南。
protected $listen = [ \SocialiteProviders\Manager\SocialiteWasCalled::class => [ // ... other providers \GoldenDeveloper\PayPal\PayPalExtendSocialite::class.'@handle', ], ];
用法
现在您应该能够像通常使用 Socialite 一样使用此提供者(假设您已安装 facade)
return Socialite::driver('paypal')->redirect();
返回的用户字段
idnameemail