Need help with Paypal API

Hi!

I’m trying to set up a subscription payment plan using Paypal since Stripe isn’t supported in my country. I saw in other forum discussions and YouTube videos that I need to use OAuth 2.0 but I am completely lost. How do I authenticate and get an access token? Here’s what I have so far from looking at other screenshots.

Is your goal is to connect to your own Paypal account or you want your user to authenticate using their own account and access their paypal account?

Checked really fast and I don’t think Paypal let you use it to authenticate your user. You need to use oAuth2 custom token and not user-agent

1 Like

I guess the latter is what I want? I basically want to have subscription payments and one-time payments using PayPal.

I thought I could authenticate users based on this post http://forum.bubble.io/t/how-to-integrate-paypal-with-bubble-using-oauth2/6803 but I guess its outdated.

If I use oAuth2 custom token, do I put https://api-m.sandbox.paypal.com/v1/oauth2/token in the Token endpoint (POST)?

I finally got it to work, although when I logged in Paypal and went back to the redirect URI, I get this error concerning the header even though I do not have those values in my header.

image

Are you setting request header param correctly?
Paypal expect that header set

curl -v -X POST "https://api-m.sandbox.paypal.com/v1/oauth2/token"\
 -u "CLIENT_ID:CLIENT_SECRET"\
 -H "Content-Type: application/x-www-form-urlencoded"\
 -d "grant_type=client_credentials"

It’s supposed to be like this right? But after the user gets redirected to return URI I get the same error.