pi-apps / pi-platform-docs

1.73k stars 367 forks source link

Cannot create a payment without "payments" scope Error #304

Closed aarrtturas closed 1 year ago

aarrtturas commented 1 year ago

I get this message then I try to create payment from my own account. It was working before not this way. I was able to make payments from my own account in my app. Now every time I need to take new app key and can make payment only one time. Payments from other accounts (other pi network users) looks like can make payments as usual. Current situation is not good I can't test if payment flow is fine in my app every day. See image bellow. Refreshing app key every day is not fine.

image

aurelienshz commented 1 year ago

Hi,

To fix this error, you need to include the payments scope in the call to Pi.authenticate when authenticating the user, e.g:

Pi.authenticate(["payments"], function onIncompletePaymentFound() { ... })

Adding the payments scope should work without any breakdown for your users and you should be able to authenticate them with an access token which has the payments scope next time they visit your app.