芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/kwesioben.com/paymoney/public/user/customs/js/deposit.min.js
"use strict";function restrictNumberToPrefdecimalOnInput(e){var type=$("select#currency_id").find(":selected").data("type");restrictNumberToPrefdecimal(e,type)}function determineDecimalPoint(){var currencyType=$("select#currency_id").find(":selected").data("type");"crypto"==currencyType?($(".pFees, .fFees, .total_fees").text(CRYPTODP),$("#amount").attr("placeholder",CRYPTODP)):"fiat"==currencyType&&($(".pFees, .fFees, .total_fees").text(FIATDP),$("#amount").attr("placeholder",FIATDP))}function isNumber(evt){var charCode=(evt=evt||window.event).which?evt.which:evt.keyCode;return!(charCode>31&&(charCode<48||charCode>57))}if($(".main-containt").find("#depositCreate").length){function activePaymentMethodsList(currency_id){return new Promise((resolve,reject)=>{let token=$('[name="_token"]').val();$.post(paymentMethodListUrl,{_token:token,transaction_type_id:transactionTypeId,currency_id:currency_id}).done(response=>{if(""!=response.success.paymentMethods){let options="";$.map(response.success.paymentMethods,(value,index)=>{options+=`
${value.name}
`}),$("#payment_method").html(options),$("#paymentMethodSection").removeClass("d-none"),$("#paymentMethodEmpty").addClass("d-none"),$("#depositCreateSubmitBtn").removeClass("d-none"),checkAmountLimitAndFeesLimit(),resolve()}else $("#payment_method").val(""),$("#percentage_fee").val(0),$("#fixed_fee").val(0),$("#total_fee").val(0),$(".pFees").html("0"),$(".fFees").html("0"),$(".total_fees").html("0.00"),$("#paymentMethodSection").addClass("d-none"),$("#paymentMethodEmpty").removeClass("d-none"),$("#depositCreateSubmitBtn").addClass("d-none"),resolve()}).fail(error=>{reject(error)})})}var lastCurrencyType,currentCurrencyType;function checkAmountLimitAndFeesLimit(){var token=$('[name="_token"]').val(),amount=$("#amount").val().trim(),currency_id=$("#currency_id").val(),payment_method_id=$("#payment_method option:selected").val();""!=amount&&$.post({url:feesLimitUrl,dataType:"json",data:{_token:token,amount:amount,currency_id:currency_id,payment_method_id:payment_method_id,transaction_type_id:transactionTypeId}}).done((function(response){if(200==response.success.status)$("#percentage_fee").val(response.success.feesPercentage),$("#fixed_fee").val(response.success.feesFixed),$("#total_fee").val(response.success.totalFees),$(".total_fees").html(response.success.totalFeesHtml),$(".pFees").html(response.success.pFeesHtml),$(".fFees").html(response.success.fFeesHtml),$(".amountLimit").text(""),$("#depositCreateSubmitBtn").attr("disabled",!1);else{if(""!=amount)return $(".amountLimit").text(response.success.message),$("#depositCreateSubmitBtn").attr("disabled",!0),!1;$(".amountLimit").text(""),$("#depositCreateSubmitBtn").attr("disabled",!1)}}))}$(window).on("load",(function(){determineDecimalPoint();var currency_id=$("#currency_id").val();setTimeout((function(){activePaymentMethodsList(currency_id)}),300)})),$("select").change((function(){lastCurrencyType="undefined"!==$(this).attr("data-old")?$(this).attr("data-old"):"",currentCurrencyType=$("option:selected",this).data("type"),$(this).attr("data-old",currentCurrencyType)})).change(),$(document).on("change","#currency_id",(function(){var currency_id;lastCurrencyType!==currentCurrencyType&&$("#amount").val(""),$(".amount-limit-error").text(""),determineDecimalPoint(),activePaymentMethodsList($("#currency_id").val())})),$(document).on("change","#payment_method",(function(){checkAmountLimitAndFeesLimit()})),$(document).on("input","#amount",$.debounce(1e3,(function(){checkAmountLimitAndFeesLimit()}))),$("#depositCreateForm").on("submit",(function(){$(".spinner").removeClass("d-none"),$("#rightAngleSvgIcon").addClass("d-none"),$("#depositCreateSubmitBtn").attr("disabled",!0),$("#depositCreateSubmitBtnText").text(submitBtnText)}))}if($(".main-containt").find("#depositStripe").length){function makePayment(){var promiseObj;return new Promise((function(resolve,reject){var cardNumber=$("#cardNumber").val().trim(),month=$("#month").val().trim(),year=$("#year").val().trim(),cvc=$("#cvc").val().trim();$("#stripeError").html(""),cardNumber&&month&&year&&cvc&&$.post({url:stripeMakePaymentUrl,data:{_token:token,cardNumber:cardNumber,month:month,year:year,cvc:cvc},beforeSend:function(xhr){$("#depositStripeSubmitBtn").attr("disabled",!0)}}).done((function(response){200!=response.data.status?($("#stripeError").html(response.data.message),reject(response.data.status)):($("#depositStripeSubmitBtn").attr("disabled",!1),resolve(response.data))}))}))}function confirmPayment(){makePayment().then((function(result){$.ajax({url:stripeConfirmPaymentUrl,method:"POST",data:{_token:token,paymentIntendId:result.paymentIntendId,paymentMethodId:result.paymentMethodId},dataType:"json",beforeSend:function(xhr){$("#depositStripeSubmitBtn").attr("disabled",!0)}}).done((function(response){if(200!=response.data.status)return $("#depositStripeSubmitBtn").attr("disabled",!0),$("#stripeError").html(response.data.message),!1;$("#depositStripeSubmitBtn").attr("disabled",!1),window.location.replace(stripeSuccessUrl)})).fail((function(error){$("#depositStripeSubmitBtn").attr("disabled",!0),$("#stripeError").html(errorMessage)}))})).catch((function(error){$("#depositStripeSubmitBtn").attr("disabled",!0),$("#stripeError").html(errorMessage)}))}$(document).ready((function(){$("#stripePaymentForm").submit((function(event){event.preventDefault(),$("#depositStripeSubmitBtn").attr("disabled",!0),$(".spinner").removeClass("d-none"),$("#rightAngleSvgIcon").addClass("d-none"),$("#depositConfirmBackBtn").removeAttr("href"),$("#depositStripeSubmitBtnText").text(confirmBtnText),confirmPayment()}))})),$("#month").on("change",(function(){$("#depositStripeSubmitBtn").prop("disabled",!0),makePayment()})),$("#cardNumber, #year, #cvc").on("keyup",$.debounce(1e3,(function(){$("#depositStripeSubmitBtn").prop("disabled",!0),makePayment()}))),$("#cardNumber").on("input",(function(e){var target=e.target,position=target.selectionEnd,length=target.value.length;target.value=target.value.replace(/[^\d]/g,"").replace(/(.{4})/g,"$1 ").trim(),target.selectionEnd=position+=" "===target.value.charAt(position-1)&&" "===target.value.charAt(length-1)&&length!==target.value.length?1:0}))}if($(".main-containt").find("#depositPaypal").length&&paypal.Buttons({createOrder:function(data,actions){return actions.order.create({purchase_units:[{amount:{value:amount}}]})},onApprove:function(data,actions){return actions.order.capture().then((function(details){window.location.replace(SITE_URL+"/deposit/paypal-payment/success/"+btoa(details.purchase_units[0].amount.value))}))}}).render("#paypal-button-container"),$(".main-containt").find("#depositBank").length){function getBanks(){const bank=$("#bank").val();bank&&$.post({url:bankDetailsUrl,data:{_token:token,bank:bank}}).done((function({status:status,bank:{bank_name:bank_name,account_name:account_name,account_number:account_number},bank_logo:bank_logo}){if(status){$("#bank_name").html(bank_name),$("#account_name").html(account_name),$("#account_number").html(account_number);const logoSrc=bank_logo?`${bankLogoPath}/${bank_logo}`:`${defaultBankLogoPath}`;$("#bank_logo").html(`
`)}else $("#bank_name, #account_name, #account_number").html("")}))}$(window).on("load change",(function(){setTimeout((function(){getBanks()}),300)})),$("#depositBankForm").on("submit",(function(){$("#depositBankSubmitBtn").attr("disabled",!0),$(".spinner").removeClass("d-none"),$("#rightAngleSvgIcon").addClass("d-none"),$("#depositConfirmBackBtn").removeAttr("href"),$("#depositBankSubmitBtnText").text(confirmBtnText)}))}$(".main-containt").find("#depositConfirm").length&&$("#depositConfirmForm").on("submit",(function(){$("#depositConfirmBtn").attr("disabled",!0),$("#depositConfirmBackBtn").removeAttr("href"),$(".spinner").removeClass("d-none"),$("#rightAngleSvgIcon").addClass("d-none"),$("#depositConfirmBtnText").text(confirmBtnText)})),$(".main-containt").find("#depositSuccess").length&&$(document).ready((function(){window.history.pushState(null,"",window.location.href),window.onpopstate=function(){window.history.pushState(null,"",window.location.href)},$(document).on("keydown",(function(e){116==(e.which||e.keyCode)&&e.preventDefault()})),$(document).on("keydown",(function(e){82==e.keyCode&&e.ctrlKey&&e.preventDefault()}))}));