Skip to content

Instantly share code, notes, and snippets.

@judgej
Last active February 4, 2017 11:44
Show Gist options
  • Select an option

  • Save judgej/5a75e540a477a0fe0db0 to your computer and use it in GitHub Desktop.

Select an option

Save judgej/5a75e540a477a0fe0db0 to your computer and use it in GitHub Desktop.

Revisions

  1. judgej revised this gist Feb 4, 2017. 1 changed file with 4616 additions and 2462 deletions.
    7,078 changes: 4,616 additions & 2,462 deletions sagepay.js
    4,616 additions, 2,462 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
  2. judgej revised this gist Dec 4, 2015. No changes.
  3. judgej revised this gist Nov 24, 2015. 1 changed file with 226 additions and 199 deletions.
    425 changes: 226 additions & 199 deletions sagepay.js
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    /*! sagepay 2015-09-16 */ ! function(a, b) {
    /*! sagepay 2015-11-10 */ ! function(a, b) {
    "object" == typeof module && "object" == typeof module.exports ? module.exports = a.document ? b(a, !0) : function(a) {
    if (!a.document) throw new Error("jQuery requires a window with a document");
    return b(a)
    @@ -202,7 +202,8 @@

    function G(a, b, c) {
    var d, e, f, g, h, i, j, k, l = this,
    m = {}, n = a.style,
    m = {},
    n = a.style,
    o = a.nodeType && xa(a),
    p = ra.get(a, "fxshow");
    c.queue || (h = _._queueHooks(a, "fx"), null == h.unqueued && (h.unqueued = 0, i = h.empty.fire, h.empty.fire = function() {
    @@ -254,7 +255,8 @@
    if (e) return !1;
    for (var b = Ya || D(), c = Math.max(0, j.startTime + j.duration - b), d = c / j.duration || 0, f = 1 - d, g = 0, i = j.tweens.length; i > g; g++) j.tweens[g].run(f);
    return h.notifyWith(a, [j, f, c]), 1 > f && i ? c : (h.resolveWith(a, [j]), !1)
    }, j = h.promise({
    },
    j = h.promise({
    elem: a,
    props: _.extend({}, b),
    opts: _.extend(!0, {
    @@ -305,7 +307,8 @@
    return "string" != typeof j || g || f[j] ? g ? !(i = j) : void 0 : (b.dataTypes.unshift(j), e(j), !1)
    }), i
    }
    var f = {}, g = a === tb;
    var f = {},
    g = a === tb;
    return e(b.dataTypes[0]) || !f["*"] && e("*")
    }

    @@ -339,7 +342,8 @@
    }

    function N(a, b, c, d) {
    var e, f, g, h, i, j = {}, k = a.dataTypes.slice();
    var e, f, g, h, i, j = {},
    k = a.dataTypes.slice();
    if (k[1])
    for (g in a.converters) j[g.toLowerCase()] = a.converters[g];
    for (f = k.shift(); f;)
    @@ -387,13 +391,16 @@
    S = Q.concat,
    T = Q.push,
    U = Q.indexOf,
    V = {}, W = V.toString,
    V = {},
    W = V.toString,
    X = V.hasOwnProperty,
    Y = {}, Z = a.document,
    Y = {},
    Z = a.document,
    $ = "2.1.3",
    _ = function(a, b) {
    return new _.fn.init(a, b)
    }, aa = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
    },
    aa = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
    ba = /^-ms-/,
    ca = /-([\da-z])/gi,
    da = function(a, b) {
    @@ -443,7 +450,8 @@
    sort: Q.sort,
    splice: Q.splice
    }, _.extend = _.fn.extend = function() {
    var a, b, c, d, e, f, g = arguments[0] || {}, h = 1,
    var a, b, c, d, e, f, g = arguments[0] || {},
    h = 1,
    i = arguments.length,
    j = !1;
    for ("boolean" == typeof g && (j = g, g = arguments[h] || {}, h++), "object" == typeof g || _.isFunction(g) || (g = {}), h === i && (g = this, h--); i > h; h++)
    @@ -711,12 +719,10 @@
    return a === b
    }, g, !0), j = n(function(a) {
    return aa(b, a) > -1
    }, g, !0), k = [
    function(a, c, d) {
    var e = !f && (d || c !== C) || ((b = c).nodeType ? i(a, c, d) : j(a, c, d));
    return b = null, e
    }
    ]; e > h; h++)
    }, g, !0), k = [function(a, c, d) {
    var e = !f && (d || c !== C) || ((b = c).nodeType ? i(a, c, d) : j(a, c, d));
    return b = null, e
    }]; e > h; h++)
    if (c = w.relative[a[h].type]) k = [n(o(k), c)];
    else {
    if (c = w.filter[a[h].type].apply(null, a[h].matches), c[N]) {
    @@ -775,7 +781,8 @@
    T = c(),
    U = function(a, b) {
    return a === b && (E = !0), 0
    }, V = 1 << 31,
    },
    V = 1 << 31,
    W = {}.hasOwnProperty,
    X = [],
    Y = X.pop,
    @@ -786,7 +793,8 @@
    for (var c = 0, d = a.length; d > c; c++)
    if (a[c] === b) return c;
    return -1
    }, ba = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
    },
    ba = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
    ca = "[\\x20\\t\\r\\n\\f]",
    da = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
    ea = da.replace("w", "w#"),
    @@ -808,7 +816,8 @@
    CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + ca + "*(even|odd|(([+-]|)(\\d*)n|)" + ca + "*(?:([+-]|)" + ca + "*(\\d+)|))" + ca + "*\\)|)", "i"),
    bool: new RegExp("^(?:" + ba + ")$", "i"),
    needsContext: new RegExp("^" + ca + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + ca + "*((?:-\\d)?\\d*)" + ca + "*\\)|)(?=[^-]|$)", "i")
    }, pa = /^(?:input|select|textarea|button)$/i,
    },
    pa = /^(?:input|select|textarea|button)$/i,
    qa = /^h\d$/i,
    ra = /^[^{]+\{\s*\[native \w/,
    sa = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
    @@ -818,7 +827,8 @@
    wa = function(a, b, c) {
    var d = "0x" + b - 65536;
    return d !== d || c ? b : 0 > d ? String.fromCharCode(d + 65536) : String.fromCharCode(d >> 10 | 55296, 1023 & d | 56320)
    }, xa = function() {
    },
    xa = function() {
    F()
    };
    try {
    @@ -1061,18 +1071,19 @@
    }),
    contains: d(function(a) {
    return a = a.replace(va, wa),
    function(b) {
    return (b.textContent || b.innerText || x(b)).indexOf(a) > -1
    }
    function(b) {
    return (b.textContent || b.innerText || x(b)).indexOf(a) > -1
    }
    }),
    lang: d(function(a) {
    return na.test(a || "") || b.error("unsupported lang: " + a), a = a.replace(va, wa).toLowerCase(),
    function(b) {
    var c;
    do
    if (c = I ? b.lang : b.getAttribute("xml:lang") || b.getAttribute("lang")) return c = c.toLowerCase(), c === a || 0 === c.indexOf(a + "-"); while ((b = b.parentNode) && 1 === b.nodeType);
    return !1
    }
    function(b) {
    var c;
    do
    if (c = I ? b.lang : b.getAttribute("xml:lang") || b.getAttribute("lang")) return c = c.toLowerCase(), c === a || 0 === c.indexOf(a + "-");
    while ((b = b.parentNode) && 1 === b.nodeType);
    return !1
    }
    }),
    target: function(b) {
    var c = a.location && a.location.hash;
    @@ -1082,7 +1093,7 @@
    return a === H
    },
    focus: function(a) {
    return a === G.activeElement && (!G.hasFocus || G.hasFocus()) && !! (a.type || a.href || ~a.tabIndex)
    return a === G.activeElement && (!G.hasFocus || G.hasFocus()) && !!(a.type || a.href || ~a.tabIndex)
    },
    enabled: function(a) {
    return a.disabled === !1
    @@ -1092,7 +1103,7 @@
    },
    checked: function(a) {
    var b = a.nodeName.toLowerCase();
    return "input" === b && !! a.checked || "option" === b && !! a.selected
    return "input" === b && !!a.checked || "option" === b && !!a.selected
    },
    selected: function(a) {
    return a.parentNode && a.parentNode.selectedIndex, a.selected === !0
    @@ -1147,16 +1158,16 @@
    }
    }, w.pseudos.nth = w.pseudos.eq;
    for (u in {
    radio: !0,
    checkbox: !0,
    file: !0,
    password: !0,
    image: !0
    }) w.pseudos[u] = h(u);
    radio: !0,
    checkbox: !0,
    file: !0,
    password: !0,
    image: !0
    }) w.pseudos[u] = h(u);
    for (u in {
    submit: !0,
    reset: !0
    }) w.pseudos[u] = i(u);
    submit: !0,
    reset: !0
    }) w.pseudos[u] = i(u);
    return l.prototype = w.filters = w.pseudos, w.setFilters = new l, z = b.tokenize = function(a, c) {
    var d, e, f, g, h, i, j, k = S[a + " "];
    if (k) return c ? 0 : k.slice(0);
    @@ -1165,7 +1176,7 @@
    value: d,
    type: e[0].replace(ia, " ")
    }), h = h.slice(d.length));
    for (g in w.filter)!(e = oa[g].exec(h)) || j[g] && !(e = j[g](e)) || (d = e.shift(), f.push({
    for (g in w.filter) !(e = oa[g].exec(h)) || j[g] && !(e = j[g](e)) || (d = e.shift(), f.push({
    value: d,
    type: g,
    matches: e
    @@ -1197,7 +1208,7 @@
    }
    }
    return (j || A(a, l))(d, b, !I, c, ta.test(a) && k(b.parentNode) || b), c
    }, v.sortStable = N.split("").sort(U).join("") === N, v.detectDuplicates = !! E, F(), v.sortDetached = e(function(a) {
    }, v.sortStable = N.split("").sort(U).join("") === N, v.detectDuplicates = !!E, F(), v.sortDetached = e(function(a) {
    return 1 & a.compareDocumentPosition(G.createElement("div"))
    }), e(function(a) {
    return a.innerHTML = "<a href='#'></a>", "#" === a.firstChild.getAttribute("href")
    @@ -1366,7 +1377,8 @@
    break
    }
    d = !1, i && (j ? j.length && k(j.shift()) : b ? i = [] : l.disable())
    }, l = {
    },
    l = {
    add: function() {
    if (i) {
    var c = i.length;
    @@ -1417,10 +1429,10 @@
    }, _.extend({
    Deferred: function(a) {
    var b = [
    ["resolve", "done", _.Callbacks("once memory"), "resolved"],
    ["reject", "fail", _.Callbacks("once memory"), "rejected"],
    ["notify", "progress", _.Callbacks("memory")]
    ],
    ["resolve", "done", _.Callbacks("once memory"), "resolved"],
    ["reject", "fail", _.Callbacks("once memory"), "rejected"],
    ["notify", "progress", _.Callbacks("memory")]
    ],
    c = "pending",
    d = {
    state: function() {
    @@ -1444,7 +1456,8 @@
    promise: function(a) {
    return null != a ? _.extend(a, d) : d
    }
    }, e = {};
    },
    e = {};
    return d.pipe = d.then, _.each(b, function(a, f) {
    var g = f[2],
    h = f[3];
    @@ -1494,8 +1507,8 @@
    e = !0;
    for (h in c) _.access(a, b, h, c[h], !0, f, g)
    } else if (void 0 !== d && (e = !0, _.isFunction(d) || (g = !0), j && (g ? (b.call(a, d), b = null) : (j = b, b = function(a, b, c) {
    return j.call(_(a), c)
    })), b))
    return j.call(_(a), c)
    })), b))
    for (; i > h; h++) b(a[h], c, g ? d : d.call(a[h], h, b(a[h], c)));
    return e ? a : j ? b.call(a) : i ? b(a[0], c) : f
    };
    @@ -1504,7 +1517,8 @@
    }, h.uid = 1, h.accepts = _.acceptData, h.prototype = {
    key: function(a) {
    if (!h.accepts(a)) return 0;
    var b = {}, c = a[this.expando];
    var b = {},
    c = a[this.expando];
    if (!c) {
    c = h.uid++;
    try {
    @@ -1656,12 +1670,13 @@
    wa = ["Top", "Right", "Bottom", "Left"],
    xa = function(a, b) {
    return a = b || a, "none" === _.css(a, "display") || !_.contains(a.ownerDocument, a)
    }, ya = /^(?:checkbox|radio)$/i;
    },
    ya = /^(?:checkbox|radio)$/i;
    ! function() {
    var a = Z.createDocumentFragment(),
    b = a.appendChild(Z.createElement("div")),
    c = Z.createElement("input");
    c.setAttribute("type", "radio"), c.setAttribute("checked", "checked"), c.setAttribute("name", "t"), b.appendChild(c), Y.checkClone = b.cloneNode(!0).cloneNode(!0).lastChild.checked, b.innerHTML = "<textarea>x</textarea>", Y.noCloneChecked = !! b.cloneNode(!0).lastChild.defaultValue
    c.setAttribute("type", "radio"), c.setAttribute("checked", "checked"), c.setAttribute("name", "t"), b.appendChild(c), Y.checkClone = b.cloneNode(!0).cloneNode(!0).lastChild.checked, b.innerHTML = "<textarea>x</textarea>", Y.noCloneChecked = !!b.cloneNode(!0).lastChild.defaultValue
    }();
    var za = "undefined";
    Y.focusinBubbles = "onfocusin" in a;
    @@ -1675,8 +1690,8 @@
    var f, g, h, i, j, k, l, m, n, o, p, q = ra.get(a);
    if (q)
    for (c.handler && (f = c, c = f.handler, e = f.selector), c.guid || (c.guid = _.guid++), (i = q.events) || (i = q.events = {}), (g = q.handle) || (g = q.handle = function(b) {
    return typeof _ !== za && _.event.triggered !== b.type ? _.event.dispatch.apply(a, arguments) : void 0
    }), b = (b || "").match(na) || [""], j = b.length; j--;) h = Da.exec(b[j]) || [], n = p = h[1], o = (h[2] || "").split(".").sort(), n && (l = _.event.special[n] || {}, n = (e ? l.delegateType : l.bindType) || n, l = _.event.special[n] || {}, k = _.extend({
    return typeof _ !== za && _.event.triggered !== b.type ? _.event.dispatch.apply(a, arguments) : void 0
    }), b = (b || "").match(na) || [""], j = b.length; j--;) h = Da.exec(b[j]) || [], n = p = h[1], o = (h[2] || "").split(".").sort(), n && (l = _.event.special[n] || {}, n = (e ? l.delegateType : l.bindType) || n, l = _.event.special[n] || {}, k = _.extend({
    type: n,
    origType: p,
    data: d,
    @@ -2001,7 +2016,8 @@
    },
    html: function(a) {
    return qa(this, function(a) {
    var b = this[0] || {}, c = 0,
    var b = this[0] || {},
    c = 0,
    d = this.length;
    if (void 0 === a && 1 === b.nodeType) return b.innerHTML;
    if ("string" == typeof a && !Ha.test(a) && !Ma[(Fa.exec(a) || ["", ""])[1].toLowerCase()]) {
    @@ -2054,7 +2070,8 @@
    return this.pushStack(d)
    }
    });
    var Na, Oa = {}, Pa = /^margin/,
    var Na, Oa = {},
    Pa = /^margin/,
    Qa = new RegExp("^(" + va + ")(?!px)[a-z%]+$", "i"),
    Ra = function(b) {
    return b.ownerDocument.defaultView.opener ? b.ownerDocument.defaultView.getComputedStyle(b, null) : a.getComputedStyle(b, null)
    @@ -2094,10 +2111,12 @@
    position: "absolute",
    visibility: "hidden",
    display: "block"
    }, Wa = {
    },
    Wa = {
    letterSpacing: "0",
    fontWeight: "400"
    }, Xa = ["Webkit", "O", "Moz", "ms"];
    },
    Xa = ["Webkit", "O", "Moz", "ms"];
    _.extend({
    cssHooks: {
    opacity: {
    @@ -2167,7 +2186,8 @@
    }), _.fn.extend({
    css: function(a, b) {
    return qa(this, function(a, b, c) {
    var d, e, f = {}, g = 0;
    var d, e, f = {},
    g = 0;
    if (_.isArray(b)) {
    for (d = Ra(a), e = b.length; e > g; g++) f[b[g]] = _.css(a, b[g], !1, d);
    return f
    @@ -2226,136 +2246,134 @@
    ab = /queueHooks$/,
    bb = [G],
    cb = {
    "*": [
    function(a, b) {
    var c = this.createTween(a, b),
    d = c.cur(),
    e = _a.exec(b),
    f = e && e[3] || (_.cssNumber[a] ? "" : "px"),
    g = (_.cssNumber[a] || "px" !== f && +d) && _a.exec(_.css(c.elem, a)),
    h = 1,
    i = 20;
    if (g && g[3] !== f) {
    f = f || g[3], e = e || [], g = +d || 1;
    do h = h || ".5", g /= h, _.style(c.elem, a, g + f); while (h !== (h = c.cur() / d) && 1 !== h && --i)
    }
    return e && (g = c.start = +g || +d || 0, c.unit = f, c.end = e[1] ? g + (e[1] + 1) * e[2] : +e[2]), c
    "*": [function(a, b) {
    var c = this.createTween(a, b),
    d = c.cur(),
    e = _a.exec(b),
    f = e && e[3] || (_.cssNumber[a] ? "" : "px"),
    g = (_.cssNumber[a] || "px" !== f && +d) && _a.exec(_.css(c.elem, a)),
    h = 1,
    i = 20;
    if (g && g[3] !== f) {
    f = f || g[3], e = e || [], g = +d || 1;
    do h = h || ".5", g /= h, _.style(c.elem, a, g + f); while (h !== (h = c.cur() / d) && 1 !== h && --i)
    }
    ]
    return e && (g = c.start = +g || +d || 0, c.unit = f, c.end = e[1] ? g + (e[1] + 1) * e[2] : +e[2]), c
    }]
    };
    _.Animation = _.extend(I, {
    tweener: function(a, b) {
    _.isFunction(a) ? (b = a, a = ["*"]) : a = a.split(" ");
    for (var c, d = 0, e = a.length; e > d; d++) c = a[d], cb[c] = cb[c] || [], cb[c].unshift(b)
    },
    prefilter: function(a, b) {
    b ? bb.unshift(a) : bb.push(a)
    }
    }), _.speed = function(a, b, c) {
    var d = a && "object" == typeof a ? _.extend({}, a) : {
    complete: c || !c && b || _.isFunction(a) && a,
    duration: a,
    easing: c && b || b && !_.isFunction(b) && b
    };
    return d.duration = _.fx.off ? 0 : "number" == typeof d.duration ? d.duration : d.duration in _.fx.speeds ? _.fx.speeds[d.duration] : _.fx.speeds._default, (null == d.queue || d.queue === !0) && (d.queue = "fx"), d.old = d.complete, d.complete = function() {
    _.isFunction(d.old) && d.old.call(this), d.queue && _.dequeue(this, d.queue)
    }, d
    }, _.fn.extend({
    fadeTo: function(a, b, c, d) {
    return this.filter(xa).css("opacity", 0).show().end().animate({
    opacity: b
    }, a, c, d)
    },
    animate: function(a, b, c, d) {
    var e = _.isEmptyObject(a),
    f = _.speed(b, c, d),
    g = function() {
    var b = I(this, _.extend({}, a), f);
    (e || ra.get(this, "finish")) && b.stop(!0)
    };
    return g.finish = g, e || f.queue === !1 ? this.each(g) : this.queue(f.queue, g)
    },
    stop: function(a, b, c) {
    var d = function(a) {
    var b = a.stop;
    delete a.stop, b(c)
    tweener: function(a, b) {
    _.isFunction(a) ? (b = a, a = ["*"]) : a = a.split(" ");
    for (var c, d = 0, e = a.length; e > d; d++) c = a[d], cb[c] = cb[c] || [], cb[c].unshift(b)
    },
    prefilter: function(a, b) {
    b ? bb.unshift(a) : bb.push(a)
    }
    }), _.speed = function(a, b, c) {
    var d = a && "object" == typeof a ? _.extend({}, a) : {
    complete: c || !c && b || _.isFunction(a) && a,
    duration: a,
    easing: c && b || b && !_.isFunction(b) && b
    };
    return "string" != typeof a && (c = b, b = a, a = void 0), b && a !== !1 && this.queue(a || "fx", []), this.each(function() {
    var b = !0,
    e = null != a && a + "queueHooks",
    f = _.timers,
    g = ra.get(this);
    if (e) g[e] && g[e].stop && d(g[e]);
    else
    for (e in g) g[e] && g[e].stop && ab.test(e) && d(g[e]);
    for (e = f.length; e--;) f[e].elem !== this || null != a && f[e].queue !== a || (f[e].anim.stop(c), b = !1, f.splice(e, 1));
    (b || !c) && _.dequeue(this, a)
    })
    },
    finish: function(a) {
    return a !== !1 && (a = a || "fx"), this.each(function() {
    var b, c = ra.get(this),
    d = c[a + "queue"],
    e = c[a + "queueHooks"],
    f = _.timers,
    g = d ? d.length : 0;
    for (c.finish = !0, _.queue(this, a, []), e && e.stop && e.stop.call(this, !0), b = f.length; b--;) f[b].elem === this && f[b].queue === a && (f[b].anim.stop(!0),
    f.splice(b, 1));
    for (b = 0; g > b; b++) d[b] && d[b].finish && d[b].finish.call(this);
    delete c.finish
    return d.duration = _.fx.off ? 0 : "number" == typeof d.duration ? d.duration : d.duration in _.fx.speeds ? _.fx.speeds[d.duration] : _.fx.speeds._default, (null == d.queue || d.queue === !0) && (d.queue = "fx"), d.old = d.complete, d.complete = function() {
    _.isFunction(d.old) && d.old.call(this), d.queue && _.dequeue(this, d.queue)
    }, d
    }, _.fn.extend({
    fadeTo: function(a, b, c, d) {
    return this.filter(xa).css("opacity", 0).show().end().animate({
    opacity: b
    }, a, c, d)
    },
    animate: function(a, b, c, d) {
    var e = _.isEmptyObject(a),
    f = _.speed(b, c, d),
    g = function() {
    var b = I(this, _.extend({}, a), f);
    (e || ra.get(this, "finish")) && b.stop(!0)
    };
    return g.finish = g, e || f.queue === !1 ? this.each(g) : this.queue(f.queue, g)
    },
    stop: function(a, b, c) {
    var d = function(a) {
    var b = a.stop;
    delete a.stop, b(c)
    };
    return "string" != typeof a && (c = b, b = a, a = void 0), b && a !== !1 && this.queue(a || "fx", []), this.each(function() {
    var b = !0,
    e = null != a && a + "queueHooks",
    f = _.timers,
    g = ra.get(this);
    if (e) g[e] && g[e].stop && d(g[e]);
    else
    for (e in g) g[e] && g[e].stop && ab.test(e) && d(g[e]);
    for (e = f.length; e--;) f[e].elem !== this || null != a && f[e].queue !== a || (f[e].anim.stop(c), b = !1, f.splice(e, 1));
    (b || !c) && _.dequeue(this, a)
    })
    },
    finish: function(a) {
    return a !== !1 && (a = a || "fx"), this.each(function() {
    var b, c = ra.get(this),
    d = c[a + "queue"],
    e = c[a + "queueHooks"],
    f = _.timers,
    g = d ? d.length : 0;
    for (c.finish = !0, _.queue(this, a, []), e && e.stop && e.stop.call(this, !0), b = f.length; b--;) f[b].elem === this && f[b].queue === a && (f[b].anim.stop(!0),
    f.splice(b, 1));
    for (b = 0; g > b; b++) d[b] && d[b].finish && d[b].finish.call(this);
    delete c.finish
    })
    }
    }), _.each(["toggle", "show", "hide"], function(a, b) {
    var c = _.fn[b];
    _.fn[b] = function(a, d, e) {
    return null == a || "boolean" == typeof a ? c.apply(this, arguments) : this.animate(E(b, !0), a, d, e)
    }
    }), _.each({
    slideDown: E("show"),
    slideUp: E("hide"),
    slideToggle: E("toggle"),
    fadeIn: {
    opacity: "show"
    },
    fadeOut: {
    opacity: "hide"
    },
    fadeToggle: {
    opacity: "toggle"
    }
    }, function(a, b) {
    _.fn[a] = function(a, c, d) {
    return this.animate(b, a, c, d)
    }
    }), _.timers = [], _.fx.tick = function() {
    var a, b = 0,
    c = _.timers;
    for (Ya = _.now(); b < c.length; b++) a = c[b], a() || c[b] !== a || c.splice(b--, 1);
    c.length || _.fx.stop(), Ya = void 0
    }, _.fx.timer = function(a) {
    _.timers.push(a), a() ? _.fx.start() : _.timers.pop()
    }, _.fx.interval = 13, _.fx.start = function() {
    Za || (Za = setInterval(_.fx.tick, _.fx.interval))
    }, _.fx.stop = function() {
    clearInterval(Za), Za = null
    }, _.fx.speeds = {
    slow: 600,
    fast: 200,
    _default: 400
    }, _.fn.delay = function(a, b) {
    return a = _.fx ? _.fx.speeds[a] || a : a, b = b || "fx", this.queue(b, function(b, c) {
    var d = setTimeout(b, a);
    c.stop = function() {
    clearTimeout(d)
    }
    })
    }
    }), _.each(["toggle", "show", "hide"], function(a, b) {
    var c = _.fn[b];
    _.fn[b] = function(a, d, e) {
    return null == a || "boolean" == typeof a ? c.apply(this, arguments) : this.animate(E(b, !0), a, d, e)
    }
    }), _.each({
    slideDown: E("show"),
    slideUp: E("hide"),
    slideToggle: E("toggle"),
    fadeIn: {
    opacity: "show"
    },
    fadeOut: {
    opacity: "hide"
    },
    fadeToggle: {
    opacity: "toggle"
    }
    }, function(a, b) {
    _.fn[a] = function(a, c, d) {
    return this.animate(b, a, c, d)
    }
    }), _.timers = [], _.fx.tick = function() {
    var a, b = 0,
    c = _.timers;
    for (Ya = _.now(); b < c.length; b++) a = c[b], a() || c[b] !== a || c.splice(b--, 1);
    c.length || _.fx.stop(), Ya = void 0
    }, _.fx.timer = function(a) {
    _.timers.push(a), a() ? _.fx.start() : _.timers.pop()
    }, _.fx.interval = 13, _.fx.start = function() {
    Za || (Za = setInterval(_.fx.tick, _.fx.interval))
    }, _.fx.stop = function() {
    clearInterval(Za), Za = null
    }, _.fx.speeds = {
    slow: 600,
    fast: 200,
    _default: 400
    }, _.fn.delay = function(a, b) {
    return a = _.fx ? _.fx.speeds[a] || a : a, b = b || "fx", this.queue(b, function(b, c) {
    var d = setTimeout(b, a);
    c.stop = function() {
    clearTimeout(d)
    }
    })
    },
    function() {
    var a = Z.createElement("input"),
    b = Z.createElement("select"),
    c = b.appendChild(Z.createElement("option"));
    a.type = "checkbox", Y.checkOn = "" !== a.value, Y.optSelected = c.selected, b.disabled = !0, Y.optDisabled = !c.disabled, a = Z.createElement("input"), a.value = "t", a.type = "radio", Y.radioValue = "t" === a.value
    }();
    function() {
    var a = Z.createElement("input"),
    b = Z.createElement("select"),
    c = b.appendChild(Z.createElement("option"));
    a.type = "checkbox", Y.checkOn = "" !== a.value, Y.optSelected = c.selected, b.disabled = !0, Y.optDisabled = !c.disabled, a = Z.createElement("input"), a.value = "t", a.type = "radio", Y.radioValue = "t" === a.value
    }();
    var db, eb, fb = _.expr.attrHandle;
    _.fn.extend({
    attr: function(a, b) {
    @@ -2565,7 +2583,9 @@
    pb = /^(?:GET|HEAD)$/,
    qb = /^\/\//,
    rb = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
    sb = {}, tb = {}, ub = "*/".concat("*"),
    sb = {},
    tb = {},
    ub = "*/".concat("*"),
    vb = a.location.href,
    wb = rb.exec(vb.toLowerCase()) || [];
    _.extend({
    @@ -2624,7 +2644,10 @@
    n = l.context && (m.nodeType || m.jquery) ? _(m) : _.event,
    o = _.Deferred(),
    p = _.Callbacks("once memory"),
    q = l.statusCode || {}, r = {}, s = {}, t = 0,
    q = l.statusCode || {},
    r = {},
    s = {},
    t = 0,
    u = "canceled",
    v = {
    readyState: 0,
    @@ -2666,10 +2689,10 @@
    if (l.beforeSend && (l.beforeSend.call(m, v, l) === !1 || 2 === t)) return v.abort();
    u = "abort";
    for (k in {
    success: 1,
    error: 1,
    complete: 1
    }) v[k](l[k]);
    success: 1,
    error: 1,
    complete: 1
    }) v[k](l[k]);
    if (d = K(tb, l, b, v)) {
    v.readyState = 1, j && n.trigger("ajaxSend", [v, l]), l.async && l.timeout > 0 && (h = setTimeout(function() {
    v.abort("timeout")
    @@ -2789,13 +2812,15 @@
    } catch (a) {}
    };
    var Cb = 0,
    Db = {}, Eb = {
    Db = {},
    Eb = {
    0: 200,
    1223: 204
    }, Fb = _.ajaxSettings.xhr();
    },
    Fb = _.ajaxSettings.xhr();
    a.attachEvent && a.attachEvent("onunload", function() {
    for (var a in Db) Db[a]()
    }), Y.cors = !! Fb && "withCredentials" in Fb, Y.ajax = Fb = !! Fb, _.ajaxTransport(function(a) {
    }), Y.cors = !!Fb && "withCredentials" in Fb, Y.ajax = Fb = !!Fb, _.ajaxTransport(function(a) {
    var b;
    return Y.cors || Fb && !a.crossDomain ? {
    send: function(c, d) {
    @@ -2920,7 +2945,8 @@
    e = {
    top: 0,
    left: 0
    }, f = d && d.ownerDocument;
    },
    f = d && d.ownerDocument;
    return f ? (b = f.documentElement, _.contains(b, d) ? (typeof d.getBoundingClientRect !== za && (e = d.getBoundingClientRect()), c = P(f), {
    top: e.top + c.pageYOffset - b.clientTop,
    left: e.left + c.pageXOffset - b.clientLeft
    @@ -3050,13 +3076,14 @@ var $sagepayJQuery = jQuery.noConflict(),
    "class": "form-group"
    });
    f.append($sagepayJQuery("<label>", {
    "class": "col-sm-2 control-label"
    "class": "col-sm-3 control-label"
    }).text(d[e]));
    var g = $sagepayJQuery("<div/>", {
    "class": "col-sm-10"
    "class": "col-sm-5"
    });
    g.append($sagepayJQuery("<input/>", {
    type: "text"
    type: "text",
    "class": "form-control"
    }).attr("data-sagepay", d[e])), g.append($sagepayJQuery("<span></span>", {
    "class": "error text-danger"
    })), f.append(g), c.append(f)
    @@ -3066,9 +3093,9 @@ var $sagepayJQuery = jQuery.noConflict(),
    "class": "form-group"
    });
    h.append($sagepayJQuery("<div>", {
    "class": "col-sm-offset-2 col-sm-10"
    "class": "col-sm-offset-3 col-sm-3"
    }).append($sagepayJQuery("<button/>", {
    "class": "submit",
    "class": "btn btn-default",
    type: "submit"
    }).text("Submit Payment"))), c.append(h), $sagepayJQuery(a).html(c)
    },
    @@ -3089,4 +3116,4 @@ var $sagepayJQuery = jQuery.noConflict(),
    }
    }
    };
    "undefined" != typeof exports && (module.exports = Sagepay);
    "undefined" != typeof exports && (module.exports = Sagepay);
  4. judgej revised this gist Sep 28, 2015. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions sagepay.js
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    /*! sagepay 2015-09-08 */ ! function(a, b) {
    /*! sagepay 2015-09-16 */ ! function(a, b) {
    "object" == typeof module && "object" == typeof module.exports ? module.exports = a.document ? b(a, !0) : function(a) {
    if (!a.document) throw new Error("jQuery requires a window with a document");
    return b(a)
    @@ -3004,7 +3004,6 @@ var $sagepayJQuery = jQuery.noConflict(),
    j = {
    amount: h,
    currency: i,
    "3DSecure": !1,
    cardDetails: {
    cardholderName: d,
    cardNumber: e,
  5. judgej revised this gist Sep 28, 2015. No changes.
  6. judgej created this gist Sep 20, 2015.
    3,093 changes: 3,093 additions & 0 deletions sagepay.js
    3,093 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.