Skip to content

Commit 7545ba2

Browse files
Fix expiry year for test cards (#117)
1 parent 9f5554f commit 7545ba2

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

Sources/PaystackUI/Charge/ChargeCard/TestMode/TestCards.swift

+3-8
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,9 @@ extension TestCard {
5454
}
5555

5656
var expiryYear: String {
57-
switch self {
58-
case .success:
59-
return "24"
60-
case .bankAuthentication:
61-
return "24"
62-
case .declined:
63-
return "24"
64-
}
57+
let nextYear = Calendar.current.component(.year, from: Date()) + 1
58+
let lastTwoDigits = String(nextYear).suffix(2)
59+
return "\(lastTwoDigits)"
6560
}
6661

6762
var cardType: CardType {

0 commit comments

Comments
 (0)