We can generate a link directly from the Stripe dashboard to collect payment from the user but it has certain limitations as below:
As a developer, we need to perform a certain action when the user payment is successful e.g. sending emails, updating the database, etc. We need to execute a function after the payment is successful but with the Standalone Stripe payment link, we don't have that option.
If the user is subscribed to the recurring (or monthly) plan, we need to store the customer id so that the customer is able to upgrade or cancel their plan later. But with the standalone Stripe payment, the user is not provided any URL where they can update their subscription plan.
In the Stripe Payment Link, the user is asked to enter his email along with the account detail. If the payment is successful, the user details are stored in the Stripe Customer. The email of the user is also available in the customer document.
In Stripe, the email of the user is not the unique element. We can create multiple customers document with the same email in the Stripe Dashboard. Stripe payment creates a separate customer document with the same email if the user completes the payment multiple time.
For this course, we'll use Stripe SDK to create the session for Stripe's built-in stripe checkout. Then, We can redirect the user to a session URL for the payment. When the payment is successful / failed, it returns back URL we've specified initially as shown below.
After the payment is successful, we can execute the function on the payment received page that saves the Stripe customer id on the database so that the customer is allowed to change the plan later.
Further, in the course, we'll learn how to overcome the Stripe Payment Link challenges.