A
A
Alexey2020-01-27 13:09:30
1C-Bitrix
Alexey, 2020-01-27 13:09:30

How can one product in Bitrix, upon confirmation of payment, each time attach a unique pair: key / password?

Hello !

Please tell me how you can implement a certain functionality:

There is a "Product - service", when placing an order by the buyer and confirming payment from the payment system, send a unique pair in the mail message to the buyer: Login (Key) / Password for the service (taken, apparently from the database or from somewhere else) At the same time, there is only one "Product - Service" (product card), only the Login / Password changes (each time new and unique), their number decreases accordingly.

Please tell me in which direction to dig?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
serginhold, 2020-01-27
@serginhold

do not dig in any direction,
regarding the database, you need to store your keys in a separate table,
you can quickly create an hl-block with 5 fields, like this:

id | order_item_id (по умолч. null) | product_id | login(key) | pass

(if login(key) is unique, then you can use it as a primary field, throwing out the id)
in the order, bind the key to the basket element, fill in the order_item_id,
i.e. if order_item_id == null, then the key is not used yet,
and in the mail template you already pull hl-block through the event.
ps or you can put the id of the key in the property of the basket element (in principle, everything is the same, only the binding in another table, it will just be less convenient)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question