Hello!

Task : implement the following functionality. The site has a form for submitting an application for a certain product, for example, for a certain tour. Next to the description of the goods there is a button "Book" or "Leave a request", it does not matter. The bottom line is that after clicking a person enters contact details and they fly away to the company. Next, the company processes this data and in response must send a unique link to the customer to pay for this product through an online payment system.

Accordingly, the question is: how to correctly implement such a model of interaction on the site? The only and, it seems to me, quite absurd version, which so far came to my mind, is to pass through GET parameters a parameter like product identifier or order number that would be generated automatically.

How does it actually work?

Thank!

    1 answer 1

    I think you can do in this direction:

    1. When sending data by the client, some random order id is created, which is stored in the database along with the product id, its quantity and similar info, as well as the note “not paid”.

    2. Next, the company sends a link in which there is a given id (the same GET, why not) to the mail of the client.

    3. The client follows this link. Well, by id is read from the database that he ordered and go ahead for payment.
    4. After payment for this id put a mark - paid.

    You can also add the time for which the client should have time to pay and write a simple cron that will delete all records from the database older than this time.