lundi 23 septembre 2019

How do you create a flow / sequence of actions in PHP/laravel? (Checkout payment system)

  1. Scenario

You're building a checkout payment system for your online store. Once someone adds an item to the cart, you ask for an email, then payment, then go to a thanks page.

  1. Whats the best way to create this sequence of actions?

  2. What I am currently doing

I'm starting at a /checkout/email/ route where I ask for an email. When I get one, redirect to /checkout/payment/, after successful payment redirect to /checkout/thanks.

I'm using some middlewares to then check if the cart is emty, if we have an email already skip to payment, etc etc. Those sort of middlewares to check the status of where the user should be so whenever they come back they go where they should be.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire