Next.js Discord

Discord Forum

Linking Paypal Account ( with next-auth )

Unanswered
Bombay posted this in #help-forum
Open in Discord
BombayOP
I am trying to link paypal to user's account using next auth, here's my current code:

{
      id: "paypal",
      name: "Paypal",
      type: "oauth",
      authorization: "https://www.sandbox.paypal.com/signin/authorize",
      token: "https://api-m.sandbox.paypal.com/v1/oauth2/token",
      userinfo: "https://api-m.sandbox.paypal.com/v1/oauth2/token/userinfo",
      jwks_endpoint: "https://api-m.sandbox.paypal.com/v1/oauth2/certs",
      clientSecret: process.env.PAYPAL_SECRET,
      clientId: process.env.PAYPAL_ID,
      allowDangerousEmailAccountLinking: true,
      idToken: true,
      profile(profile) {
        return {
          id: profile.sub,
          name: profile.name,
          email: profile.email,
          image: profile.picture,
        };
      },
    },


I've got this error, is it because of my secret or return url? I've setup login with paypal on my paypal dashboard, or is the code having issues?

2 Replies

BombayOP
Here's my login with paypal, it doesnt want to save sometimes. Im thinking it has to be https:// instead of http://?
http://localhost:3000/api/auth/callback/paypal is the return url