clear the card value. close the modal on success
authorOwen Smith <owen@omsmith.ca>
Wed, 21 Nov 2012 02:02:54 +0000 (21:02 -0500)
committerOwen Smith <owen@omsmith.ca>
Wed, 21 Nov 2012 02:02:54 +0000 (21:02 -0500)
www/assets/js/ui.js

index 3b03bec..88ae097 100644 (file)
@@ -111,7 +111,13 @@ $('input[name=card-number]').keypress(function (e) {
                var input = $(this);
 
                var cardData = input.val();
+               input.val('');
 
-               client.process(cardData, entries);
+               var result = client.process(cardData, entries);
+               switch (result) {
+                       case 0: break; //fail
+                       case 1: break; //nomoney
+                       case 2: $('#checkout-modal').modal('hide'); return;
+               }
        }
 });