forked from checkout/checkout-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
instrument_details.go
86 lines (71 loc) · 2.54 KB
/
instrument_details.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
package accounts
import (
"github.com/PaddleHQ/checkout-sdk-go/common"
)
type InstrumentDetail string
type (
InstrumentDetails interface {
GetType() string
}
InstrumentDetailsFasterPayments struct {
AccountNumber string `json:"account_number,omitempty"`
BankCode string `json:"bank_code,omitempty"`
}
InstrumentDetailsSepa struct {
Iban string `json:"iban,omitempty"`
SwiftBic string `json:"swift_bic,omitempty"`
}
InstrumentDetailsCardToken struct {
Token string `json:"token,omitempty"`
}
)
type (
PaymentInstrumentDetailsResponse struct {
HttpMetadata common.HttpMetadata
Id string `json:"id,omitempty"`
Status InstrumentStatus `json:"status,omitempty"`
InstrumentId string `json:"instrument_id,omitempty"`
Label string `json:"label,omitempty"`
Type common.InstrumentType `json:"type,omitempty"`
Currency common.Currency `json:"currency,omitempty"`
Country common.Country `json:"country,omitempty"`
DefaultDestination bool `json:"default,omitempty"`
Document *InstrumentDocument `json:"document,omitempty"`
Links map[string]common.Link `json:"_links"`
}
PaymentInstrumentQueryResponse struct {
HttpMetadata common.HttpMetadata
Data []PaymentInstrumentDetailsResponse `json:"data,omitempty"`
}
)
type (
PaymentInstrumentRequest struct {
Label string `json:"label,omitempty"`
Type common.InstrumentType `json:"type,omitempty"`
Currency common.Currency `json:"currency,omitempty"`
Country common.Country `json:"country,omitempty"`
DefaultDestination bool `json:"default,omitempty"`
Document *InstrumentDocument `json:"document"`
InstrumentDetails InstrumentDetails `json:"instrument_details,omitempty"`
}
PaymentInstrumentsQuery struct {
Status InstrumentStatus `json:"status,omitempty"`
}
UpdatePaymentInstrumentRequest struct {
Label string `json:"label,omitempty"`
Default bool `json:"default,omitempty"`
Headers Headers `json:"headers,omitempty"`
}
)
type Headers struct {
IfMatch string `json:"if-match,omitempty"`
}
func (s *InstrumentDetailsFasterPayments) GetType() string {
return "FasterPayment"
}
func (s *InstrumentDetailsSepa) GetType() string {
return "Sepa"
}
func (s *InstrumentDetailsCardToken) GetType() string {
return string(common.CardToken)
}