3

I am trying to connect user accounts with their PayPal account.

The issue that I am facing is that after users give their consent, and PayPal returns to the return url, I am not able to match the PayPal account to our account as there might be a different email address associated with the PayPal account than the one used on our system.

Can I somehow pass an extra param like a user_id to PayPal and have it returned back on the return url?

Preston PHX
  • 27,642
  • 4
  • 24
  • 44
Denis
  • 120
  • 7

1 Answers1

1

Most implementations would use the web server session and/or cookies to maintain whether the user is logged in, so you already know their user_id that way (or can store it in the server session).

And if they aren't logged in? Well it'd be a good idea to have them do so before you go connecting/associating anything. You know, security.

Preston PHX
  • 27,642
  • 4
  • 24
  • 44
  • The user is redirected to PayPal using a mobile app, and our return URL is set to our web app. This means I cannot use this workaround. But yes, if it were only web based, that would be the go to solution! – Denis Jan 16 '20 at 08:30
  • You could try adding additional GET string parameters to your base return URL and see if they get returned: https://developer.paypal.com/docs/connect-with-paypal/reference/button-js-builder/ -- but even if it works, it is not secure. You _should_ design your combination of mobile and web to ensure a user is logged in when returning. – Preston PHX Jan 16 '20 at 13:16