After a user has logged in into my website, I would like to check if he is a patron and, in that case, check if he belongs to some Tier.
After that, depending on the tier, I would like to assign him a specific user role.
Since it is very difficult to test my code without a test account (I should pay to create a fake account to test my code), which is the correct code to achieve that purpose?
Yeah, I ended up requesting the identity API endpoint, which gave me access to the userâs membership and tier information for just my campaign. I only needed to ask for the âidentityâ scope in the initial oauth request.
Hereâs the code I used to build the API call. Note that this is JavaScript but it will show you what arguments to use if you are using a different language.
And obviously youâll need to adjust the fields depending on what information you need. The docs are at least pretty helpful in that regard.
And yes, for testing I made a fake creator account in another browser and then backed it with my regular Patron user using a temporary debit card number (I use Privacy.com for this). But I also set my fake campaign to not charge backers so I shouldnât ever get a charge to it. Good luck!