Server IP : 213.176.29.180 / Your IP : 3.129.71.42 Web Server : Apache System : Linux 213.176.29.180.hostiran.name 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64 User : webtaragh ( 1001) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/webtaragh/public_html/whmcs/modules/addons/../gateways/offlinecc/../acceptjs/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
var acceptJsModalInput=!1;function validateAcceptJs(e){if("undefined"==typeof recaptchaValidationComplete||"undefined"==typeof recaptchaType||"invisible"!==recaptchaType||!1!==recaptchaValidationComplete){var a=jQuery('input[name="paymentmethod"]:checked'),t=jQuery("#frmCheckout"),r=jQuery('input[name="ccinfo"]');if("acceptjs"!==a.val()||"acceptjs"===a.val()&&"useexisting"===r.val())return!0;e.preventDefault(),t.find("#btnCompleteOrder").attr("disabled","disabled").addClass("disabled");var a={},r={},t={},n=(t.cardNumber=jQuery("#inputCardNumber").val().replace(/\s/g,""),jQuery("#inputCardExpiry").payment("cardExpiryVal")),n=(t.month=n.month.toString(),1===t.month.length&&(t.month="0"+t.month),t.year=n.year,n=null,t.cardCode=jQuery("#inputCardCVV").val(),t.zip=jQuery("#inputPostcode").val(),jQuery("#inputFirstName"));return n.length&&n.val()&&(t.fullName=n.val()+" "+jQuery("#inputLastName").val()),a.cardData=t,r.clientKey=clientKey,r.apiLoginID=apiLoginId,a.authData=r,Accept.dispatchData(a,acceptJsResponseHandler),!1}e.preventDefault()}function acceptJsResponseHandler(e){var a=jQuery("#frmCheckout");if("Error"===e.messages.resultCode){for(var t="",r=0;r<e.messages.message.length;r++)t+=e.messages.message[r].text+"\n";a.find(".gateway-errors").text(t).slideDown(),scrollToGatewayInputError(),a.find("#btnCompleteOrder").removeAttr("disabled").removeClass("disabled")}else a.find(".gateway-errors").text("").slideUp(),a.append(jQuery('<input type="hidden" name="dataDescriptor">').val(e.opaqueData.dataDescriptor)),a.append(jQuery('<input type="hidden" name="dataValue">').val(e.opaqueData.dataValue)),a.off("submit",validateAcceptJs),a.find("#btnCompleteOrder").removeAttr("disabled").removeClass("disabled").click().addClass("disabled").attr("disabled","disabled")}function enable_acceptjs(){var e=jQuery("#frmCheckout"),a=e.find("#cardType");e.find("#cctype").removeAttr("name"),e.find("#inputCardNumber").removeAttr("name"),e.find("#inputCardExpiry").removeAttr("name"),e.find("#inputCardCVV").removeAttr("name"),a.length?e.find("#cardType").parents("div.col-sm-6").slideUp("fast",function(){e.find("#inputCardNumber").parents("div.col-sm-6").toggleClass("col-sm-6 col-sm-12")}):(e.find("#cctype").parents("div.new-card-info").slideUp("fast"),e.find("#cctype").parents("tr.newccinfo").slideUp("fast")),e.on("submit",validateAcceptJs)}function disable_acceptjs(){var e=jQuery("#frmCheckout"),a=e.find("#cardType");e.find("#inputCardNumber").attr("name","ccnumber"),e.find("#inputCardExpiry").attr("name","ccexpirydate"),e.find("#inputCardCVV").attr("name","cccvv"),e.find("#cctype").attr("name","cctype"),(a.length?(e.find("#inputCardNumber").parents("div.col-sm-12").toggleClass("col-sm-6 col-sm-12"),e.find("#cardType").parents("div.col-sm-6")):(e.find("#cctype").parents("div.new-card-info").slideDown("fast"),e.find("#cctype").parents("tr.newccinfo"))).slideDown("fast"),e.off("submit",validateAcceptJs)}function validateNewCcAcceptJs(e){e.preventDefault(),jQuery("#btnSubmitNewCard").attr("disabled","disabled").addClass("disabled");var e={},a={},t={},r=(t.cardNumber=jQuery("#inputCardNumber").val().replace(/\s/g,""),jQuery("#inputCardExpiry").payment("cardExpiryVal"));return t.month=r.month.toString(),1===t.month.length&&(t.month="0"+t.month),t.year=r.year,r=null,t.cardCode=jQuery("#inputCardCvc").val(),e.cardData=t,a.clientKey=clientKey,a.apiLoginID=apiLoginId,e.authData=a,Accept.dispatchData(e,acceptJsNewCcResponseHandler),!1}function acceptJsNewCcResponseHandler(e){var a=jQuery(".frm-credit-card-input");if("Error"===e.messages.resultCode){for(var t="",r=0;r<e.messages.message.length;r++)t+=e.messages.message[r].text+"\n";a.find(".gateway-errors,.assisted-cc-input-feedback").text(t).slideDown(),scrollToGatewayInputError(),jQuery("#btnSubmitNewCard").removeAttr("disabled").removeClass("disabled")}else a.find(".gateway-errors,.assisted-cc-input-feedback").text("").slideUp(),a.append(jQuery('<input type="hidden" name="dataDescriptor">').val(e.opaqueData.dataDescriptor)),a.append(jQuery('<input type="hidden" name="dataValue">').val(e.opaqueData.dataValue)),a.off("submit",validateNewCcAcceptJs),a.append('<input type="submit" id="hiddenSubmit" name="submit" value="Save Changes" style="display: none">'),jQuery("#hiddenSubmit").click()}function enable_payment_acceptjs(){var e=jQuery("#frmPayment");e.find("#cctype").removeAttr("name").parents("div.form-group").remove(),e.find("#inputCardNumber").removeAttr("name").payment("formatCardNumber"),e.find("#inputCardExpiry").removeAttr("name"),e.find("#inputCardExpiryYear").removeAttr("name"),e.find("#inputCardCvv").removeAttr("name").payment("formatCardCVC").parents("div.form-group").show("fast"),e.on("submit",validatePaymentAcceptJs)}function validatePaymentAcceptJs(e){e.preventDefault(),jQuery("#btnSubmit").attr("disabled","disabled").addClass("disabled");var e={},a={},t={},r=(t.cardNumber=jQuery("#inputCardNumber").val().replace(/\s/g,""),jQuery("#inputCardExpiry").payment("cardExpiryVal"));return t.month=r.month.toString(),1===t.month.length&&(t.month="0"+t.month),t.year=r.year,t.cardCode=jQuery("#inputCardCvv").val(),e.cardData=t,a.clientKey=clientKey,a.apiLoginID=apiLoginId,e.authData=a,Accept.dispatchData(e,acceptJsPaymentResponseHandler),!1}function acceptJsPaymentResponseHandler(e){var a=jQuery("#frmPayment");if("Error"===e.messages.resultCode){for(var t="",r=0;r<e.messages.message.length;r++)t+=e.messages.message[r].text+"\n";a.find(".gateway-errors").text(t).slideDown(),scrollToGatewayInputError(),jQuery("#btnSubmit").removeAttr("disabled").removeClass("disabled").find("span").toggle()}else a.find(".gateway-errors").text("").slideUp(),a.append(jQuery('<input type="hidden" name="dataDescriptor">').val(e.opaqueData.dataDescriptor)),a.append(jQuery('<input type="hidden" name="dataValue">').val(e.opaqueData.dataValue)),a.off("submit",validatePaymentAcceptJs),a.find("#btnSubmit").removeAttr("disabled").removeClass("disabled").click().addClass("disabled").attr("disabled","disabled")}function validateAdminAcceptJs(e){var a=jQuery("#frmCreditCardDetails"),e=(e.preventDefault(),a.find('button[type="submit"],input[type="submit"]').prop("disabled",!0).addClass("disabled").find("span").toggle(),{}),a={},t={},r=(t.cardNumber=jQuery("#inputCardNumber").val().replace(/\s/g,""),jQuery("#inputCardExpiry").payment("cardExpiryVal")),n=r.month.toString();return 1===n.length&&(n="0"+n),t.month=n,t.year=r.year,r=null,t.cardCode=jQuery("#cardcvv").val(),e.cardData=t,a.clientKey=clientKey,a.apiLoginID=apiLoginId,e.authData=a,Accept.dispatchData(e,acceptJsAdminResponseHandler),!1}function acceptJsAdminResponseHandler(e){var a=jQuery("#frmCreditCardDetails");if("Error"===e.messages.resultCode){for(var t="",r=0;r<e.messages.message.length;r++)t+=e.messages.message[r].text+"\n";a.find(".gateway-errors").text(t).slideUp(),scrollToGatewayInputError(),a.find("#btnSaveChanges").removeAttr("disabled").removeClass("disabled")}else{a.find(".gateway-errors").text("").slideUp(),a.append(jQuery('<input type="hidden" name="dataDescriptor">').val(e.opaqueData.dataDescriptor)),a.append(jQuery('<input type="hidden" name="dataValue">').val(e.opaqueData.dataValue)),a.append('<input type="submit" id="hiddenSubmit" name="submit" value="Save Changes" style="display: none">'),a.off("submit",validateAdminAcceptJs);a=jQuery("#hiddenSubmit");acceptJsModalInput&&((a=jQuery("#modalAjaxFooter").find("#btnSave")).removeClass("disabled"),jQuery("#modalAjax .loader").fadeOut(),a.off("click",validateAdminAcceptJs),a.on("click",submitIdAjaxModalClickEvent)),a.click()}}function enable_acceptjs_card_input(){var e=jQuery(".frm-credit-card-input");e.find("#inputCardNumber").removeAttr("name").payment("formatCardNumber"),e.find("#inputCardExpiry").removeAttr("name").payment("formatCardExpiry"),e.find("#inputCardCvc").removeAttr("name").payment("formatCardCVC"),e.find('button[type="submit"]').removeAttr("name"),e.on("submit",validateNewCcAcceptJs)}function disable_acceptjs_card_input(){var e=jQuery(".frm-credit-card-input");e.find("#inputCardNumber").attr("name","ccnumber").payment("formatCardNumber"),e.find("#inputCardExpiry").removeAttr("name","ccexpiry").payment("formatCardExpiry"),e.find("#inputCardCvc").removeAttr("name","cardcvv").payment("formatCardCVC"),e.find('button[type="submit"]').attr("name","submit"),e.off("submit",validateNewCcAcceptJs)}jQuery(document).ready(function(){var e,a,t,r=jQuery('input[name="paymentmethod"]'),n=jQuery("#frmCheckout"),i=jQuery(".frm-credit-card-input"),d=jQuery("#frmPayment"),c=jQuery("#frmCreditCardDetails");r.length&&!i.length?(t=jQuery('input[name="ccinfo"]'),e=jQuery('input[name="ccinfo"]:checked'),"acceptjs"===(a=jQuery('input[name="paymentmethod"]:checked').val())&&(enable_acceptjs(),"new"!==t.val())&&n.off("submit",validateAcceptJs),r.on("ifChecked change",function(){"acceptjs"===(a=jQuery(this).val())?(enable_acceptjs(),"new"!==e.val()&&n.off("submit",validateAcceptJs)):disable_acceptjs()}),jQuery(document).on("ifChecked",'input[name="ccinfo"]',function(){n.off("submit",validateAcceptJs),"acceptjs"===a&&"useexisting"!==jQuery('input[name="ccinfo"]:checked').val()&&n.on("submit",validateAcceptJs)})):i.length?("acceptjs"===jQuery('input[name="type"]:checked').data("gateway")&&enable_acceptjs_card_input(),jQuery('input[name="type"]').on("ifChecked change",function(){("acceptjs"===jQuery(this).data("gateway")?enable_acceptjs_card_input:disable_acceptjs_card_input)()})):d.length?(d.off("submit",validateCreditCardInput),"new"===jQuery('input[name="ccinfo"]:checked').val()?enable_payment_acceptjs():d.find("#inputCardCvv").parents("div.form-group").hide("fast"),jQuery('input[name="ccinfo"]').on("ifChecked change",function(){"new"===jQuery(this).val()?enable_payment_acceptjs():(d.find("#inputCardCvv").parents("div.form-group").hide("fast"),d.off("submit",validatePaymentAcceptJs))})):c.length&&(c.find("#cctype").removeAttr("name").parents("tr#rowCardType").hide("fast"),c.find("#inputCardNumber").removeAttr("name"),c.find("#inputCardExpiry").removeAttr("name"),c.find("#cardcvv").removeAttr("name"),jQuery("#containerStorageInputControl")?((t=jQuery("#modalAjaxFooter").find("#btnSave")).removeAttr("name"),t.off(),t.on("click",validateAdminAcceptJs),acceptJsModalInput=!0):(c.find("#btnSaveChanges").removeAttr("name"),c.on("submit",validateAdminAcceptJs)))});