forked from xendit/xendit-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qrcode.go
45 lines (39 loc) · 1.55 KB
/
qrcode.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
package xendit
import "time"
// QRCodeType constants are the available QR Code type
type QRCodeType string
// This consists the values that QRCodeType can have
const (
DynamicQRCode QRCodeType = "DYNAMIC"
StaticQRCode QRCodeType = "STATIC"
)
// QRCode contains data from Xendit's API response of QR code related request.
// For more details see https://developers.xendit.co/api-reference/#create-qr-code
type QRCode struct {
ID string `json:"id"`
ExternalID string `json:"external_id"`
Amount float64 `json:"amount"`
QRString string `json:"qr_string"`
CallbackURL string `json:"callback_url"`
Type QRCodeType `json:"type"`
Status string `json:"status"`
Created *time.Time `json:"created"`
Updated *time.Time `json:"updated"`
}
// QRDetail contains data from qr field from Xendit's API response of QRCode payments related request
// For more details see https://developers.xendit.co/api-reference/#get-payments-by-external-id
type QRDetail struct {
ID string `json:"id"`
ExternalID string `json:"external_id"`
QRString string `json:"qr_string"`
Type QRCodeType `json:"type"`
}
// QRCodePayments contains data from Xendit's API response of QRCode payments related request.
// For more details see https://developers.xendit.co/api-reference/#get-payments-by-external-id
type QRCodePayments struct {
ID string `json:"id"`
Amount float64 `json:"amount"`
Created *time.Time `json:"created"`
Status string `json:"status"`
QRCode QRDetail `json:"qr_code"`
}