You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-6Lines changed: 4 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,8 +24,7 @@ Currently the repo at packagist is at 0.3.x and API v1 only, whereas the one at
24
24
25
25
### Step 1. Get your client_id and client_secret
26
26
27
-
Visit the [Patreon platform documentation page](https://www.patreon.com/platform/documentation)
28
-
while logged in as a Patreon creator to register your client.
27
+
Visit the [Patreon platform documentation page](https://www.patreon.com/platform/documentation) while logged in as a Patreon creator to register your client.
29
28
30
29
This will provide you with a `client_id` and a `client_secret`.
31
30
@@ -59,12 +58,11 @@ $client_secret = ''; // Replace with your data
$redirect_uri = "http://mydomain.com/patreon_login"; // Replace http://mydomain.com/patreon_login with the url at your site which is going to receive users returning from Patreon confirmation
// You can send an array of vars to Patreon and receive them back as they are. Ie, state vars to set the user state, app state or any other info which should be sent back and forth.
Copy file name to clipboardExpand all lines: examples/create_webhook_to_notify_campaign_changes.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@
33
33
'members:update',
34
34
'members:delete',
35
35
),
36
-
'uri' => 'https://pat-php-dev.codebard.com', // Note that your url must start with https://
36
+
'uri' => 'https://yourdomain.com/webhook_receiver', // Replace https://yourdomain.com/webhook_receiver with the url at your site/app thats going to receive webhook requests. Note that your url must start with https://
$redirect_uri = "http://mydomain.com/patreon_login";// Replace http://mydomain.com/patreon_login with the url at your site which is going to receive users returning from Patreon confirmation
// You can send an array of vars to Patreon and receive them back as they are. Ie, state vars to set the user state, app state or any other info which should be sent back and forth.
Copy file name to clipboardExpand all lines: examples/unified_flow_oauth_login_register_pledge_redirect.php
+2-5Lines changed: 2 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@
36
36
37
37
// In this case, say, /patreon_login request uri. This doesnt need to be your final redirect uri. You can send your final redirect uri in your state vars to Patreon, receive it back, and then send your user to that final redirect uri
$redirect_uri = "http://mydomain.com/patreon_login";// Replace http://mydomain.com/patreon_login with the url at your site which is going to receive users returning from Patreon confirmation
40
40
41
41
// Min cents is the amount in cents that you locked your content or feature with. Say, if a feature or content requires $5 to access in your site/app, then you send 500 as min cents variable. Patreon will ask the user to pledge $5 or more.
// Or, http://mydomain.com/premium-feature. Or any url at which a locked feature or content will be unlocked after the user is verified to become a qualifying member
63
+
$state['final_redirect'] = 'http://mydomain.com/locked-content'; // Replace http://mydomain.com/locked-content with the url of the content to be unlocked at your site, or whever you want the user to be directed to after returning from Patreon login/confirmation
66
64
67
65
// Add any number of vars you need to this array by $state['key'] = variable value
68
66
@@ -99,7 +97,6 @@
99
97
100
98
}
101
99
102
-
103
100
// After linking an existing account or a new account with Patreon by saving and matching the tokens for a given user, you can then read the access token (from the database or whatever resource), and then just check if the user is logged into Patreon by using below code. Code from down below can be placed wherever in your app, it doesnt need to be in the redirect_uri at which the Patreon user ends after oAuth. You just need the $access_token for the current user and thats it.
104
101
105
102
// Lets say you read $access_token for current user via db resource, or you just acquired it through oAuth earlier like the above - create a new API client
0 commit comments