PageSourceSearch

https://zomwave.com/wp-content/plugins/airwallex-online-payments-g…/build/airwallex-card.min.js?ver=1.35.2

js zomwave.com collected 2026-10-04 04:02:24 UTC 11,040 bytes, 1 lines download raw bytes

1(()=>{"use strict";var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var r in a)e.o(a,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:a[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}));const t=window.jQuery;var a=e.n(t);const r=()=>a().ajax({url:awxCommonData.getCardData.url+"&security="+awxCommonData.getCardData.nonce,method:"GET",dataType:"json"});jQuery((function(e){const{env:t,locale:a,confirmationUrl:n,isOrderPayPage:c}=awxCommonData,i=c?"#order_review":"form.checkout",{autoCapture:o,errorMessage:l,incompleteMessage:s}=awxEmbeddedCardData,d=function(t){const a=e('input[name="save-card"]:checked').attr("id");return a&&(t+=t?"&":"",t+="token="+a),t};let m,u,x={},w=!0;const p=()=>{u=Airwallex.createElement("card",{autoCapture:o,allowedCardNetworks:["discover","visa","mastercard","maestro","unionpay","amex","jcb","diners"],style:{base:{fontSize:"14px","::placeholder":{color:"rgba(135, 142, 153, 1)"}}}}),u.mount("airwallex-card"),setInterval((function(){if(document.getElementById("airwallex-card")&&!document.querySelector("#airwallex-card iframe"))try{u.mount("airwallex-card")}catch(e){console.warn(e)}}),1e3),window.addEventListener("onError",(e=>{if(!e.detail)return;const{error:t}=e.detail;AirwallexClient.displayCheckoutError(i,String(l).replace("%s",t.message||""))})),b()},h=e=>{try{const t=JSON.parse(e);return t&&"object"==typeof t}catch(e){return!1}},y=e=>{if(-1===navigator.userAgent.indexOf("MSIE")&&!document.documentMode)return!0;e?.preventDefault()};e("form.checkout").on("checkout_place_order_airwallex_card",(function(){const t=e(this);return t.addClass("processing"),e.ajaxSetup({dataFilter:function(e,t){if("json"!==t)return e;if(h(e))return e;{const t=e.match(/{"result.*}/);null===t||h(t[0])&&(e=t[0])}return e}}),g(i),e.ajax({type:"POST",url:awxEmbeddedCardData.getCheckoutAjaxUrl,data:d(t.serialize()),dataType:"json"}).done((function(t){if(y(),e(".checkout-inline-error-message").remove(),"success"!==t.result){let e="Error processing checkout. Please try again.";return t.messages&&"string"==typeof t.messages&&(e=t.messages),void AirwallexClient.displayCheckoutError(i,e)}v(t,u)})).fail((function(t){e(i).unblock(),y(),AirwallexClient.displayCheckoutError(i,t.responseText)})),!1}));const _=async t=>{const a=await e.ajax({type:"GET",url:awxEmbeddedCardData.getCustomerClientSecretAjaxUrl});return await Airwallex.createPaymentConsent({customer_id:a.customer_id,client_secret:a.client_secret,element:u,next_triggered_by:t,currency:awxEmbeddedCardData.currency})};e(document.body).on("click","#place_order",(async function(t){if("airwallex_card"===e('input[name="payment_method"]:checked').val()){if(awxEmbeddedCardData.isAccountPage){t.preventDefault(),g("#payment");const a=e(".awx-alert");a.hide();try{await _("customer")}catch(t){const r=t;let n=r?.message;return"resource_already_exists"===r?.code&&(n=awxEmbeddedCardData.resourceAlreadyExistsMessage),e(".awx-alert .body").html(n),a.removeClass("awx-hidden").show(),void e("#payment").unblock()}return e("#add_payment_method").trigger("submit"),void e("#payment").unblock()}if(awxCommonData.isOrderPayPage){if(t.preventDefault(),window.location.search.includes("change_payment_method")){t.preventDefault();const a=e(".awx-alert");a.hide(),e("#place_order").prop("disabled",!0);try{const t=await _("merchant"),a=e("#order_review");a.find('input[name="is_change_payment_method"], input[name="awx_customer_id"], input[name="awx_consent_id"]').remove();[{name:"is_change_payment_method",value:"true"},{name:"awx_customer_id",value:t.customer_id},{name:"awx_consent_id",value:t.payment_consent_id}].forEach((t=>{e("<input>",{type:"hidden",name:t.name,value:t.value}).appendTo(a)})),a.trigger("submit")}catch(t){const r=t,n=r?.message;return e(".awx-alert .body").html(n),a.removeClass("awx-hidden").show(),void e("#place_order").prop("disabled",!1)}return}g(i),e.ajax({type:"POST",data:d(e("#order_review").serialize()),url:awxCommonData.processOrderPayUrl}).done((t=>{"success"===t.result?v(t,u):(e("#order_review").unblock(),AirwallexClient.displayCheckoutError(i,String(l).replace("%s",t.error||"")))})).fail((t=>{e("#order_review").unblock(),AirwallexClient.displayCheckoutError(i,String(l).replace("%s",t.statusText||""))}))}}}));const g=t=>{setTimeout((function(){e(t).block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}),50)},v=async(t,a)=>{if(!t||t.error)return AirwallexClient.displayCheckoutError(i,String(l).replace("%s","")),void e(i).unblock();if(t.redirect)return void(-1===t.redirect.indexOf("https://")||-1===t.redirect.indexOf("http://")?window.location.href=t.redirect:window.location.href=decodeURI(t.redirect));try{if(t.paymentMethodId){if(!w&&!awxEmbeddedCardData.isSkipCVCEnabled)return AirwallexClient.displayCheckoutError(i,awxEmbeddedCardData.CVCIsNotCompletedMessage),void e(i).unblock();const a={client_secret:t.clientSecret,billing:AirwallexClient.getBillingInformation(),customer_id:t.customerId,intent_id:t.paymentIntent,payment_method_id:t.paymentMethodId,payment_method_options:{card:{auto_capture:o}}};t.createConsent&&(a.currency=t.currency,a.payment_consent={merchant_trigger_reason:"scheduled",next_triggered_by:"merchant"}),await m.confirm(a)}else t.createConsent?await Airwallex.confirmPaymentIntent({intent_id:t.paymentIntent,customer_id:t.customerId,client_secret:t.clientSecret,currency:t.currency,element:a,payment_consent:{merchant_trigger_reason:"scheduled",next_triggered_by:"merchant"},billing:AirwallexClient.getBillingInformation()}):e("#airwallex-save").prop("checked")?await Airwallex.createPaymentConsent({intent_id:t.paymentIntent,customer_id:t.customerId,client_secret:t.clientSecret,currency:t.currency,element:a,next_triggered_by:"customer",billing:AirwallexClient.getBillingInformation()}):await Airwallex.confirmPaymentIntent({element:a,intent_id:t.paymentIntent,client_secret:t.clientSecret,payment_method:{card:{name:AirwallexClient.getCardHolderName()},billing:AirwallexClient.getBillingInformation()}})}catch(a){const r=a;if("invalid_status_for_operation"!==r?.code)return void e.ajax({url:awxCommonData.updateOrderStatusAfterPaymentDecline.url+"&security="+awxCommonData.updateOrderStatusAfterPaymentDecline.nonce+"&order_id="+t.orderId,method:"GET",dataType:"json",success:function(t){const a=t.success?r?.message||"":t.message;AirwallexClient.displayCheckoutError(i,String(l).replace("%s",a)),e(i).unblock()},error:function(t){let a=t.responseText;const r=t.responseJSON;r&&r.message&&(a=r.message),AirwallexClient.displayCheckoutError(i,String(l).replace("%s",a)),e(i).unblock()}})}
1let r=function(e,t,a){const r=new URL(e),n=new URLSearchParams(r.search);n.set("order_id",String(t)),n.set("intent_id",a);const c=document.getElementById("airwallex-save");return c&&c.checked&&n.set("is_airwallex_save_checked","true"),r.search=n.toString(),r.toString()}(n,t.orderId,t.paymentIntent);t.tokenId&&(r+="&token_id="+parseInt(String(t.tokenId),10)),location.href=r};awxCommonData&&((e,t,a)=>{const r=setInterval((()=>{window.Airwallex&&(clearInterval(r),Airwallex.init({env:e,locale:t,origin:window.location.origin}),a())}),1e3)})(t,a,p);const f=function(){e(".airwallex-container .new-card, .save-card input").removeAttr("checked"),e(".airwallex-container .save-card input").removeAttr("checked"),e(".airwallex-container .awx-new-card-title, #airwallex-card, .line.save, .cvc-title, .cvc-container").hide(),e(".airwallex-container .save-card label").css("font-weight",400)};e(document).on("change",'input[name="save-card"]',(function(){f(),e(this).prop("checked",!0),e("#airwallex-new-card").removeAttr("checked"),e(".cvc-title, .cvc-container").hide(),e(".airwallex-container label").css("font-weight",400);const t=e('input[name="save-card"]:checked').attr("id");e('label[for="'+t+'"]').css("font-weight",700);const a=e(".save-card-"+t+" .cvc-title, .save-card-"+t+" .cvc-container");x?.[t]?.is_hide_cvc_element?a.hide():a.show();let r=3;["amex","american express"].includes(x?.[t]?.type?.toLowerCase())&&(r=4),m&&Airwallex.destroyElement("cvc");m=Airwallex.createElement("cvc",{style:{base:{fontSize:"14px","::placeholder":{color:"rgba(135, 142, 153, 1)"}}},placeholder:awxEmbeddedCardData.CVC,cvcLength:r}),m.mount(t+"-cvc",{autoCapture:o}),w=!0,x?.[t]?.is_hide_cvc_element||(w=!1,m.on("change",(e=>{w=e.detail.complete})))})),e(document).on("change",'input[name="new-card"]',(function(){f(),e(".awx-new-card-title, #airwallex-card, .line.save").show(),e('label[for="airwallex-new-card"]').css("font-weight",700)}));let C=null;const b=async()=>{if(!e("#payment_method_airwallex_card").is(":checked"))return;if(!e(".airwallex-container .save-cards").length)return;if(!x||!Object.keys(x).length){g("#payment");const t=await e.ajax({type:"GET",url:awxEmbeddedCardData.getTokensAjaxUrl});e("#payment").unblock(),x=t.tokens}if(e(".payment_method_airwallex_card .wc-awx-checkbox-spinner").hide(),!x||!Object.keys(x).length)return e(".airwallex-container").removeClass("awx-hidden").show(),void e(".airwallex-container .new-card").hide();let t="";for(const e of Object.values(x)){let a=e.type.toLowerCase().replace(/\s+/g,"");"americanexpress"===a&&(a="amex"),"dinersclub"===a&&(a="diners"),t+=`       \n                <div class="save-card save-card-${e.id}">\n                    <div class="save-card-information line">\n                        <input type="radio" name="save-card" id="${e.id}"> \n                        <label for="${e.id}">\n                            <span>${e.formatted_type} •••• ${e.last4} (expires ${e.expiry_month}/${e.expiry_year.slice(-2)})</span> \n                            <img style="display: none;" data-type="${"card_"+a}" class="airwallex-card-icon" alt="Credit Card">\n                        </label> \n                    </div>\n                    <div class="cvc-title" style="display: none;">Security code</div>   \n                    <div id="${e.id}-cvc" class="cvc-container" style="display: none;"></div>    \n                </div>\n            `}e(".airwallex-container").removeClass("awx-hidden").show(),e(".airwallex-container .save-cards").html(t),e(".airwallex-container .new-card").removeClass("awx-hidden").show(),e('input[name="save-card"]').first().trigger("click");const a=t=>{e(".airwallex-card-icon").each((function(){const a=t[e(this).data("type")];a&&(e(this).attr("src",a),e(this).css("display","block"))}))};C?a(C):r().then((e=>{var t;C=e?.data?.logos,a(null!==(t=C)&&void 0!==t?t:{})}))};e(document).on("change","#payment_method_airwallex_card",b),e(document).on("updated_checkout",b);e(document).on("updated_checkout",(async()=>{const t=e("#awx-card-logos-classic");if(!t.length)return;const a=e=>{const a=Object.keys(e||{});if(!a.length)return;const r=a.map((t=>`<img src="${e[t]}" class="airwallex-card-icon" title="${t}">`)).join("");t.replaceWith(r)};C?a(C):r().then((e=>{C=e?.data?.logos,a(C)}))}))}))})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.