From 130a7f2cc1ca8475312804f41365766b409a7e04 Mon Sep 17 00:00:00 2001 From: berick Date: Tue, 29 Mar 2011 16:56:37 -0400 Subject: [PATCH] prevent payment when CC expire year/month is in the past --- Open-ILS/web/opac/skin/kcls/js/myopac.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Open-ILS/web/opac/skin/kcls/js/myopac.js b/Open-ILS/web/opac/skin/kcls/js/myopac.js index 95e56e252e..52344e8829 100644 --- a/Open-ILS/web/opac/skin/kcls/js/myopac.js +++ b/Open-ILS/web/opac/skin/kcls/js/myopac.js @@ -1694,6 +1694,20 @@ function drawPayFinesPage(patron, total, xacts, onPaymentSubmit) { if(!payFinesDrawn) { dojo.connect(oilsSelfckCCSubmit, 'onClick', function() { + + var year = oilsSelfckCCYear.attr('value'); + var month = oilsSelfckCCMonth.attr('value'); + + var today = new Date(); + today = new Date(today.getFullYear(), today.getMonth()); // truncate the date & time; + var expire = new Date(year, Number(month)-1); + + if(!year || !month || expire < today) { + alert('Credit Card expire date is invalid or in the past.'); + oilsSelfckCCMonth.domNode.focus(); + return; + } + hideMe($('pay_fines_now')); unHideMe($('pay_fines_confirm')); -- 2.11.0