-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel.go
More file actions
233 lines (213 loc) · 9.33 KB
/
model.go
File metadata and controls
233 lines (213 loc) · 9.33 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
package ptcpayclient
//***********************************************
//* Copyright (c) 2021 Ulbora Labs LLC
//* Copyright (c) 2021 Ken Williamson
//***********************************************
//Policy Policy
type Policy struct {
Policy string `json:"policy"`
Method string `json:"method"`
Params []string `json:"params"`
}
//TokenData TokenData
type TokenData struct {
Policies []Policy `json:"policies"`
Token string `json:"token"`
Facade string `json:"facade"`
CreateDate int64 `json:"dateCreated"`
PairingExpiration int64 `json:"pairingExpiration"`
ParingCode string `json:"pairingCode"`
}
//Payload Payload
type Payload struct {
ClientID string `json:"id"`
PairingCode string `json:"pairingCode"`
}
//Rate Rate
type Rate struct {
Name string `json:"name"`
CryptoCode string `json:"cryptoCode"`
CurrencyPair string `json:"currencyPair"`
Code string `json:"code"`
Rate float64 `json:"rate"`
}
//RateResponse RateResponse
type RateResponse struct {
Data []Rate `json:"data"`
}
//TranCurStatus TranCurStatus
type TranCurStatus struct {
Enabled bool `json:"enabled"`
Reason string `json:"reason"`
}
//Buyer Buyer
type Buyer struct {
Name string `json:"name"`
Address1 string `json:"address1"`
Address2 string `json:"address2"`
City string `json:"city"`
Locality string `json:"locality"`
Region string `json:"region"`
PostalCode string `json:"postalCode"`
State string `json:"state"`
Zip string `json:"zip"`
Country string `json:"country"`
Phone string `json:"phone"`
Notify bool `json:"notify"`
Email string `json:"email"`
}
//BuyerFields BuyerFields
type BuyerFields struct {
BuyerName string `json:"buyerName"`
BuyerAddress1 string `json:"buyerAddress1"`
BuyerAddress2 string `json:"buyerAddress2"`
BuyerCity string `json:"buyerCity"`
BuyerState string `json:"buyerState"`
BuyerZip string `json:"buyerZip"`
BuyerCountry string `json:"buyerCountry"`
BuyerPhone string `json:"buyerPhone"`
BuyerNotify bool `json:"buyerNotify"`
BuyerEmail string `json:"buyerEmail"`
}
//Erate Erate
type Erate struct {
}
//CryptoCode CryptoCode
type CryptoCode struct {
CryptoCode string `json:"cryptoCode"`
PaymentType string `json:"paymentType"`
Rate float64 `json:"rate"`
ExRates map[string]float64 `json:"exRates"`
Paid string `json:"paid"`
Price string `json:"price"`
Due string `json:"due"`
PaymentUrls map[string]string `json:"paymentUrls"`
Address string `json:"address"`
URL string `json:"url"`
TotalDue string `json:"totalDue"`
NetworkFee string `json:"networkFee"`
TxCount int64 `json:"txCount"`
CryptoPaid string `json:"cryptoPaid"`
Payments []Payment `json:"payments"`
}
//PayURLs PayURLs
type PayURLs struct {
BIP21 string `json:"BIP21"`
BIP72 string `json:"BIP72"`
BIP72b string `json:"BIP72b"`
BIP73 string `json:"BIP73"`
BOLT11 string `json:"BOLT11"`
}
//InvFlags InvFlags
type InvFlags struct {
Refundable bool `json:"refundable"`
}
//InvoiceReq InvoiceReq
type InvoiceReq struct {
Currency string `json:"currency"`
Price float64 `json:"price"`
OrderID string `json:"orderId"`
//ExpirationTime int64 `json:"expirationTime"`
ItemDesc string `json:"itemDesc"`
ItemCode string `json:"itemCode"`
PosData string `json:"posData"`
Status string `json:"status"`
RedirectURL string `json:"redirectURL"`
TransactionSpeed string `json:"transactionSpeed"`
Physical bool `json:"physical"`
SupportedTransactionCurrencies map[string]TranCurStatus `json:"supportedTransactionCurrencies"`
Refundable bool `json:"refundable"`
TaxIncluded float64 `json:"taxIncluded"`
Token string `json:"token"`
RedirectAutomatically bool `json:"redirectAutomatically"`
NotificationEmail string `json:"notificationEmail"`
NotificationURL string `json:"notificationURL"`
ExtendedNotifications bool `json:"extendedNotifications"`
FullNotifications bool `json:"fullNotifications"`
Buyer Buyer `json:"buyer"`
}
//InvoiceArgs InvoiceArgs
type InvoiceArgs struct {
Status string `json:"status"`
OrderID string `json:"orderId"`
ItemCode string `json:"itemCode"`
DateStart string `json:"dateStart"`
DateEnd string `json:"dateEnd"`
Limit string `json:"limit"`
Offset string `json:"offset"`
}
//MinerFee MinerFee
type MinerFee struct {
SatoshisPerByte float64 `json:"satoshisPerByte"`
TotalFee float64 `json:"totalFee"`
}
//Payment Payment
type Payment struct {
ID string `json:"id"`
ReceivedDate string `json:"receivedDate"`
Value float64 `json:"value"`
Fee float64 `json:"fee"`
PaymentType string `json:"paymentType"`
Confirmed bool `json:"confirmed"`
Completed bool `json:"completed"`
Destination string `json:"destination"`
}
//Invoice Invoice
type Invoice struct {
GUID string `json:"guid"`
ID string `json:"id"`
URL string `json:"url"`
BtcPrice string `json:"btcPrice"`
BtcDue string `json:"btcDue"`
CryptoInfo []CryptoCode `json:"cryptoInfo"`
ExRates map[string]float64 `json:"exRates"`
BuyerTotalBtcAmount string `json:"buyerTotalBtcAmount"`
InvoiceTime int64 `json:"invoiceTime"`
CurrentTime int64 `json:"currentTime"`
LowFeeDetected bool `json:"lowFeeDetected"`
BtcPaid string `json:"btcPaid"`
Rate float64 `json:"rate"`
ExceptionStatus interface{} `json:"exceptionStatus"`
PaymentUrls PayURLs `json:"paymentUrls"`
RefundAddressRequestPending bool `json:"refundAddressRequestPending"`
BuyerPaidBtcMinerFee string `json:"buyerPaidBtcMinerFee"`
BitcoinAddress string `json:"bitcoinAddress"`
Flags InvFlags `json:"flags"`
PaymentSubtotals map[string]float64 `json:"paymentSubtotals"`
PaymentTotals map[string]float64 `json:"paymentTotals"`
AmountPaid float64 `json:"amountPaid"`
MinerFees map[string]MinerFee `json:"minerFees"`
ExchangeRates map[string]map[string]float64 `json:"exchangeRates"`
Addresses map[string]string `json:"addresses"`
PaymentCodes map[string]map[string]string `json:"paymentCodes"`
Currency string `json:"currency"`
Price float64 `json:"price"`
OrderID string `json:"orderId"`
ExpirationTime int64 `json:"expirationTime"`
ItemDesc string `json:"itemDesc"`
ItemCode string `json:"itemCode"`
PosData string `json:"posData"`
Status string `json:"status"`
//RedirectURL string `json:"redirectURL"`
//TransactionSpeed string `json:"transactionSpeed"`
//Physical bool `json:"physical"`
SupportedTransactionCurrencies map[string]TranCurStatus `json:"supportedTransactionCurrencies"`
//Refundable bool `json:"refundable"`
TaxIncluded float64 `json:"taxIncluded"`
Token string `json:"token"`
RedirectAutomatically bool `json:"redirectAutomatically"`
NotificationEmail string `json:"notificationEmail"`
NotificationURL string `json:"notificationURL"`
ExtendedNotifications bool `json:"extendedNotifications"`
FullNotifications bool `json:"fullNotifications"`
//BuyerFields BuyerFields `json:"buyerFields"`
Buyer Buyer `json:"buyer"`
}
//InvoiceResponse InvoiceResponse
type InvoiceResponse struct {
Data Invoice `json:"data"`
}
//InvoiceListResponse InvoiceListResponse
type InvoiceListResponse struct {
Data []Invoice `json:"data"`
}