Credit Card Holder Name
cesarmtz93 opened this issue · comments
Cesar Martinez commented
is there a way i could add the option of capturing the card holders name?
Cesar Martinez commented
i meant it to be in the capturing form, is that possible?
Orazz commented
@cesarmtz93 What do you mean by capturing?
cesarmtzips93 commented
Orazz commented
You can use your own textfield and set text manually.
Zahedul Alam commented
How to get cardName from card number ?
Andres D. Paladines commented
You can use this code to create the card holder's field:
func createCardHolderTextField() {
let y = paymentTextField.frame.origin.y + 99
let cardHolderTextField = UITextField()
cardHolderTextField.frame = CGRect(x: 15, y: y, width: self.view.frame.size.width - 30, height: 44)
cardHolderTextField.delegate = self
paymentTextField.translatesAutoresizingMaskIntoConstraints = false
paymentTextField.borderWidth = 0
let border = CALayer()
let width = CGFloat(1.0)
border.borderColor = UIColor.darkGray.cgColor
border.frame = CGRect(x: 0, y: paymentTextField.frame.size.height - width, width: paymentTextField.frame.size.width, height: paymentTextField.frame.size.height)
border.borderWidth = width
cardHolderTextField.layer.addSublayer(border)
cardHolderTextField.layer.masksToBounds = true
view.addSubview(cardHolderTextField)
NSLayoutConstraint.activate([
cardHolderTextField.topAnchor.constraint(equalTo: paymentTextField.bottomAnchor, constant: 20),
cardHolderTextField.centerXAnchor.constraint(equalTo: view.centerXAnchor),
cardHolderTextField.widthAnchor.constraint(equalToConstant: self.view.frame.size.width-20),
cardHolderTextField.heightAnchor.constraint(equalToConstant: 44)
])
cardHolderTextField.placeholder = "CARD HOLDER"
}
Dont forget to use the delegate methods in the viewController
class
Noman khan commented
creditCardView.cardHolderString = textField.text
for card Holder Name capture (User can enter Name in textField get Value in cardHolderString