-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
GraphCreditCardTemplate.swift
80 lines (69 loc) · 1.9 KB
/
GraphCreditCardTemplate.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import Foundation
extension GraphUserCreditCard {
public static let masterCard = GraphUserCreditCard.CreditCard(
expirationDate: "2018-10-31",
id: "1",
lastFour: "0000",
type: .mastercard
)
public static let visa = GraphUserCreditCard.CreditCard(
expirationDate: "2019-09-30",
id: "2",
lastFour: "1111",
type: .visa
)
public static let diners = GraphUserCreditCard.CreditCard(
expirationDate: "2022-09-01",
id: "3",
lastFour: "1212",
type: .diners
)
public static let jcb = GraphUserCreditCard.CreditCard(
expirationDate: "2022-01-01",
id: "4",
lastFour: "2222",
type: .jcb
)
public static let discover = GraphUserCreditCard.CreditCard(
expirationDate: "2022-03-12",
id: "5",
lastFour: "4242",
type: .discover
)
public static let amex = GraphUserCreditCard.CreditCard(
expirationDate: "2024-01-12",
id: "6",
lastFour: "8882",
type: .amex
)
public static let generic = GraphUserCreditCard.CreditCard(
expirationDate: "2024-01-12",
id: "7",
lastFour: "1882",
type: .generic
)
public static let unionPay = GraphUserCreditCard.CreditCard(
expirationDate: "2021-11-10",
id: "8",
lastFour: "0005",
type: .unionPay
)
public static let template = GraphUserCreditCard(
storedCards: CreditCardConnection(nodes: [
GraphUserCreditCard.amex,
GraphUserCreditCard.masterCard,
GraphUserCreditCard.visa,
GraphUserCreditCard.diners,
GraphUserCreditCard.jcb,
GraphUserCreditCard.discover,
GraphUserCreditCard.unionPay,
GraphUserCreditCard.generic
])
)
public static let emptyTemplate = GraphUserCreditCard(
storedCards: CreditCardConnection(nodes: [])
)
public static func withCards(_ cards: [GraphUserCreditCard.CreditCard]) -> GraphUserCreditCard {
return GraphUserCreditCard(storedCards: .init(nodes: cards))
}
}