Answer the question
In order to leave comments, you need to log in
Yandex kassa + node.js?
I need to make a payment for some product, how best to catch the result of the payment?
Immediately after confirming the status of the payment (rejected or paid accordingly) - you need to perform some actions on the server (for example, send a letter to the post office), what is the best way to proceed? For the first time I deal with a payment system, but they also don’t have a module for a node. I found a third-party wrapper yandex-checkout-node - but, let's say, it does not shine with functionality. You can simply create a payment and check its status.
Thanks in advance!
upd. those. as far as I understand - when I create a payment and send a link for payment to the front, at that moment I start a timer on the server to re-request the status of the payment (it seems that a value in ms arrives from the YaKassa api, after which it is better to repeat the request), and accordingly each time I create timer with new check until status becomes resolved?
Answer the question
In order to leave comments, you need to log in
usually the path is as follows
: 1. endpoint for creating a payment request, using it you understand which of your clients initiated the payment and for what amount, the client knocks on your server with this request
2. you request the creation of a new payment operation from the processor, it returns a redirect link to the money input form and the transaction ID.
3. give this url to the client, transfer it there, write the transaction ID to your database, add a new status or whatever is more convenient for you.
4. The client pays the amounts, then, depending on the system settings, the client redirects to the page that you have indicated to display whether his operation was successful or unsuccessful.
5. The processor sends any change in payment statuses to your callbacks, you receive them and process them according to your business logic, you have a transaction ID that you wrote down for yourself and a new status, then you transfer it to the status of a successful or unsuccessful state.
PS: processors have the status of a deferred debiting of funds from a client, something from the payment pending series, which means that the money on his account is blocked for the requested amount, but the transfer itself will be made later, these are bank jokes. Accordingly, this logic should also be taken into account.
I hope these general words about payments fully fall on the Yandex cash register case, good luck.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question