Skip to content

Commit

Permalink
Fix test card validity
Browse files Browse the repository at this point in the history
- Always use the next year
  • Loading branch information
michael-paystack committed Oct 7, 2024
1 parent 9f5554f commit 7f901ba
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Sources/PaystackUI/Charge/ChargeCard/TestMode/TestCards.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,16 @@ extension TestCard {
}

var expiryYear: String {
let nextYear = Calendar.current.component(.year, from: Date()) + 1
let lastTwoDigits = String(nextYear).suffix(2)

switch self {
case .success:
return "24"
return lastTwoDigits
case .bankAuthentication:
return "24"
return lastTwoDigits
case .declined:
return "24"
return lastTwoDigits
}
}

Expand Down

0 comments on commit 7f901ba

Please sign in to comment.