tylerjrichards / st-paywall

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

(Stripe) Error: The provided key does not have the required permissions... #45

Closed jozkotrapko closed 8 months ago

jozkotrapko commented 8 months ago

šŸ‘‹ I'm trying to implement st-paywall using Stripe in test mode, but the problem is that when I follow the documentation, everything goes as it should until I make a test payment:

Number: 4242 4242 4242 4242 4242 4242 Valid: 12/34 CCV: 567

Stripe records my test payment, but then after logging in with my google account, I get this error immediately: Error: PermissionError: Request req_TZSNgJfE4izqtu: The provided key 'rk_test_*********************************************************************************************BYBoGA' does not have the required permissions for this endpoint on account 'acct_1AF6F5BDknbCVWX2'. Having the 'rak_subscription_read' permission would allow this request to continue. (API restricted key was created with permission of Customers: read, and everything else to None as in documentation, if I changed Subscription to read or write as the error was saying, the payment gateway was not displayed)

Before I go from test mode to fully functional, I want to make sure everything is working as it should + I want to get a feel for how what works, and this is holding me back quite a bit.

It took me a few hours to remove this error, but all I got is that I forcibly removed this subsciption test from Stripe and everything works as before. The reason I'm writing this is because I'm still working on the site code, but there will come a time when I want to test things again (test payment, etc.) and I don't want to spend hours on this error again.

Thank you in advance for any idea

sfc-gh-trichards commented 8 months ago

Oh I figured out what is happening here! Sorry it took me a bit, so in a recent version I switched the API from pulling just from the customers api to the subscription api, and if you had a restricted api key then you would also have to check the read access box for subscriptions, not just customers. Would you try that? I'm updating the documentation too CleanShot 2023-11-11 at 12 07 49@2x

jozkotrapko commented 8 months ago

Works šŸ‘

cho-amh-programmerExpert commented 1 month ago

Umm, I have the same issue. But still i get the error even with "Subscriptions" & "Customers" permissions being set to "Read"

sfc-gh-trichards commented 1 month ago

do you have a restricted api key? or can you give me some more info here?

cho-amh-programmerExpert commented 1 month ago

do you have a restricted api key? or can you give me some more info here?

Well, I started the same issue here: https://github.com/tylerjrichards/st-paywall/issues/70#issuecomment-2195209856