Skip to content

Commit 39e3d9b

Browse files
committed
use valid card form
1 parent 48a5253 commit 39e3d9b

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Sources/CardPaySheet/CardFormViewController.swift

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,16 +125,13 @@ class CardFormViewController: UIViewController {
125125
return
126126
}
127127

128-
if cardNumber.isEmpty || expirationDate.isEmpty || cvv.isEmpty {
128+
129+
if !Card.isCardFormValid(cardNumber: cardNumber, expirationDate: expirationDate, cvv: cvv) {
129130
// handle error
130131
return
131132
}
132133

133-
let card = Card.createCard(
134-
cardNumber: cardForm.cardNumber ?? "",
135-
expirationDate: cardForm.expiryDate ?? "",
136-
cvv: cardForm.cvv ?? ""
137-
)
134+
let card = Card.createCard(cardNumber: cardNumber, expirationDate: expirationDate,cvv: cvv)
138135

139136
let request = CardRequest(
140137
orderID: orderID,

0 commit comments

Comments
 (0)