@trusted-solutions/sdit.models 0.65.2-alpha.2 → 0.65.2-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/enums/payment-type.d.ts +6 -0
- package/enums/payment-type.js +6 -0
- package/enums/payment-type.js.map +1 -1
- package/lambda/online-ordering.d.ts +10 -2
- package/models/online-ordering.d.ts +68 -11
- package/models/online-ordering.js.map +1 -1
- package/models/order.d.ts +9 -5
- package/models/payment-config.d.ts +2 -2
- package/package.json +1 -1
package/enums/payment-type.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ export declare enum PaymentType {
|
|
|
13
13
|
oPay = "oPay",
|
|
14
14
|
taiwanPay = "taiwanPay",
|
|
15
15
|
eSunWallet = "eSunWallet",
|
|
16
|
+
/** TWQR(線下版) */
|
|
17
|
+
twqr = "twqr",
|
|
16
18
|
aliPay = "aliPay",
|
|
17
19
|
weixin = "weixin",
|
|
18
20
|
hana = "hana",
|
|
@@ -52,6 +54,10 @@ export declare enum PaymentType {
|
|
|
52
54
|
pxpayplusOn = "pxpayplusOn",
|
|
53
55
|
/** 全盈 */
|
|
54
56
|
pluspayOn = "pluspayOn",
|
|
57
|
+
/** TWQR */
|
|
58
|
+
twqrOn = "twqrOn",
|
|
59
|
+
/** 玉山 Wallet(線上版) */
|
|
60
|
+
eSunWalletOn = "eSunWalletOn",
|
|
55
61
|
weixinOn = "weixinOn",
|
|
56
62
|
aliOn = "aliOn",
|
|
57
63
|
/**
|
package/enums/payment-type.js
CHANGED
|
@@ -17,6 +17,8 @@ var PaymentType;
|
|
|
17
17
|
PaymentType["oPay"] = "oPay";
|
|
18
18
|
PaymentType["taiwanPay"] = "taiwanPay";
|
|
19
19
|
PaymentType["eSunWallet"] = "eSunWallet";
|
|
20
|
+
/** TWQR(線下版) */
|
|
21
|
+
PaymentType["twqr"] = "twqr";
|
|
20
22
|
PaymentType["aliPay"] = "aliPay";
|
|
21
23
|
PaymentType["weixin"] = "weixin";
|
|
22
24
|
PaymentType["hana"] = "hana";
|
|
@@ -56,6 +58,10 @@ var PaymentType;
|
|
|
56
58
|
PaymentType["pxpayplusOn"] = "pxpayplusOn";
|
|
57
59
|
/** 全盈 */
|
|
58
60
|
PaymentType["pluspayOn"] = "pluspayOn";
|
|
61
|
+
/** TWQR */
|
|
62
|
+
PaymentType["twqrOn"] = "twqrOn";
|
|
63
|
+
/** 玉山 Wallet(線上版) */
|
|
64
|
+
PaymentType["eSunWalletOn"] = "eSunWalletOn";
|
|
59
65
|
PaymentType["weixinOn"] = "weixinOn";
|
|
60
66
|
PaymentType["aliOn"] = "aliOn";
|
|
61
67
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment-type.js","sourceRoot":"","sources":["../../../projects/sdit-model-lib/src/enums/payment-type.ts"],"names":[],"mappings":";;;AAAA,IAAY,
|
|
1
|
+
{"version":3,"file":"payment-type.js","sourceRoot":"","sources":["../../../projects/sdit-model-lib/src/enums/payment-type.ts"],"names":[],"mappings":";;;AAAA,IAAY,WA+EX;AA/ED,WAAY,WAAW;IACrB,oCAAqB,CAAA;IACrB,8BAAe,CAAA;IACf,8BAAe,CAAA;IACf,sCAAuB,CAAA;IAEvB,wCAAyB,CAAA;IACzB,8CAA+B,CAAA;IAE/B,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;IACnB,wBAAS,CAAA;IACT,4BAAa,CAAA;IACb,sCAAuB,CAAA;IACvB,wCAAyB,CAAA;IACzB,gBAAgB;IAChB,4BAAa,CAAA;IACb,gCAAiB,CAAA;IACjB,gCAAiB,CAAA;IACjB,4BAAa,CAAA;IACb,wCAAyB,CAAA;IACzB,oCAAqB,CAAA;IACrB,sCAAuB,CAAA;IACvB,SAAS;IACT,kCAAmB,CAAA;IACnB,eAAe;IACf,wCAAyB,CAAA;IACzB,sCAAsC;IACtC,4CAA6B,CAAA;IAC7B,iCAAiC;IACjC,8BAAe,CAAA;IACf,8BAA8B;IAC9B,gCAAiB,CAAA;IACjB,+BAA+B;IAC/B,gCAAiB,CAAA;IACjB,gCAAgC;IAChC,kCAAmB,CAAA;IACnB,gCAAgC;IAChC,kCAAmB,CAAA;IAEnB,kCAAmB,CAAA;IACnB,gCAAiB,CAAA;IACjB,4BAAa,CAAA;IAEb,0BAAW,CAAA;IAEX,kCAAmB,CAAA;IAGnB;;OAEG;IACH,sCAAuB,CAAA;IACvB,4BAAa,CAAA;IACb,gCAAiB,CAAA;IACjB,4CAA6B,CAAA;IAC7B,4CAA6B,CAAA;IAC7B,wCAAyB,CAAA;IACzB,0CAA2B,CAAA;IAC3B,SAAS;IACT,sCAAuB,CAAA;IACvB,WAAW;IACX,gCAAiB,CAAA;IACjB,qBAAqB;IACrB,4CAA6B,CAAA;IAG7B,oCAAqB,CAAA;IACrB,8BAAe,CAAA;IAEd;;MAEE;IACF,oCAAqB,CAAA;IAErB,qCAAqC;IACrC,sDAAuC,CAAA;AAC1C,CAAC,EA/EW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QA+EtB"}
|
|
@@ -403,9 +403,17 @@ export interface SOSendOrderRequest {
|
|
|
403
403
|
* 不給值 = 盡快
|
|
404
404
|
*/
|
|
405
405
|
expectedPickupAt?: number;
|
|
406
|
-
/**
|
|
406
|
+
/**
|
|
407
|
+
* 消費者收件地址。
|
|
408
|
+
*
|
|
409
|
+
* serveType === deliveryByStore 時有效。
|
|
410
|
+
*/
|
|
407
411
|
deliveryAddress?: Address;
|
|
408
|
-
/**
|
|
412
|
+
/**
|
|
413
|
+
* 消費者收件地址經緯度,格式固定為 [longitude, latitude]。
|
|
414
|
+
*
|
|
415
|
+
* 這是消費者收件位置,不應從店家設定推導;serveType === deliveryByStore 時建議送出。
|
|
416
|
+
*/
|
|
409
417
|
deliveryAddressLonLat?: number[];
|
|
410
418
|
/** 內用桌ID serveType === dineIn 時有效 */
|
|
411
419
|
tableId?: string;
|
|
@@ -94,23 +94,72 @@ export interface SOCart {
|
|
|
94
94
|
items: SOCartItem[];
|
|
95
95
|
notes?: string;
|
|
96
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* 外送地點。
|
|
99
|
+
*
|
|
100
|
+
* address 為結構化地址;lonLat 格式固定為 [longitude, latitude]。
|
|
101
|
+
*/
|
|
102
|
+
export interface DeliveryLocation {
|
|
103
|
+
/** 地址,地址備註使用 address.note */
|
|
104
|
+
address: Address;
|
|
105
|
+
/** 經緯度,固定格式為 [longitude, latitude] */
|
|
106
|
+
lonLat: number[];
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* 外送取貨方,也就是店家。
|
|
110
|
+
*
|
|
111
|
+
* POS 可直接使用這組資料建立第三方配送任務,不需要再次查詢店家資料。
|
|
112
|
+
*/
|
|
113
|
+
export interface DeliverySender {
|
|
114
|
+
/** 店家名稱 */
|
|
115
|
+
name: string;
|
|
116
|
+
/** 店家電話 */
|
|
117
|
+
phone: string;
|
|
118
|
+
/** 店家位置 */
|
|
119
|
+
location: DeliveryLocation;
|
|
120
|
+
}
|
|
121
|
+
/** 外送收件方,也就是消費者。 */
|
|
122
|
+
export interface DeliveryRecipient {
|
|
123
|
+
/** 收件人姓名 */
|
|
124
|
+
name: string;
|
|
125
|
+
/** 收件人電話 */
|
|
126
|
+
phone: string;
|
|
127
|
+
/** 收件人位置 */
|
|
128
|
+
location: DeliveryLocation;
|
|
129
|
+
/** 收件人或配送指示,例如到了請打電話給收件人 */
|
|
130
|
+
note?: string;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* 建立外送時需要的完整固定資料。
|
|
134
|
+
*
|
|
135
|
+
* delivery 只描述配送雙方與地址,不包含第三方配送狀態。
|
|
136
|
+
*/
|
|
137
|
+
export interface Delivery {
|
|
138
|
+
sender: DeliverySender;
|
|
139
|
+
recipient: DeliveryRecipient;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* 給線上點餐消費者顯示的配送狀態。
|
|
143
|
+
*
|
|
144
|
+
* 這是由後端從 POS Order.deliveryTask 轉換後產生的安全 response。
|
|
145
|
+
*/
|
|
97
146
|
export interface SODeliveryTask {
|
|
98
|
-
/**
|
|
147
|
+
/** 外送服務商,目前為 METE */
|
|
99
148
|
provider: DeliveryProvider;
|
|
100
149
|
/** 後端標準化後的外送狀態 */
|
|
101
150
|
normalizedStatus?: DeliveryTaskStatus;
|
|
102
|
-
/**
|
|
151
|
+
/** 配送狀態發生時間,timestamp ms */
|
|
103
152
|
statusAt?: number;
|
|
104
|
-
/**
|
|
153
|
+
/** 第三方追蹤網址 */
|
|
105
154
|
trackUrl?: string;
|
|
106
155
|
/** 司機資訊 */
|
|
107
156
|
courier?: {
|
|
108
157
|
name?: string;
|
|
109
158
|
phone?: string;
|
|
110
159
|
};
|
|
111
|
-
/**
|
|
160
|
+
/** 後端最後更新配送狀態的時間,timestamp ms */
|
|
112
161
|
updatedAt?: number;
|
|
113
|
-
/**
|
|
162
|
+
/** 可顯示給消費者的配送異常提示 */
|
|
114
163
|
statusIssue?: DeliveryTaskStatusIssue;
|
|
115
164
|
}
|
|
116
165
|
export declare enum DeliveryProvider {
|
|
@@ -131,9 +180,9 @@ export declare enum DeliveryTaskStatus {
|
|
|
131
180
|
D501 = "D501"
|
|
132
181
|
}
|
|
133
182
|
export interface DeliveryTaskStatusIssue {
|
|
134
|
-
/**
|
|
183
|
+
/** 前端依 code 決定顯示文案 */
|
|
135
184
|
code: DeliveryTaskStatusIssueCode;
|
|
136
|
-
/**
|
|
185
|
+
/** 後端提供的產品化提示文字 */
|
|
137
186
|
message: string;
|
|
138
187
|
/** 異常發生時間,timestamp ms */
|
|
139
188
|
occurredAt?: number;
|
|
@@ -148,6 +197,11 @@ export declare enum DeliveryTaskStatusIssueCode {
|
|
|
148
197
|
/** 未知問題 */
|
|
149
198
|
unknown = "unknown"
|
|
150
199
|
}
|
|
200
|
+
/**
|
|
201
|
+
* POS/backend 使用的完整第三方配送任務資料。
|
|
202
|
+
*
|
|
203
|
+
* statusCode、status 與 error 等原始資料不應直接暴露給消費者前端。
|
|
204
|
+
*/
|
|
151
205
|
export interface DeliveryTask {
|
|
152
206
|
/** 外送服務商,目前只有 METE */
|
|
153
207
|
provider: DeliveryProvider;
|
|
@@ -194,6 +248,7 @@ export interface DeliveryTaskError {
|
|
|
194
248
|
raw?: unknown;
|
|
195
249
|
occurredAt: number;
|
|
196
250
|
}
|
|
251
|
+
export declare type SOPaymentFlowState = 'payable' | 'onlinePaymentActive' | 'paymentFailed' | 'paidProcessing' | 'paidAfterExpired' | 'placed' | 'expired' | 'refunded' | 'failedAfterPosNotified' | 'onsitePayment';
|
|
197
252
|
export interface SOOrder {
|
|
198
253
|
id?: string;
|
|
199
254
|
storeId: string;
|
|
@@ -223,6 +278,10 @@ export interface SOOrder {
|
|
|
223
278
|
estimatedReadyForPickupAt: number;
|
|
224
279
|
/** 訂單建立時間 */
|
|
225
280
|
createdAt: number;
|
|
281
|
+
/** 等待線上付款逾時時間,超過時間未付款則視為取消 */
|
|
282
|
+
expiredAt?: number;
|
|
283
|
+
/** 線上付款流程狀態,供前端判斷付款頁重開、等待、過期或退款狀態 */
|
|
284
|
+
paymentFlowState?: SOPaymentFlowState;
|
|
226
285
|
/** 訂單接受時間 */
|
|
227
286
|
acceptedAt: number;
|
|
228
287
|
/** 訂單拒絕時間 */
|
|
@@ -262,11 +321,9 @@ export interface SOOrder {
|
|
|
262
321
|
paidAt?: number;
|
|
263
322
|
/** 訂單被取消或拒絕後,已付款的退款時間 undefined 為未退款 */
|
|
264
323
|
refundedAt?: number;
|
|
265
|
-
/**
|
|
324
|
+
/** 消費者收件地址 */
|
|
266
325
|
deliveryAddress?: Address;
|
|
267
|
-
/**
|
|
268
|
-
deliveryAddressLonLat?: number[];
|
|
269
|
-
/** 第三方外送任務 */
|
|
326
|
+
/** 第三方外送配送狀態。店家自己配送時,此欄位不存在。 */
|
|
270
327
|
deliveryTask?: SODeliveryTask;
|
|
271
328
|
/** 付款中的Transaction用來反查付款結果 */
|
|
272
329
|
transactionId?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"online-ordering.js","sourceRoot":"","sources":["../../../projects/sdit-model-lib/src/models/online-ordering.ts"],"names":[],"mappings":";;;AAeA,IAAY,gBAmBX;AAnBD,WAAY,gBAAgB;IAC1B,YAAY;IACZ,qDAAiC,CAAA;IACjC,eAAe;IACf,iEAA6C,CAAA;IAC7C,WAAW;IACX,+CAA2B,CAAA;IAC3B,aAAa;IACb,mDAA+B,CAAA;IAC/B,YAAY;IACZ,uDAAmC,CAAA;IACnC,gBAAgB;IAChB,uDAAmC,CAAA;IACnC,YAAY;IACZ,6DAAyC,CAAA;IACzC,YAAY;IACZ,2DAAuC,CAAA;IACvC,cAAc;IACd,2DAAuC,CAAA;AACzC,CAAC,EAnBW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAmB3B;AAoED,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,iCAAe,CAAA;IACf,mCAAiB,CAAA;AACnB,CAAC,EAJW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAIzB;
|
|
1
|
+
{"version":3,"file":"online-ordering.js","sourceRoot":"","sources":["../../../projects/sdit-model-lib/src/models/online-ordering.ts"],"names":[],"mappings":";;;AAeA,IAAY,gBAmBX;AAnBD,WAAY,gBAAgB;IAC1B,YAAY;IACZ,qDAAiC,CAAA;IACjC,eAAe;IACf,iEAA6C,CAAA;IAC7C,WAAW;IACX,+CAA2B,CAAA;IAC3B,aAAa;IACb,mDAA+B,CAAA;IAC/B,YAAY;IACZ,uDAAmC,CAAA;IACnC,gBAAgB;IAChB,uDAAmC,CAAA;IACnC,YAAY;IACZ,6DAAyC,CAAA;IACzC,YAAY;IACZ,2DAAuC,CAAA;IACvC,cAAc;IACd,2DAAuC,CAAA;AACzC,CAAC,EAnBW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAmB3B;AAoED,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,iCAAe,CAAA;IACf,mCAAiB,CAAA;AACnB,CAAC,EAJW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAIzB;AAsFD,IAAY,gBAEX;AAFD,WAAY,gBAAgB;IAC1B,iCAAa,CAAA;AACf,CAAC,EAFW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAE3B;AAED,IAAY,kBAaX;AAbD,WAAY,kBAAkB;IAC5B,aAAa;IACb,mCAAa,CAAA;IACb,WAAW;IACX,mCAAa,CAAA;IACb,WAAW;IACX,mCAAa,CAAA;IACb,WAAW;IACX,mCAAa,CAAA;IACb,cAAc;IACd,mCAAa,CAAA;IACb,eAAe;IACf,mCAAa,CAAA;AACf,CAAC,EAbW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAa7B;AAWD,IAAY,2BASX;AATD,WAAY,2BAA2B;IACrC,eAAe;IACf,oEAAqC,CAAA;IACrC,mBAAmB;IACnB,0EAA2C,CAAA;IAC3C,gBAAgB;IAChB,8DAA+B,CAAA;IAC/B,WAAW;IACX,kDAAmB,CAAA;AACrB,CAAC,EATW,2BAA2B,GAA3B,mCAA2B,KAA3B,mCAA2B,QAStC;AA6LD,IAAY,+BAGX;AAHD,WAAY,+BAA+B;IACzC,sDAAmB,CAAA;IACnB,kEAA+B,CAAA;AACjC,CAAC,EAHW,+BAA+B,GAA/B,uCAA+B,KAA/B,uCAA+B,QAG1C;AAuCD,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,qCAAqB,CAAA;IACrB,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;IACrB,qCAAqB,CAAA;AACvB,CAAC,EANW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAMvB"}
|
package/models/order.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { Receipt, Transaction } from './receipt';
|
|
|
11
11
|
import { Customer, CustomerPointDetail } from './customer';
|
|
12
12
|
import { Address, Operator } from './store';
|
|
13
13
|
import { OnlinePlatformType, OOReasonCode, OnlineOrderMappingWarningCode } from './online-integration';
|
|
14
|
-
import { DeliveryTask, SOEater, SOOperateParty } from './online-ordering';
|
|
14
|
+
import { Delivery, DeliveryTask, SOEater, SOOperateParty } from './online-ordering';
|
|
15
15
|
import { DiscountMethod } from './discount-module';
|
|
16
16
|
export interface BaseOrder {
|
|
17
17
|
id?: string;
|
|
@@ -186,11 +186,15 @@ export interface Order extends BaseOrder {
|
|
|
186
186
|
expectedPickupAt?: number;
|
|
187
187
|
/** 訂單取消方 */
|
|
188
188
|
canceledByParty?: SOOperateParty;
|
|
189
|
-
/**
|
|
189
|
+
/** 消費者收件地址 */
|
|
190
190
|
deliveryAddress?: Address;
|
|
191
|
-
/**
|
|
192
|
-
|
|
193
|
-
/**
|
|
191
|
+
/** 完整建立配送所需的固定資料。 */
|
|
192
|
+
delivery?: Delivery;
|
|
193
|
+
/**
|
|
194
|
+
* 米特建立後產生的完整配送任務。
|
|
195
|
+
*
|
|
196
|
+
* 店家自行配送時不建立空物件,直接不提供此欄位。
|
|
197
|
+
*/
|
|
194
198
|
deliveryTask?: DeliveryTask;
|
|
195
199
|
/**
|
|
196
200
|
* 線上點餐、UberEats等等外送平台,線上成功收款後的
|
|
@@ -4,7 +4,7 @@ export interface MultiplePaymentConfig {
|
|
|
4
4
|
name: string;
|
|
5
5
|
paymentConfigs: PaymentConfig[];
|
|
6
6
|
}
|
|
7
|
-
export declare type PaymentConfig = BasePaymentConfig | EasyCardConfig | TSBankCreditCardConfig | OnePayConfig | ESunMPayConfig | CustomPaymentConfig | CashPaymentConfig | NcccV3pPaymentConfig | NcccD200PaymentConfig | NcccVX520PaymentConfig | SgSmoochpayOnlineConfig;
|
|
7
|
+
export declare type PaymentConfig = BasePaymentConfig | EasyCardConfig | TSBankCreditCardConfig | OnePayConfig | ESunMPayConfig | CustomPaymentConfig | CashPaymentConfig | NcccV3pPaymentConfig | NcccD200PaymentConfig | NcccVX520PaymentConfig | MyPayPayPagePaymentConfig | SgSmoochpayOnlineConfig | DdpayOnlineConfig | DdpayConfig | LinepayOnlineConfig | NewebpayOnlineConfig | NewebpayConfig;
|
|
8
8
|
export interface BasePaymentConfig {
|
|
9
9
|
provider: PaymentServiceProvider;
|
|
10
10
|
type: PaymentType;
|
|
@@ -97,7 +97,7 @@ export interface LinepayOnlineConfig extends BasePaymentConfig {
|
|
|
97
97
|
}
|
|
98
98
|
export interface NewebpayOnlineConfig extends BasePaymentConfig {
|
|
99
99
|
provider: PaymentServiceProvider.newebpayOnline;
|
|
100
|
-
type: PaymentType.creditCardOn;
|
|
100
|
+
type: PaymentType.creditCardOn | PaymentType.linePayOn | PaymentType.eSunWallet | PaymentType.taiwanPay | PaymentType.twqrOn | PaymentType.aliOn | PaymentType.weixinOn | PaymentType.unknown;
|
|
101
101
|
merchantId: string;
|
|
102
102
|
hashKey: string;
|
|
103
103
|
hashIV: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trusted-solutions/sdit.models",
|
|
3
|
-
"version": "0.65.2-alpha.
|
|
3
|
+
"version": "0.65.2-alpha.5",
|
|
4
4
|
"description": "TODO: Give a short introduction of your project. Let this section explain the objectives or the motivation behind this project.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|