Download the PHP package alofoxx/oauth2-gumroad without Composer
On this page you can find all versions of the php package alofoxx/oauth2-gumroad. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alofoxx/oauth2-gumroad
More information about alofoxx/oauth2-gumroad
Files in alofoxx/oauth2-gumroad
Package oauth2-gumroad
Short Description Gumroad OAuth 2.0 Client Provider for The PHP League OAuth2-Client
License MIT
Informations about the package oauth2-gumroad
Gumroad Provider for OAuth 2.0 Client
This package provides Gumroad OAuth 2.0 support for the PHP League's OAuth 2.0 Client, v2.0 and up.
Requirements
The following versions of PHP are supported.
- PHP 7.1
- PHP 7.2
- PHP 7.3
- PHP 7.4
Installation
To install, use composer:
Usage
Usage is the same as The League's OAuth client, using \Alofoxx\OAuth2\Client\Provider\Gumroad
as the provider.
Sample Authorization Code Flow
This self-contained example:
- Gets an authorization code
- Gets an access token using the provided authorization code
- Looks up the user's profile with the provided access token
You can try this script by registering a Gumroad Application with a redirect URI to your server's copy of this sample script. Then, place the Gumroad app's application id and secret, along with that same URI, into the settings at the top of the script.
Managing Scopes
When creating your Gumroad authorization URL in Step 1, you can specify the state and scopes your application may authorize.
If neither are defined, the provider will utilize internal default of view_sales
.
At the time of authoring this documentation, the following scopes are available:
edit_products
view_sales
mark_sales_as_shipped
refund_sales
Refreshing a Token
You can refresh an expired token using a refresh token rather than going through the entire process of obtaining a brand new token. To do so, simply reuse the fresh token from your data store to request a refresh:
Testing
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.