There is an online store samopisny. To him, one programmer attached Yandex cashier. But sometimes customers complain that when choosing a payment on the site, the page freezes. It was experimentally revealed that the case is in the form of sending the Yandex ticket office. It was made somehow very strange.

private function __getYandexForm($id, $total) { return ' <form name="ShopForm" id="yandexForm" method="POST" action="'. $this->action_url .'"style="display:none"> <input type="hidden" name="shopId" value="' . $this->shopid . '"> <input type="hidden" name="scid" value="' . $this->shid . '"> Π˜Π΄Π΅Π½Ρ‚ΠΈΡ„ΠΈΠΊΠ°Ρ‚ΠΎΡ€ ΠΊΠ»ΠΈΠ΅Π½Ρ‚Π°/НомСр Π·Π°ΠΊΠ°Π·Π°:<br> <input type=text name="customerNumber" size="74" value="' . $id . '"><br><br> Π‘ΡƒΠΌΠΌΠ°:<br> <input type=text name="Sum" size="74" value="' . $total . '"><br><br> Бпособ ΠΎΠΏΠ»Π°Ρ‚Ρ‹:<br><br> <input name="paymentType" value="PC" type="radio" >ΠžΠΏΠ»Π°Ρ‚Π° со счСта Π² ЯндСкс.Π”Π΅Π½ΡŒΠ³Π°Ρ… (комиссия 3%)<br> <input name="paymentType" value="AC" type="radio" checked>ΠžΠΏΠ»Π°Ρ‚Π° банковской ΠΊΠ°Ρ€Ρ‚ΠΎΠΉ (комиссия 3.5%)<br> <br><input type=submit value="ΠžΠΏΠ»Π°Ρ‚ΠΈΡ‚ΡŒ"><br> </form> <script> jQuery("form#yandexForm").submit(); </script>'; } 

That is, in fact, the script returns to the page the form of Yandex itself, along with the jquery-script, imitating the sending of this generated form. And it is precisely this step that sometimes does not work for everyone.

Is it possible to alter it somehow humanly? Who had experience with Yandex cashier?

  • And if you try to send the form when the whole page loads? Those. send the form only on the page loading event (for example, to "load"). - devtwo
  • Yes, it is possible, but still somehow a crutch ... - hX3
  • in my opinion, generating javascript in this way is quite crutch. But you still try, suddenly work. - devtwo

0