Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ! function(e) {
- var t = {};
- function n(a) {
- if (t[a]) return t[a].exports;
- var i = t[a] = {
- i: a,
- l: !1,
- exports: {}
- };
- return e[a].call(i.exports, i, i.exports, n), i.l = !0, i.exports
- }
- n.m = e, n.c = t, n.d = function(e, t, a) {
- n.o(e, t) || Object.defineProperty(e, t, {
- enumerable: !0,
- get: a
- })
- }, n.r = function(e) {
- "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {
- value: "Module"
- }), Object.defineProperty(e, "__esModule", {
- value: !0
- })
- }, n.t = function(e, t) {
- if (1 & t && (e = n(e)), 8 & t) return e;
- if (4 & t && "object" == typeof e && e && e.__esModule) return e;
- var a = Object.create(null);
- if (n.r(a), Object.defineProperty(a, "default", {
- enumerable: !0,
- value: e
- }), 2 & t && "string" != typeof e)
- for (var i in e) n.d(a, i, function(t) {
- return e[t]
- }.bind(null, i));
- return a
- }, n.n = function(e) {
- var t = e && e.__esModule ? function() {
- return e.default
- } : function() {
- return e
- };
- return n.d(t, "a", t), t
- }, n.o = function(e, t) {
- return Object.prototype.hasOwnProperty.call(e, t)
- }, n.p = "", n(n.s = 76)
- }({
- 0: function(e, t, n) {
- "use strict";
- function a(e) {
- return (a = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
- return typeof e
- } : function(e) {
- return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
- })(e)
- }
- e.exports = function(e) {
- "function" == typeof e ? e() : "object" === a(e) && Object.keys(e).forEach(function(t) {
- "function" == typeof e[t] && e[t]()
- })
- }
- },
- 76: function(e, t, n) {
- "use strict";
- var a = n(0);
- $(document).ready(function() {
- a(n(77))
- })
- },
- 77: function(e, t) {
- function n(e) {
- var t = {};
- return e ? t.cvc = $(".selected-payment #saved-payment-security-code").val() : (t.number = $("#cardNumber").val(), t.holderName = $("#holderName").val(), t.expiryMonth = $("#expirationMonth").val(), t.expiryYear = $("#expirationYear").val(), t.cvc = $("#securityCode").val()), t
- }
- function a(e, t) {
- var n, a = $("#adyenEncryptedData"),
- i = adyen.createEncryption(t),
- r = i.validate(e),
- o = $("#selectedCardID").val();
- return $("#invalidCardDetails").hide(), o && "" != o || e.expiryMonth && e.expiryYear || (r.valid = !1), r.valid ? (e.generationtime = $("#adyen_generationtime").val(), n = i.encrypt(e), a.val(n), !0) : (function(e) {
- for (var t in $("#holderName").removeClass("is-invalid"), $("#cardNumber").removeClass("is-invalid"), $("#expirationMonth").removeClass("is-invalid"), $("#expirationYear").removeClass("is-invalid"), $("#securityCode").removeClass("is-invalid"), e)
- if (!1 === e[t]) switch (t) {
- case "holderName":
- $("#holderName").addClass("is-invalid");
- break;
- case "number":
- $("#cardNumber").addClass("is-invalid");
- break;
- case "expiryMonth":
- $("#expirationMonth").addClass("is-invalid");
- break;
- case "expiryYear":
- $("#expirationYear").addClass("is-invalid");
- break;
- case "cvc":
- $("#securityCode").addClass("is-invalid")
- }
- $("#invalidCardDetails").show()
- }(r), !1)
- }
- function i() {
- var e;
- $("#paymentMethodsUl").empty(), "true" == $("#directoryLookup").val() && (e = function(e) {
- jQuery.each(e.AdyenHppPaymentMethods, function(t, n) {
- ! function(e, t, n) {
- var a = $("<li>").addClass("paymentMethod");
- a.append($("<input>").attr("id", "rb_" + e.name).attr("type", "radio").attr("name", "brandCode").attr("value", e.brandCode)), a.append($("<img>").addClass("paymentMethod_img").attr("src", t + e.brandCode + ".png")), a.append($("<label>").text(e.name).attr("for", "rb_" + e.name)), a.append($("<p>").text(n));
- var i = $("<div>").addClass("hppAdditionalFields").attr("id", "extraFields_" + e.brandCode).attr("style", "display:none");
- if (e.issuers) {
- var r = $("<select>").attr("id", "issuerList").attr("name", "issuerId");
- jQuery.each(e.issuers, function(e, t) {
- var t = $("<option>").attr("label", t.name).attr("value", t.issuerId);
- r.append(t)
- }), i.append(r), a.append(i)
- } - 1 !== $("#OpenInvoiceWhiteList").val().indexOf(e.brandCode) && a.append(i);
- $("#paymentMethodsUl").append(a)
- }(n, e.ImagePath, e.AdyenDescriptions[t].description)
- }), $("input[type=radio][name=brandCode]").change(function() {
- $(".hppAdditionalFields").hide(), $("#extraFields_" + $(this).val()).show()
- })
- }, $.ajax({
- url: "Adyen-GetPaymentMethods",
- type: "get",
- success: function(t) {
- e(t)
- }
- }))
- }
- $(document).ready(function() {
- i(), $('button[value="submit-payment"]').on("click", function(e) {
- if ("CREDIT_CARD" == $("#selectedPaymentOption").val()) {
- var t, i = {},
- r = "";
- if ($(".payment-information").data("is-new-payment") ? ($("#selectedCardID").val(""), r = function(e) {
- if (e && e.length > 4) return e.replace(/\d(?=\d{4})/g, "*");
- return ""
- }((t = n(!1)).number.replace(/\s/g, ""))) : ($("#selectedCardID").val($(".selected-payment").data("uuid")), t = n(!0), i = {
- enableValidations: !1
- }), "" === $(".selected-payment .saved-payment-security-code:visible").val()) return $(".cvv-invalid-feedback").removeClass("d-none"), !1;
- if ($(".cvv-invalid-feedback").addClass("d-none"), !a(t, i)) return !1;
- var o = $("#check-privacy").is(":checked");
- if ("" != $("#email").val() && o) {
- $("#cardNumber").val(r);
- ! function(e, t, n) {
- if ((n = JSON.parse($("#gtm_checkout_products").val())).length > 0)
- for (var a = 0; a < n.length; a++) !n[a].dimension6 && sessionStorage.getItem(n[a].id) ? n[a].dimension6 = sessionStorage.getItem(n[a].id) : n[a].dimension6 = "no";
- dataLayer.push({
- event: "checkout",
- ecommerce: {
- checkout: {
- actionField: {
- step: e,
- option: t
- },
- products: n
- }
- }
- })
- }(4, "PLACE ORDER")
- }
- }
- if ("Adyen" == $("#selectedPaymentOption").val() && "true" == $("#directoryLookup").val() && !$("input[name='brandCode']:checked").val()) return $("#requiredBrandCode").show(), !1;
- "Adyen" == $("#selectedPaymentOption").val() && $("input[name='brandCode']:checked").val() && ($("#adyenPaymentMethod").val($("input[name='brandCode']:checked").closest(".paymentMethod").find("label").text()), $("input[name='brandCode']:checked").parent().find("#issuerList").length ? $("#adyenIssuerName").val($("#issuerList :selected").attr("label")) : ($("#issuerList").val(""), $("#adyenIssuerName").val("")))
- }), $('button[value="add-new-payment"]').on("click", function(e) {
- return a(n(!1), {
- enableValidations: !0
- })
- })
- }), $('button[value="submit-shipping"]').on("click", function(e) {
- i()
- })
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement