On the site (MODX REVO) through Shopkeeper 3, an order is made out, when choosing online payment, the user is redirected to Yandex.Money.

After successful payment of the order, it is necessary to save in the JSON format the data of the buyer specified at the order, for further transfer to the user's account.

The order form is made through FormIt, then the data is transmitted to the cashier.

With online payments did not have to work, in what direction should I look? The Yandex API found that the data is transmitted in JSON format but in Shopkeeper the user is recorded without payment, and immediately after the order.

    1 answer 1

    In general, you can use such a workflow - write a user before paying for orders with a flag if the payment passed. Subsequently, to make a payment by transferring the order id as a callback parameter to the payment services. If the payment is successful / unsuccessful, the payment system redirects back to your website with parameters that also contain data on the order id, data on success / error. receiving such a callback, you can process it and add payment data to your database. Do not forget to add a field with a payment error. Or add a payment table, which will be associated with the foreign key with orders and write data on payments there. Any payment is an asynchronous request, so you need to take this into account when forming the interaction. The total flow will be such an order done -> payment gateway -> payment gateway -> payment gateway