<commit_before>//
//  CardFormViewController.swift
//  MercadoPagoSDK
//
//  Created by <NAME> on 1/18/16.
//  Copyright © 2016 MercadoPago. All rights reserved.
//

import UIKit
import MercadoPagoTracker


public class CardFormViewController: MercadoPagoUIViewController , UITextFieldDelegate {

    
    @IBOutlet weak var cardBackground: UIView!
    
    @IBOutlet weak var cardView: UIView!
    var cardViewBack:UIView?
 
    var cardFront : CardFrontView?
    var cardBack : CardBackView?
    
    var cardNumberLabel: UILabel?
    var numberLabelEmpty: Bool = true
    var nameLabel: MPLabel?
    var nameLabelEmpty: Bool = true
    var expirationDateLabel: MPLabel?
    var expirationLabelEmpty: Bool = true
    var cvvLabel: UILabel?
    var cvvLabelEmpty: Bool = true

    var editingLabel : UILabel?
    @IBOutlet weak var textBox: HoshiTextField!
   
    var paymentMethods : [PaymentMethod]?
    var paymentMethod : PaymentMethod?
    
    var token : Token?
    var cardToken : CardToken?
    
    var paymentSettings : PaymentPreference?
    var callback : (( paymentMethod: PaymentMethod,cardtoken: CardToken?) -> Void)?
    
    var amount : Double?
    
    //DNI
     var identificationCard : IdentificationCardView?
    
    override public var screenName : String { get { return "CARD_NUMBER" } }
    
    
    required public init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
    }
    override func loadMPStyles(){
        
        if self.navigationController != nil {
            
            
            //Navigation bar colors
            let titleDict: NSDictionary = [NSForegroundColorAttributeName: UIColor.whiteColor(), NSFontAttributeName: UIFont(name: MercadoPago.DEFAULT_FONT_NAME, size: 18)!]
            
            if self.navigationController != nil {
                self.navigationController!.navigationBar.titleTextAttributes = titleDict as? [String : AnyObject]
                self.navigationItem.hidesBackButton = true
                self.navigationController!.interactivePopGestureRecognizer?.delegate = self
           //     self.navigationController?.navigationBar.tintColor = UIColor.whiteColor()
            //    self.navigationController?.navigationBar.barTintColor = UIColor(red: 90, green: 190, blue: 231)
              //  self.navigationController?.navigationBar.tintColor = MercadoPagoContext.secundaryColor
                self.navigationController?.navigationBar.barTintColor = MercadoPagoContext.getPrimaryColor()
                self.navigationController?.navigationBar.removeBottomLine()
                self.navigationController?.navigationBar.translucent = false
            self.cardBackground.backgroundColor =  MercadoPagoContext.getSecundaryColor()
 
                var promocionesButton : UIBarButtonItem = UIBarButtonItem(title: "Ver promociones".localized, style: UIBarButtonItemStyle.Plain, target: self, action: "verPromociones")

                
                self.navigationItem.rightBarButtonItem = promocionesButton
                
                
                //Create navigation buttons
                displayBackButton()
            }
        }
        
    }


    public init(paymentSettings : PaymentPreference?, amount:Double!, token: Token? = nil,paymentMethods : [PaymentMethod]? = nil,  callback : ((paymentMethod: PaymentMethod, cardToken: CardToken?) -> Void), callbackCancel : (Void -> Void)? = nil) {
        super.init(nibName: "CardFormViewController", bundle: MercadoPago.getBundle())
        self.paymentSettings = paymentSettings<commit_msg>no message<commit_after>//
//  CardFormViewController.swift
//  MercadoPagoSDK
//
//  Created by <NAME> on 1/18/16.
//  Copyright © 2016 MercadoPago. All rights reserved.
//

import UIKit
import MercadoPagoTracker


public class CardFormViewController: MercadoPagoUIViewController , UITextFieldDelegate {

    
    @IBOutlet weak var cardBackground: UIView!
    
    @IBOutlet weak var cardView: UIView!
    var cardViewBack:UIView?
 
    var cardFront : CardFrontView?
    var cardBack : CardBackView?
    
    var cardNumberLabel: UILabel?
    var numberLabelEmpty: Bool = true
    var nameLabel: MPLabel?
    var nameLabelEmpty: Bool = true
    var expirationDateLabel: MPLabel?
    var expirationLabelEmpty: Bool = true
    var cvvLabel: UILabel?
    var cvvLabelEmpty: Bool = true

    var editingLabel : UILabel?
    @IBOutlet weak var textBox: HoshiTextField!
   
    var paymentMethods : [PaymentMethod]?
    var paymentMethod : PaymentMethod?
    
    var token : Token?
    var cardToken : CardToken?
    
    var paymentSettings : PaymentPreference?
    var callback : (( paymentMethod: PaymentMethod,cardtoken: CardToken?) -> Void)?
    
    var amount : Double?
    
    //DNI
     var identificationCard : IdentificationCardView?
    
    override public var screenName : String { get { return "CARD_NUMBER" } }
    
    
    required public init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
    }
    override func loadMPStyles(){
        
        if self.navigationController != nil {
            
            
            //Navigation bar colors
            let titleDict: NSDictionary = [NSForegroundColorAttributeName: UIColor.whiteColor(), NSFontAttributeName: UIFont(name: MercadoPago.DEFAULT_FONT_NAME, size: 18)!]
            
            if self.navigationController != nil {
                self.navigationController!.navigationBar.titleTextAttributes = titleDict as? [String : AnyObject]
                self.navigationItem.hidesBackButton = true
                self.navigationController!.interactivePopGestureRecognizer?.delegate = self
                self.navigationController?.navigationBar.barTintColor = MercadoPagoContext.getPrimaryColor()
                self.navigationController?.navigationBar.removeBottomLine()
                self.navigationController?.navigationBar.translucent = false
            self.cardBackground.backgroundColor =  MercadoPagoContext.getSecundaryColor()
 
                var promocionesButton : UIBarButtonItem = UIBarButtonItem(title: "Ver promociones".localized, style: UIBarButtonItemStyle.Plain, target: self, action: "verPromociones")

                
                self.navigationItem.rightBarButtonItem = promocionesButton
                
                
                //Create navigation buttons
                displayBackButton()
            }
        }
        
    }


    public init(paymentSettings : PaymentPreference?, amount:Double!, token: Token? = nil,paymentMethods : [PaymentMethod]? = nil,  callback : ((paymentMethod: PaymentMethod, cardToken: CardToken?) -> Void), callbackCancel : (Void -> Void)? = nil) {
        super.init(nibName: "CardFormViewController", bundle: MercadoPago.getBundle())
        self.paymentSettings = paymentSettings
{'fraction_non_alphanumeric': 0.08091468777484609, 'fraction_numerical': 0.0043975373790677225, 'mean_word_length': 2.686115613182064, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '134695', 'n_tokens_mistral': 1880, 'n_tokens_neox': 1787, 'n_words': 415}