403 Forbidden after success stripe payment

Options
Youssef.H.375
Youssef.H.375 Posts: 2 🔍
edited January 8 in Social Groups
Hi, I appreciate your help in figuring out what went wrong for me. I am using PHP to connect to the API using oAuth. I created a webapp, gave the user the right permissions, added the right scopes and was able to successfully automate the token refreshment so that my clients can register courses at any time. I am creating users on their behalf and registering them.
My problem is once I introduced Stripe payment prior to the registration I keep getting 403 Forbidden. The way it works is I checking first for user eligibility and whether they have an account or not, once they are I submit the payment form and await the success and payment intent, etc.. and then I am attempting to register the user, or just add a course if use is already registered, only then I get a 403 error. What could possibly be the reason?

***Update***
I changed the code to use the same token that I used prior to collecting the payment, I am now able to register users after successfully collecting the payment, however the API response for registering the course is "Not Authorized" although the user I use in the back is a super admin.