-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathcredit_card_manager.go
64 lines (54 loc) · 1.37 KB
/
credit_card_manager.go
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
package gomerchant
// CreditCardManager interface
type CreditCardManager interface {
CreateCreditCard(creditCardParams CreateCreditCardParams) (CreditCardResponse, error)
GetCreditCard(creditCardParams GetCreditCardParams) (GetCreditCardResponse, error)
ListCreditCards(listCreditCardsParams ListCreditCardsParams) (ListCreditCardsResponse, error)
DeleteCreditCard(deleteCreditCardParams DeleteCreditCardParams) (DeleteCreditCardResponse, error)
}
// CreateCreditCard Params
type CreateCreditCardParams struct {
CustomerID string
CreditCard *CreditCard
}
type CreditCardResponse struct {
CustomerID string
CreditCardID string
Params
}
// Get Credit Cards Params
type GetCreditCardParams struct {
CustomerID string
CreditCardID string
}
type GetCreditCardResponse struct {
CreditCard *CustomerCreditCard
Params
}
// Delete Credit Cards Params
type DeleteCreditCardParams struct {
CustomerID string
CreditCardID string
}
type DeleteCreditCardResponse struct {
Params
}
// List Credit Cards Params
type ListCreditCardsParams struct {
CustomerID string
}
type ListCreditCardsResponse struct {
CreditCards []*CustomerCreditCard
Params
}
// CustomerCreditCard CustomerCard defination
type CustomerCreditCard struct {
CustomerID string
CustomerName string
CreditCardID string
MaskedNumber string
ExpMonth uint
ExpYear uint
Brand string
Params
}