A
A
Anna2020-12-23 16:24:42
1C-Bitrix
Anna, 2020-12-23 16:24:42

Yandex checkout widget, why does the window.YandexCheckout is not a constructor error occur when I try to call the widget again?

Good afternoon!
There was a following problem. Connected the standard Yandex.Checkout widget in Bitrix. If the client made an order and immediately paid for it through the widget, there are no problems with a subsequent call.
If the client made an order, reached the widget and decided not to pay and simply left the page and created a new order, when trying to pay for a new order, the widget no longer appears, and this window.YandexCheckout is not a constructor error occurs in the console.

I understand that the problem is that the widget was declared earlier. How can this error be corrected?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anna, 2020-12-24
@Anna_Belikova01

Seems to have found the problem. The bottom line is that an instance of the YandexCheckout class is created in Bitrix, but it does not provide for deleting the payment form from the container if the user decides to change something or create a new order.
From the documentation - checkout.destroy(); In Bitrix, an instance is created without it.
https://yookassa.ru/developers/payment-forms/widget

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question