Download the PHP package kagurati/patreon without Composer
On this page you can find all versions of the php package kagurati/patreon. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kagurati/patreon
More information about kagurati/patreon
Files in kagurati/patreon
Package patreon
Short Description Interact with the Patreon API via OAuth.
License MIT
Informations about the package patreon
patreon-php
This is Zanaras's fork of the Patreon-PHP library, which facilitates interacting with the Patreon API via OAuth.
Differences from Patreon/patreon-php
This code has been modified in several ways but should be hot-swap capable with Patreon/patreon-php version 1.0.0.
In particular, it removes an unused variable on the OAuth.php refreshtoken function, allows passing cache arguments through the API.php fetch* functions, allows setting API functions on class instantiation, and streamlines a few conditional arguments in the API.
Important notice about updating to 1.0.0 from earlier versions
Patreon PHP library version 1.0.0 moves on to Patreon's v2 API, which is not compatible with old v1 calls. It also removes Art4 JSON library. Therefore directly upgrading from older versions to 1.0.0 would break compatibility of your installation. APIv1 will deprecated some time soon after APIv2 come out of beta, so its important to get your integration compatible with API v2. With API v2, you can only get access to the scopes you requested during authorization, and you need to ask for the data you want through includes.
If you were using Art4 library before, you can separately install it and feed the return from API calls to Art4 library after getting it as JSON from this library. This will make your existing code that uses Art4 library compatible. However note that you will need to track Art4 library updates and resulting compatibility issues yourself.
https://docs.patreon.com/#apiv2-oauth
NOTE: This library is made to be compatible with the maximum possible variety of different infrastructures, PHP versions and environments in order to cover a majority of potential integrations. If you would like to use more specialized versions of this lib with different amenities and additions/dependencies to better suit your environment, below is a list. If you would like your fork added to this list, please contact us at the forums.
soatok's fork with PHP 7.x, PHPunit, Psalm, BLAKE2b instead of MD5
Installation
php composer.phar require kagurati/patreon
Usage
Step 1. Get your client_id and client_secret
Visit the Patreon platform documentation page while logged in as a Patreon creator to register your client.
This will provide you with a client_id
and a client_secret
.
Step 2. Use this plugin in your code
Let's say you wanted to make a "Log In with Patreon" button.
You've read through the directions, and are trying to implement "Step 2: Handling the OAuth Redirect" with your server.
The user will be arriving at one of your pages after you have sent them to [the authorize page] (www.patreon.com/oauth2/authorize) for step 1, so in their query parameters landing on this page, they will have a parameter 'code'
.
(If you are doing something other than the "Log In with Patreon" flow, please see the examples folder for more examples)
(Especially the unified flow is a great way to have users unlock locked features or content at your site or app - it allows users to register, login, pledge and return to your app in one smooth unified flow. Check it out in the examples folder )