run:R W Run
DIR
2026-04-08 19:41:33
R W Run
DIR
2026-04-08 19:29:28
R W Run
38.7 KB
2026-04-08 19:26:24
R W Run
1.49 KB
2026-04-08 19:26:23
R W Run
4.72 KB
2026-04-08 19:26:25
R W Run
3.02 KB
2026-04-08 19:26:25
R W Run
10.78 KB
2026-04-08 19:26:25
R W Run
7.35 KB
2026-04-08 19:26:23
R W Run
11.6 KB
2026-04-08 19:26:22
R W Run
10.43 KB
2026-04-08 19:26:24
R W Run
26.35 KB
2026-04-08 19:26:25
R W Run
12.68 KB
2026-04-08 19:26:24
R W Run
1.94 KB
2026-04-08 19:26:24
R W Run
7.14 KB
2026-04-08 19:26:24
R W Run
1.16 KB
2026-04-08 19:26:24
R W Run
4.77 KB
2026-04-08 19:26:22
R W Run
3.56 KB
2026-04-08 19:26:24
R W Run
5.43 KB
2026-04-08 19:26:23
R W Run
4.04 KB
2026-04-08 19:26:23
R W Run
11.09 KB
2026-04-08 19:26:23
R W Run
10.93 KB
2026-04-08 19:26:25
R W Run
8.78 KB
2026-04-08 19:26:23
R W Run
3.09 KB
2026-04-08 19:26:22
R W Run
38.75 KB
2026-04-08 19:26:24
R W Run
4.62 KB
2026-04-08 19:26:24
R W Run
1.9 KB
2026-04-08 19:26:24
R W Run
23.06 KB
2026-04-08 19:26:23
R W Run
6.79 KB
2026-04-08 19:26:22
R W Run
72.3 KB
2026-04-08 19:26:24
R W Run
42 By
2026-04-08 19:26:23
R W Run
69.61 KB
2026-04-08 19:26:23
R W Run
35.35 KB
2026-04-08 19:26:22
R W Run
425.48 KB
2026-04-08 19:26:25
R W Run
77.13 KB
2026-04-08 19:26:24
R W Run
1.42 KB
2026-04-08 19:26:22
R W Run
20.26 KB
2026-04-08 19:26:25
R W Run
94.89 KB
2026-04-08 19:26:24
R W Run
22.42 KB
2026-04-08 19:26:24
R W Run
18.09 KB
2026-04-08 19:26:23
R W Run
4.6 KB
2026-04-08 19:26:23
R W Run
3.56 KB
2026-04-08 19:26:24
R W Run
16.76 KB
2026-04-08 19:26:24
R W Run
5.18 KB
2026-04-08 19:26:23
R W Run
31.03 KB
2026-04-08 19:26:25
R W Run
96.29 KB
2026-04-08 19:26:25
R W Run
41.33 KB
2026-04-08 19:26:22
R W Run
2.76 KB
2026-04-08 19:26:25
R W Run
error_log
📄jquery.payment.js
1// Generated by CoffeeScript 1.7.1
2(function() {
3 var $, checkSupportedCard, cardFromNumber, cardFromType, defaultFormat, formatBackCardNumber, formatBackExpiry, formatCardNumber, formatExpiry, formatForwardExpiry, formatForwardSlashAndSpace, hasTextSelected, luhnCheck, reFormatCVC, reFormatCardNumber, reFormatExpiry, reFormatNumeric, replaceFullWidthChars, restrictCVC, restrictCardNumber, restrictExpiry, restrictNumeric, safeVal, setCardType,
4 __slice = [].slice,
5 __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
6
7 $ = window.jQuery || window.Zepto || window.$;
8
9 $.payment = {};
10
11 $.payment.fn = {};
12
13 $.payment.supportedCardTypes = [];
14
15 $.fn.payment = function() {
16 var args, method;
17 method = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
18 return $.payment.fn[method].apply(this, args);
19 };
20
21 defaultFormat = /(\d{1,4})/g;
22
23 $.payment.cards = [
24 {
25 type: 'maestro',
26 patterns: [5018, 502, 503, 506, 56, 58, 639, 6220, 67],
27 format: defaultFormat,
28 length: [12, 13, 14, 15, 16, 17, 18, 19],
29 cvcLength: [3],
30 luhn: true
31 }, {
32 type: 'forbrugsforeningen',
33 patterns: [600],
34 format: defaultFormat,
35 length: [16],
36 cvcLength: [3],
37 luhn: true
38 }, {
39 type: 'dankort',
40 patterns: [5019],
41 format: defaultFormat,
42 length: [16],
43 cvcLength: [3],
44 luhn: true
45 }, {
46 type: 'visa',
47 patterns: [4],
48 format: defaultFormat,
49 length: [13, 16],
50 cvcLength: [3],
51 luhn: true
52 }, {
53 type: 'mastercard',
54 patterns: [51, 52, 53, 54, 55, 22, 23, 24, 25, 26, 27],
55 format: defaultFormat,
56 length: [16],
57 cvcLength: [3],
58 luhn: true
59 }, {
60 type: 'amex',
61 patterns: [34, 37],
62 format: /(\d{1,4})(\d{1,6})?(\d{1,5})?/,
63 length: [15],
64 cvcLength: [3, 4],
65 luhn: true
66 }, {
67 type: 'dinersclub',
68 patterns: [30, 36, 38, 39],
69 format: /(\d{1,4})(\d{1,6})?(\d{1,4})?/,
70 length: [14],
71 cvcLength: [3],
72 luhn: true
73 }, {
74 type: 'discover',
75 patterns: [60, 64, 65, 622],
76 format: defaultFormat,
77 length: [16],
78 cvcLength: [3],
79 luhn: true
80 }, {
81 type: 'unionpay',
82 patterns: [62, 88],
83 format: defaultFormat,
84 length: [16, 17, 18, 19],
85 cvcLength: [3],
86 luhn: false
87 }, {
88 type: 'jcb',
89 patterns: [35],
90 format: defaultFormat,
91 length: [16],
92 cvcLength: [3],
93 luhn: true
94 }
95 ];
96
97 checkSupportedCard = function(cardType)
98 {
99 return ($.payment.supportedCardTypes.indexOf(cardType) !== -1);
100 };
101
102 cardFromNumber = function(num) {
103 var card, p, pattern, _i, _j, _len, _len1, _ref,
104 cards = $.payment.cards;
105 num = (num + '').replace(/\D/g, '');
106 for (_i = 0, _len = cards.length; _i < _len; _i++) {
107 card = cards[_i];
108 _ref = card.patterns;
109 for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
110 pattern = _ref[_j];
111 p = pattern + '';
112 if (num.substr(0, p.length) === p) {
113 return card;
114 }
115 }
116 }
117 };
118
119 cardFromType = function(type) {
120 var card, _i, _len,
121 cards = $.payment.cards;
122 for (_i = 0, _len = cards.length; _i < _len; _i++) {
123 card = cards[_i];
124 if (card.type === type) {
125 if (!checkSupportedCard(type)) {
126 return 'unsupported';
127 }
128 return card;
129 }
130 }
131 };
132
133 luhnCheck = function(num) {
134 var digit, digits, odd, sum, _i, _len;
135 odd = true;
136 sum = 0;
137 digits = (num + '').split('').reverse();
138 for (_i = 0, _len = digits.length; _i < _len; _i++) {
139 digit = digits[_i];
140 digit = parseInt(digit, 10);
141 if ((odd = !odd)) {
142 digit *= 2;
143 }
144 if (digit > 9) {
145 digit -= 9;
146 }
147 sum += digit;
148 }
149 return sum % 10 === 0;
150 };
151
152 hasTextSelected = function($target) {
153 var _ref;
154 if (($target.prop('selectionStart') != null) && $target.prop('selectionStart') !== $target.prop('selectionEnd')) {
155 return true;
156 }
157 if ((typeof document !== "undefined" && document !== null ? (_ref = document.selection) != null ? _ref.createRange : void 0 : void 0) != null) {
158 if (document.selection.createRange().text) {
159 return true;
160 }
161 }
162 return false;
163 };
164
165 safeVal = function(value, $target) {
166 var currPair, cursor, digit, error, last, prevPair;
167 try {
168 cursor = $target.prop('selectionStart');
169 } catch (_error) {
170 error = _error;
171 cursor = null;
172 }
173 last = $target.val();
174 $target.val(value);
175 if (cursor !== null && $target.is(":focus")) {
176 if (cursor === last.length) {
177 cursor = value.length;
178 }
179 if (last !== value) {
180 prevPair = last.slice(cursor - 1, +cursor + 1 || 9e9);
181 currPair = value.slice(cursor - 1, +cursor + 1 || 9e9);
182 digit = value[cursor];
183 if (/\d/.test(digit) && prevPair === ("" + digit + " ") && currPair === (" " + digit)) {
184 cursor = cursor + 1;
185 }
186 }
187 $target.prop('selectionStart', cursor);
188 return $target.prop('selectionEnd', cursor);
189 }
190 };
191
192 replaceFullWidthChars = function(str) {
193 var chars, chr, fullWidth, halfWidth, idx, value, _i, _len;
194 if (str == null) {
195 str = '';
196 }
197 fullWidth = '\uff10\uff11\uff12\uff13\uff14\uff15\uff16\uff17\uff18\uff19';
198 halfWidth = '0123456789';
199 value = '';
200 chars = str.split('');
201 for (_i = 0, _len = chars.length; _i < _len; _i++) {
202 chr = chars[_i];
203 idx = fullWidth.indexOf(chr);
204 if (idx > -1) {
205 chr = halfWidth[idx];
206 }
207 value += chr;
208 }
209 return value;
210 };
211
212 reFormatNumeric = function(e) {
213 var $target;
214 $target = $(e.currentTarget);
215 return setTimeout(function() {
216 var value;
217 value = $target.val();
218 value = replaceFullWidthChars(value);
219 value = value.replace(/\D/g, '');
220 return safeVal(value, $target);
221 });
222 };
223
224 reFormatCardNumber = function(e) {
225 var $target;
226 $target = $(e.currentTarget);
227 return setTimeout(function() {
228 var value;
229 value = $target.val();
230 value = replaceFullWidthChars(value);
231 value = $.payment.formatCardNumber(value);
232 return safeVal(value, $target);
233 });
234 };
235
236 formatCardNumber = function(e) {
237 var $target, card, digit, length, re, upperLength, value;
238 digit = String.fromCharCode(e.which);
239 if (!/^\d+$/.test(digit)) {
240 return;
241 }
242 $target = $(e.currentTarget);
243 value = $target.val();
244 card = cardFromNumber(value + digit);
245 length = (value.replace(/\D/g, '') + digit).length;
246 upperLength = 16;
247 if (card) {
248 upperLength = card.length[card.length.length - 1];
249 }
250 if (length >= upperLength) {
251 return;
252 }
253 if (($target.prop('selectionStart') != null) && $target.prop('selectionStart') !== value.length) {
254 return;
255 }
256 if (card && card.type === 'amex') {
257 re = /^(\d{4}|\d{4}\s\d{6})$/;
258 } else {
259 re = /(?:^|\s)(\d{4})$/;
260 }
261 if (re.test(value)) {
262 e.preventDefault();
263 return setTimeout(function() {
264 return $target.val(value + ' ' + digit);
265 });
266 } else if (re.test(value + digit)) {
267 e.preventDefault();
268 return setTimeout(function() {
269 return $target.val(value + digit + ' ');
270 });
271 }
272 };
273
274 formatBackCardNumber = function(e) {
275 var $target, value;
276 $target = $(e.currentTarget);
277 value = $target.val();
278 if (e.which !== 8) {
279 return;
280 }
281 if (($target.prop('selectionStart') != null) && $target.prop('selectionStart') !== value.length) {
282 return;
283 }
284 if (/\d\s$/.test(value)) {
285 e.preventDefault();
286 return setTimeout(function() {
287 return $target.val(value.replace(/\d\s$/, ''));
288 });
289 } else if (/\s\d?$/.test(value)) {
290 e.preventDefault();
291 return setTimeout(function() {
292 return $target.val(value.replace(/\d$/, ''));
293 });
294 }
295 };
296
297 reFormatExpiry = function(e) {
298 var $target;
299 $target = $(e.currentTarget);
300 return setTimeout(function() {
301 var value;
302 value = $target.val();
303 value = replaceFullWidthChars(value);
304 value = $.payment.formatExpiry(value);
305 return safeVal(value, $target);
306 });
307 };
308
309 formatExpiry = function(e) {
310 var $target, digit, val;
311 digit = String.fromCharCode(e.which);
312 if (!/^\d+$/.test(digit)) {
313 return;
314 }
315 $target = $(e.currentTarget);
316 val = $target.val() + digit;
317 if (/^\d$/.test(val) && (val !== '0' && val !== '1')) {
318 e.preventDefault();
319 return setTimeout(function() {
320 return $target.val("0" + val + " / ");
321 });
322 } else if (/^\d\d$/.test(val)) {
323 e.preventDefault();
324 return setTimeout(function() {
325 var m1, m2;
326 m1 = parseInt(val[0], 10);
327 m2 = parseInt(val[1], 10);
328 if (m2 > 2 && m1 !== 0) {
329 return $target.val("0" + m1 + " / " + m2);
330 } else {
331 return $target.val("" + val + " / ");
332 }
333 });
334 }
335 };
336
337 formatForwardExpiry = function(e) {
338 var $target, digit, val;
339 digit = String.fromCharCode(e.which);
340 if (!/^\d+$/.test(digit)) {
341 return;
342 }
343 $target = $(e.currentTarget);
344 val = $target.val();
345 if (/^\d\d$/.test(val)) {
346 return $target.val("" + val + " / ");
347 }
348 };
349
350 formatForwardSlashAndSpace = function(e) {
351 var $target, val, which;
352 which = String.fromCharCode(e.which);
353 if (!(which === '/' || which === ' ')) {
354 return;
355 }
356 $target = $(e.currentTarget);
357 val = $target.val();
358 if (/^\d$/.test(val) && val !== '0') {
359 return $target.val("0" + val + " / ");
360 }
361 };
362
363 formatBackExpiry = function(e) {
364 var $target, value;
365 $target = $(e.currentTarget);
366 value = $target.val();
367 if (e.which !== 8) {
368 return;
369 }
370 if (($target.prop('selectionStart') != null) && $target.prop('selectionStart') !== value.length) {
371 return;
372 }
373 if (/\d\s\/\s$/.test(value)) {
374 e.preventDefault();
375 return setTimeout(function() {
376 return $target.val(value.replace(/\d\s\/\s$/, ''));
377 });
378 }
379 };
380
381 reFormatCVC = function(e) {
382 var $target;
383 $target = $(e.currentTarget);
384 return setTimeout(function() {
385 var value;
386 value = $target.val();
387 value = replaceFullWidthChars(value);
388 value = value.replace(/\D/g, '').slice(0, 4);
389 return safeVal(value, $target);
390 });
391 };
392
393 restrictNumeric = function(e) {
394 var input;
395 if (e.metaKey || e.ctrlKey) {
396 return true;
397 }
398 if (e.which === 32) {
399 return false;
400 }
401 if (e.which === 0) {
402 return true;
403 }
404 if (e.which < 33) {
405 return true;
406 }
407 input = String.fromCharCode(e.which);
408 return !!/[\d\s]/.test(input);
409 };
410
411 restrictCardNumber = function(e) {
412 var $target, card, digit, value;
413 $target = $(e.currentTarget);
414 digit = String.fromCharCode(e.which);
415 if (!/^\d+$/.test(digit)) {
416 return;
417 }
418 if (hasTextSelected($target)) {
419 return;
420 }
421 value = ($target.val() + digit).replace(/\D/g, '');
422 card = cardFromNumber(value);
423 if (card) {
424 return value.length <= card.length[card.length.length - 1];
425 } else {
426 return value.length <= 16;
427 }
428 };
429
430 restrictExpiry = function(e) {
431 var $target, digit, value;
432 $target = $(e.currentTarget);
433 digit = String.fromCharCode(e.which);
434 if (!/^\d+$/.test(digit)) {
435 return;
436 }
437 if (hasTextSelected($target)) {
438 return;
439 }
440 value = $target.val() + digit;
441 value = value.replace(/\D/g, '');
442 if (value.length > 6) {
443 return false;
444 }
445 };
446
447 restrictCVC = function(e) {
448 var $target, digit, val;
449 $target = $(e.currentTarget);
450 digit = String.fromCharCode(e.which);
451 if (!/^\d+$/.test(digit)) {
452 return;
453 }
454 if (hasTextSelected($target)) {
455 return;
456 }
457 val = $target.val() + digit;
458 return val.length <= 4;
459 };
460
461 setCardType = function(e) {
462 var $target, allTypes, card, cardType, val,
463 cards = $.payment.cards;
464 $target = $(e.currentTarget);
465 val = $target.val();
466 $.payment.addSupportedCards($target.data('supported-cards'));
467 cardType = $.payment.cardType(val) || 'unknown';
468 if (!$target.hasClass(cardType)) {
469 allTypes = (function() {
470 var _i, _len, _results;
471 _results = [];
472 for (_i = 0, _len = cards.length; _i < _len; _i++) {
473 card = cards[_i];
474 _results.push(card.type);
475 }
476 return _results;
477 })();
478 $target.removeClass('unknown unsupported');
479 $target.removeClass(allTypes.join(' '));
480 if (val.length) {
481 $target.addClass(cardType);
482 $target.toggleClass('identified', (cardType !== 'unknown' && cardType !== 'unsupported'));
483 return $target.trigger('payment.cardType', cardType);
484 }
485 return false;
486 }
487 };
488
489 $.payment.fn.formatCardCVC = function() {
490 this.on('keypress', restrictNumeric);
491 this.on('keypress', restrictCVC);
492 this.on('paste', reFormatCVC);
493 this.on('change', reFormatCVC);
494 this.on('input', reFormatCVC);
495 return this;
496 };
497
498 $.payment.fn.formatCardExpiry = function() {
499 this.on('keypress', restrictNumeric);
500 this.on('keypress', restrictExpiry);
501 this.on('keypress', formatExpiry);
502 this.on('keypress', formatForwardSlashAndSpace);
503 this.on('keypress', formatForwardExpiry);
504 this.on('keydown', formatBackExpiry);
505 this.on('change', reFormatExpiry);
506 this.on('input', reFormatExpiry);
507 return this;
508 };
509
510 $.payment.fn.formatCardNumber = function() {
511 this.on('keypress', restrictNumeric);
512 this.on('keypress', restrictCardNumber);
513 this.on('keypress', formatCardNumber);
514 this.on('keydown', formatBackCardNumber);
515 this.on('keyup', setCardType);
516 this.on('paste', reFormatCardNumber);
517 this.on('change', reFormatCardNumber);
518 this.on('input', reFormatCardNumber);
519 this.on('input', setCardType);
520 return this;
521 };
522
523 $.payment.fn.restrictNumeric = function() {
524 this.on('keypress', restrictNumeric);
525 this.on('paste', reFormatNumeric);
526 this.on('change', reFormatNumeric);
527 this.on('input', reFormatNumeric);
528 return this;
529 };
530
531 $.payment.fn.cardExpiryVal = function() {
532 return $.payment.cardExpiryVal($(this).val());
533 };
534
535 $.payment.cardExpiryVal = function(value) {
536 var month, prefix, year, _ref;
537 _ref = value.split(/[\s\/]+/, 2), month = _ref[0], year = _ref[1];
538 if ((year != null ? year.length : void 0) === 2 && /^\d+$/.test(year)) {
539 prefix = (new Date).getFullYear();
540 prefix = prefix.toString().slice(0, 2);
541 year = prefix + year;
542 }
543 month = parseInt(month, 10);
544 year = parseInt(year, 10);
545 return {
546 month: month,
547 year: year
548 };
549 };
550
551 $.payment.validateCardNumber = function(num) {
552 var card, _ref;
553 num = (num + '').replace(/\s+|-/g, '');
554 if (!/^\d+$/.test(num)) {
555 return false;
556 }
557 card = cardFromNumber(num);
558 if (!card) {
559 return false;
560 }
561 return (_ref = num.length, __indexOf.call(card.length, _ref) >= 0) && (card.luhn === false || luhnCheck(num));
562 };
563
564 $.payment.validateCardExpiry = function(month, year) {
565 var currentTime, expiry, _ref;
566 if (typeof month === 'object' && 'month' in month) {
567 _ref = month, month = _ref.month, year = _ref.year;
568 }
569 if (!(month && year)) {
570 return false;
571 }
572 month = $.trim(month);
573 year = $.trim(year);
574 if (!/^\d+$/.test(month)) {
575 return false;
576 }
577 if (!/^\d+$/.test(year)) {
578 return false;
579 }
580 if (!((1 <= month && month <= 12))) {
581 return false;
582 }
583 if (year.length === 2) {
584 if (year < 70) {
585 year = "20" + year;
586 } else {
587 year = "19" + year;
588 }
589 }
590 if (year.length !== 4) {
591 return false;
592 }
593 expiry = new Date(year, month);
594 currentTime = new Date;
595 expiry.setMonth(expiry.getMonth() - 1);
596 expiry.setMonth(expiry.getMonth() + 1, 1);
597 return expiry > currentTime;
598 };
599
600 $.payment.validateCardCVC = function(cvc, type) {
601 var card, _ref;
602 cvc = $.trim(cvc);
603 if (!/^\d+$/.test(cvc)) {
604 return false;
605 }
606 card = cardFromType(type);
607 if (card != null) {
608 return _ref = cvc.length, __indexOf.call(card.cvcLength, _ref) >= 0;
609 } else {
610 return cvc.length >= 3 && cvc.length <= 4;
611 }
612 };
613
614 $.payment.cardType = function(num) {
615 var _ref, thisType;
616 if (!num) {
617 return null;
618 }
619 thisType = ((_ref = cardFromNumber(num)) != null ? _ref.type : void 0) || null;
620 if ((thisType !== null) && !checkSupportedCard(thisType)) {
621 thisType = 'unsupported';
622 }
623 return thisType;
624 };
625
626 $.payment.formatCardNumber = function(num) {
627 var card, groups, upperLength, _ref;
628 num = num.replace(/\D/g, '');
629 card = cardFromNumber(num);
630 if (!card) {
631 return num;
632 }
633 upperLength = card.length[card.length.length - 1];
634 num = num.slice(0, upperLength);
635 if (card.format.global) {
636 return (_ref = num.match(card.format)) != null ? _ref.join(' ') : void 0;
637 } else {
638 groups = card.format.exec(num);
639 if (groups == null) {
640 return;
641 }
642 groups.shift();
643 groups = $.grep(groups, function(n) {
644 return n;
645 });
646 return groups.join(' ');
647 }
648 };
649
650 $.payment.formatExpiry = function(expiry) {
651 var mon, parts, sep, year;
652 parts = expiry.match(/^\D*(\d{1,2})(\D+)?(\d{1,4})?/);
653 if (!parts) {
654 return '';
655 }
656 mon = parts[1] || '';
657 sep = parts[2] || '';
658 year = parts[3] || '';
659 if (year.length > 0) {
660 sep = ' / ';
661 } else if (sep === ' /') {
662 mon = mon.substring(0, 1);
663 sep = '';
664 } else if (mon.length === 2 || sep.length > 0) {
665 sep = ' / ';
666 } else if (mon.length === 1 && (mon !== '0' && mon !== '1')) {
667 mon = "0" + mon;
668 sep = ' / ';
669 }
670 return mon + sep + year;
671 };
672
673 $.payment.addSupportedCards = function(cardList)
674 {
675 if (cardList.length) {
676 cardList = cardList.split(',');
677 $.payment.supportedCardTypes = cardList;
678 }
679 };
680
681 $.payment.checkSupportedCard = function(cardType)
682 {
683 return checkSupportedCard(cardType);
684 };
685}).call(this);
686