Issue in setting card type in CitrusPay gateway swift ios

177 views Asked by At

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

1

There are 1 answers

5
Shubhank On BEST ANSWER

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;