-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtypes.ts
128 lines (121 loc) · 2.83 KB
/
types.ts
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
export type decimal = string
export interface BinancePayHeaders {
'binancepay-timestamp': string
'binancepay-nonce': string
'binancepay-signature': string
'binancepay-certificate-sn': string
'content-type': string
[key: string]: string
}
export interface Order {
merchant?: {
subMerchantId: string
}
env: {
terminalType: "APP" | "WEB" | "WAP" | "MINI_PROGRAM" | "OTHERS"
osType?: string
orderClientIp?: string
cookieId?: string
}
merchantTradeNo: string
orderAmount: decimal
currency: "BUSD" | "USDT" | "MBOX"
goods: {
goodsType: "01" | "02"
goodsCategory: "0000" | "1000" | "2000" | "3000" | "4000" | "5000" | "6000" | "7000" | "8000" | "9000" | "A000" | "B000" | "C000" | "D000" | "E000" | "F000" | "Z000"
referenceGoodsId: string
goodsName: string
goodsDetail?: string
goodsUnitAmount?: {
currency: string
amount: decimal
}
goodsQuantity?: string
}
shipping?: {
shippingName?: {
firstName: string
middleName?: string
lastName: string
}
shippingAddress?: {
region: string
state?: string
city?: string
address?: string
zipCode?: string
shippingAddressType?: "01" | "02" | "03" | "04"
}
shippingPhoneNo?: string
}
buyer?: {
referenceBuyerId: string
buyerName: {
firstName: string
middleName?: string
lastName: string
}
buyerPhoneCountryCode?: string
buyerPhoneNo?: string
buyerEmail?: string
buyerRegistrationTime?: number
buyerBrowserLanguage?: string
}
returnUrl?: string
cancelUrl?: string
orderExpireTime?: number
supportPayCurrency?: string
appId?: string
}
export interface Order_Response {
status: "SUCCESS" | "FAIL"
code: string
data: {
prepayId: string
terminalType: string
expireTime: number
qrcodeLink: string
qrContent: string
checkoutUrl: string
deeplink: string
universalUrl: string
}
}
export interface GetCertificates_Response_Cert {
certPublic: string
certSerial: string
}
export interface GetCertificates_Response {
status: "SUCCESS" | "FAIL"
code: string
data: Array<GetCertificates_Response_Cert>
}
export interface BinanceWebhook {
bizType: string
bizId: number // the docs say string, the example shown in the docs is a number, and it's actually a number
bizStatus: "PAY_SUCCESS" | "PAY_CLOSED"
data: string // json serialized BinanceWebhookOrderNotification or something similar looking
}
export interface BinanceWebhookOrderNotification {
merchantTradeNo: string
productType: string
productName: string
tradeType: "WEB" | "APP" | "WAP" | "MINI_PROGRAM" | "PAYMENT_LINK" | "OTHERS"
totalFee: string
currency: string
openUserId?: string
payerInfo?: {
firstName: string
middleName?: string
lastName: string
walletId: string
country?: string
city?: string
address?: string
identityType?: string
identityNumber?: string
dateOfBirth?: string
placeOfBirth?: string
nationality?: string
}
}