Skip to content

Commit

Permalink
Fix expiry year for test cards (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-paystack authored Oct 9, 2024
1 parent 9f5554f commit 7545ba2
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions Sources/PaystackUI/Charge/ChargeCard/TestMode/TestCards.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,9 @@ extension TestCard {
}

var expiryYear: String {
switch self {
case .success:
return "24"
case .bankAuthentication:
return "24"
case .declined:
return "24"
}
let nextYear = Calendar.current.component(.year, from: Date()) + 1
let lastTwoDigits = String(nextYear).suffix(2)
return "\(lastTwoDigits)"
}

var cardType: CardType {
Expand Down

0 comments on commit 7545ba2

Please sign in to comment.