Nilesh Nilesh - 2 years ago 101
Swift Question

Issue in setting card type in CitrusPay gateway swift ios

I am trying to set card type in CitrusPay in Swift

I need help converting following Objective-C line to Swift

CTSElectronicCardUpdate *debitCard = [[CTSElectronicCardUpdate alloc] initDebitCard];

This is what compiler suggested me:

let debitCard: CTSElectronicCardUpdate = CTSElectronicCardUpdate.init(debitCard: ())

so the debitCard is expecting function type

Answer Source

This works for me

 let debitCard = CTSElectronicCardUpdate(debitCard: ())
 debitCard.number = cardNumber.
 debitCard.expiryDate = formatted; //only mm/yyyy format
 debitCard.scheme = CTSUtility.fetchCardSchemeForCardNumber(number Here)
 debitCard.ownerName = userName.value; // no special characters here
 debitCard.cvv = cvv.value;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download