forked from checkout/checkout-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
instrument.go
58 lines (52 loc) · 2.06 KB
/
instrument.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
package instruments
import (
"github.com/checkout/checkout-sdk-go"
"github.com/checkout/checkout-sdk-go/common"
)
type (
// Request -
Request struct {
Type string `json:"type" binding:"required"`
Token string `json:"token" binding:"required"`
AccountHolder *common.AccountHolder `json:"account_holder,omitempty"`
Customer *Customer `json:"customer,omitempty"`
}
// Customer -
Customer struct {
ID string `json:"id,omitempty"`
Email string `json:"email,omitempty"`
Name string `json:"name,omitempty"`
Phone *common.Phone `json:"phone,omitempty"`
Default *bool `json:"default,omitempty"`
}
)
type (
// Response -
Response struct {
StatusResponse *checkout.StatusResponse `json:"api_response,omitempty"`
Instrument *InstrumentResponse `json:"instrument_response,omitempty"`
}
// InstrumentResponse -
InstrumentResponse struct {
*Instrument
Customer *Customer `json:"customer,omitempty"`
}
Instrument struct {
ID string `json:"id"`
Type string `json:"type,omitempty"`
Fingerprint string `json:"fingerprint,omitempty"`
ExpiryMonth int `json:"expiry_month,omitempty"`
ExpiryYear int `json:"expiry_year,omitempty"`
Name string `json:"name,omitempty"`
Scheme string `json:"scheme,omitempty"`
Last4 string `json:"last4,omitempty"`
Bin string `json:"bin,omitempty"`
CardType string `json:"card_type,omitempty"`
CardCategory string `json:"card_category,omitempty"`
Issuer string `json:"issuer,omitempty"`
IssuerCountry string `json:"issuer_country,omitempty"`
ProductId string `json:"product_id,omitempty"`
ProductType string `json:"product_type,omitempty"`
AccountHolder common.AccountHolder `json:"account_holder,omitempty"`
}
)