Laravel Cashier (Stripe) payments with form validation, database record and a success message
Hey @tuto1902
I was following your YouTube livestream about the cool way of using Laravel Cashier with Stripe and I got all bits and pieces working, however there were a few small issues in the final result. I left a few comments on the video but I've seen it has been inactive for some time so I figured out to ask here (no blame at all, just a question
)
So in the videos you've covered a simple scenario of having some premium subscription plans and a lifetime payment. Since the plans were recurring, Stripe responds correctly and returns the proper actions after payment.
However if you try the code with the lifetime payment, Stripe returns an error that at least one subscription is required.
Anyway, my question is not about that as my current project has only reoccurring subscriptions. What I need to achieve is the following process:
1,. A resource form is shown to allow the user to add premium content.
I was following your YouTube livestream about the cool way of using Laravel Cashier with Stripe and I got all bits and pieces working, however there were a few small issues in the final result. I left a few comments on the video but I've seen it has been inactive for some time so I figured out to ask here (no blame at all, just a question
So in the videos you've covered a simple scenario of having some premium subscription plans and a lifetime payment. Since the plans were recurring, Stripe responds correctly and returns the proper actions after payment.
However if you try the code with the lifetime payment, Stripe returns an error that at least one subscription is required.
Anyway, my question is not about that as my current project has only reoccurring subscriptions. What I need to achieve is the following process:
1,. A resource form is shown to allow the user to add premium content.
- The form POST data gets validated upon publishing.
- If the validation succeeded and all inputs are OK, the user should get redirected to Stripe to pay for the resource to be added
- If/Once the payment has succeeded, the resource should get stored in the database and the user should get the success (or error message in a case where the payment did not go through and the resource gets stored as a draft until paid).