Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
262 views
in Technique[技术] by (71.8m points)

php - Fetching A Patron Data From Patreon API

I'm developing a webpage with Laravel 8 and I have issues with fetching a patron details by id from Patreon API. Here is my use case.

I’ve added "Login with Patreon" option to my webpage, and it works well. When someone login with Patreon successfully, I store her/his Patreon id and set remember token to login the member automatically when she/he visits my page next time.

The first login process is fine. The problem occurs when my Patron visits my page next time. Because I want to check whether I received any payment before I let she/he see all content. That’s why I need to get my patron details from a middleware. To do that I tried:

  • fetch_user() returns my account details instead of logged-in user.
  • fetch_user() with the access token that returns from Patreon when someone login, returns unauthorized.
  • fetch_member_details() doesn’t work with the id I passed, which is an integer like 5484646 because it requires a very long string like 55153fds-f45fd5sfs-fds42ds, I don't know what it's.
  • fetch_page_of_members_from_campaign() and fetch_member_details() together to get the proper ID, but it takes ages to get data, which is unacceptable.

So, how can it be done?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...