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.
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!