3

I need some clarification about the best way to combine paypal subscription in my website registration flow.

The steps for registration:

  1. user chose a price plan by clicking on paypal subscribe button
  2. the use complete payment on paypal form
  3. the user return back to my site to fill registration form.

How can I be sure that the user that fill the site registration form payed for the subscription on paypal and didn't got directly to the registration page?

How can I know on which subscription button the user clicked and how much he paid?

Is there any tutorial that describes such a scenario and which api call I should do?

AdrieanKhisbe
  • 3,899
  • 8
  • 37
  • 45

1 Answers1

0

The smart subscription button has an on approval type of action with the subscriptionId. Use this to send to the backend (or your cloud hosted function) and it will do the follow:

  1. check that its valid
  2. use that paypal email and check that no user with that email exists
  3. use that email to create a new account (add to auth and database with the subscriptionId, planId, paypalId, paypalEmail (incase they change away from this), name, etc.)
  4. send that user a password change email / welcome email
  5. respond with success and kick them to the success page which tells them to check their email and spam

Note: for paid-only accounts make sure you don't have an auth sign up page, only a paypal button subscribe page as the sign up page.

Kevin Danikowski
  • 4,620
  • 6
  • 41
  • 75