         self.expirationDateLabel?.text = self.token?.getExpirationDateFormated()
     }
 
+    
+    
+    
+    func validInputNumber(textField: UITextField, shouldChangeCharactersInRange range: NSRange, replacementString string: String) -> Bool{
+        
+        if (textField.text?.characters.count == 0){
+            return true
+        }
+        //Range.Lenth will greater than 0 if user is deleting text - Allow it to replce
+        if range.length > 0
+        {
+            return true
+        }
+        
+        //Dont allow empty strings
+        if string == " "
+        {
+            return false
+        }
+        
+        //Check for max length including the spacers we added
+        if range.location == 19
+        {
+            return false
+        }
+        
+        var originalText = textField.text
+        let replacementText = string.stringByReplacingOccurrencesOfString(" ", withString: "")
+        
+        //Verify entered text is a numeric value
+        let digits = NSCharacterSet.decimalDigitCharacterSet()
+        for char in replacementText.unicodeScalars
+        {
+            if !digits.longCharacterIsMember(char.value)
+            {
+                return false
+            }
+        }
+        
+        //Put an empty space after every 4 places
+        if (originalText!.stringByReplacingOccurrencesOfString(" ", withString: "").characters.count % 4 == 0)
+        {
+            originalText?.appendContentsOf(" ")
+            textField.text = originalText
+        }
+        
+        return true
+        
+        
+    }
+    func validAmexInputNumber(textField: UITextField, shouldChangeCharactersInRange range: NSRange, replacementString string: String) -> Bool{
+        
+        if range.length > 0
+        {
+            return true
+        }
+        
+        //Dont allow empty strings
+        if string == " "
+        {
+            return false
+        }
+        var originalText = textField.text
+        let numberOfDigits = originalText!.stringByReplacingOccurrencesOfString(" ", withString: "").characters.count
+        let replacementText = string.stringByReplacingOccurrencesOfString(" ", withString: "")
+         let numberOfDigitsToAdd = replacementText.characters.count
+        //Check for max length including the spacers we added
+        if (numberOfDigits + numberOfDigitsToAdd) > 15
+        {
+            return false
+        }
+        
+        
+        
+        
+        //Verify entered text is a numeric value
+        let digits = NSCharacterSet.decimalDigitCharacterSet()
+        for char in replacementText.unicodeScalars
+        {
+            if !digits.longCharacterIsMember(char.value)
+            {
+                return false
+            }
+        }
+        
+        
+        if ((numberOfDigits == 4)||(numberOfDigits == 10))
+        {
+            originalText?.appendContentsOf(" ")
+            textField.text = originalText
+        }
+        
+        return true
+        
+        
+    }
+    
+    
+    
     
     func addDot() -> Bool{
         if ((paymentMethod == nil) || (!paymentMethod!.isAmex())){

    func completeNumberLabel(){
       // self.cardNumberLabel?.text = formatCardNumberText((self.cardNumberLabel?.text)! + "•••••••••••••••••••••••••••")
     // return
        while (addDot() != false){
            
        }

    
    func addDotAmex() -> Bool{
        

        var label = cardNumberLabel
   
        
        if label?.text?.characters.count == 17
        {
            return false
        }

        
        let digits = (label?.text?.stringByReplacingOccurrencesOfString(" ", withString: "").characters.count)!
        
