tylerjrichards / st-paywall

A python package for creating subscription Streamlit apps
MIT License
235 stars 46 forks source link

Error on integration with BuyMeACoffee #34

Open aurabhi opened 10 months ago

aurabhi commented 10 months ago

I could login with google and after that I see an error screen with these lines.. I have populated the secrets for both google and bmac.

File "/doc/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 552, in _run_script exec(code, module.dict) File "/doc/app.py", line 7, in add_auth(required=True) File "/doc/venv/lib/python3.9/site-packages/st_paywall/aggregate_auth.py", line 11, in add_auth require_auth() File "/doc/venv/lib/python3.9/site-packages/st_paywall/aggregate_auth.py", line 25, in require_auth is_subscriber = user_email and user_email in get_bmac_payers() File "/doc/venv/lib/python3.9/site-packages/st_paywall/buymeacoffee_auth.py", line 26, in get_bmac_payers return extract_payer_emails(response.json()) File "/doc/venv/lib/python3.9/site-packages/st_paywall/buymeacoffee_auth.py", line 9, in extract_payer_emails for item in json_response["data"]:

tylerjrichards commented 9 months ago

hey @aurabhi are you still having this issue? Are you sure your BMAC secrets file is set up correctly? I expect that issue to pop up if the bmac api is not set up correctly

patriciodilet commented 3 months ago

Hello, I also have same issue. I get a token from https://developers.buymeacoffee.com/dashboard

testing_mode = true payment_provider = "bmac" #bmac if using Buy Me A Coffee stripe_api_key_test = "sktest..." #only needed if using Stripe stripe_api_key = "sklive..." #only needed if using Stripe stripe_link = "https://buy.stripe.com/..." #only needed if using Stripe stripe_linktest = "https://buy.stripe.com/test..." #only needed if using Stripe client_id = "abcd" client_secret = "efg" redirect_url_test = 'http://localhost:8501/' redirect_url = "https://autoworker.streamlit.app" bmac_api_key = "token from dev buymeacoffee" #only needed if using buy me a coffee bmac_link = "https://buymeacoffee.com/myUser" #only needed if using buy me a coffee

zwelshman commented 3 weeks ago

@patriciodilet did you manage to resolve this?

supmechanics commented 1 week ago

I also get the same error. Double-checked by BMAC secrets file, I believe it's set up properly.

Would love some help if anyone solved this.

zwelshman commented 1 week ago

The issue lies in the response. If you do not have subscribers 'data' is not in the response. I have a a work around that I can share tomorrow and maybe make a pull request? If it was welcome of course.

supmechanics commented 1 week ago

I see. Thanks for answering, I'll gladly test a PR for this if you can spare the time to push one.