leonardjke/socialite-yoomoney

Laravel Socialite 的 Yoomoney OAuth2 提供者

0.1 2021-07-21 17:48 UTC

This package is auto-updated.

Last update: 2024-09-22 01:26:24 UTC


README

composer require leonardjke/socialite-yoomoney

安装与基本使用

请参阅基本安装指南,然后按照以下特定提供者的说明操作。

将配置添加到 config/services.php

'yoomoney' => [    
  'client_id' => env('YOOMONEY_CLIENT_ID'),  
  'client_secret' => env('YOOMONEY_CLIENT_SECRET'),  
  'redirect' => env('YOOMONEY_REDIRECT_URI') 
],

添加提供者事件监听器

配置包的监听器以监听 SocialiteWasCalled 事件。

将事件添加到 app/Providers/EventServiceProvider 中的 listen[] 数组。有关详细说明,请参阅基本安装指南

protected $listen = [
    \SocialiteProviders\Manager\SocialiteWasCalled::class => [
        // ... other providers
        'SocialiteProviders\\Yoomoney\\YoomoneyExtendSocialite@handle',
    ],
];

使用方法

现在您应该能够像通常使用 Socialite 一样使用此提供者(假设您已安装了外观)

return Socialite::driver('yoomoney')->redirect();

返回的用户字段

  • id
  • 昵称