F
F
firecorer2022-02-20 03:42:45
PHP
firecorer, 2022-02-20 03:42:45

How to correctly implement the reservation of goods before payment in the online store of digital goods?

Each item is contained on one line. At first there was a problem that suddenly if while the user pays for the goods it will end and empty lines will come to him. The solution is obvious, this is to book an order and write lines in it. Problem number two is bots. You can write a spam machine that will reserve all the goods and no one can buy anything. The question arises, what to do?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
H
hint000, 2022-02-20
@hint000

Look at existing online stores. To place an order, you need to confirm registration via e-mail or via SMS. This will already require some stubbornness from the botanist to get around. In some cases, the manager calls the buyer back to confirm the order. This cuts off 99.9% of jokers, although it does not work well with a large number of normal orders.
In general, let's remember the old story "Hacker in the canteen" or "Hacker against the director of the canteen" https://xakep.ru/2006/12/16/35784/ Especially day 194 is similar to your question. Better not to be like the character in this story.

V
vitaly_74, 2022-02-20
@vitaly_74

as for the bots - answered hint000 , as for the reservation, for example, you have a table of purchases in the database, so create a similar one but for the reservation, and make purchases, checking for minus the total reservation for the product (for instant buyers), or for the reservation, for for those who booked, also put the end date of the reservation in the table (the beginning doesn’t matter, it seems to me), and run cron to check the reservation. if the reservation time has expired, reset it. not expired, leave.

D
danSamara, 2022-02-24
@danSamara

This is a fundamental problem of online stores that has no solution: either you actually block the product if it is in the cart, which guarantees the user a purchase, but creates problems for you, or the presence of the product has a purely informational function, which reduces user loyalty due to "unfortunately this The item is no longer available for purchase.
The most common approach is to block the product before proceeding directly to payment for a short time, for which the user must pay. This option is good for two reasons:
1. Time-limited shopping cart - no need to make a difficult decision about the time of the actual blocking of goods in the basket.
2. Short time of real blocking of goods (10-30 minutes) with a preliminary check of its availability.
Of course, there is still the option of bots, in which case it will be possible to remove the real lock altogether and conduct a monetary transaction through hold / refund, which will be free in terms of commissions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question