@use-stall/types 0.7.0 → 0.9.0
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/package.json +1 -1
- package/src/orders.d.ts +3 -4
- package/src/payments.d.ts +7 -16
package/package.json
CHANGED
package/src/orders.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { UnifiedCustomerAddressType } from "./customers";
|
|
2
2
|
import type {
|
|
3
3
|
UnifiedFulfillmentStatus,
|
|
4
|
-
UnifiedFulfillmentType,
|
|
5
4
|
} from "./fulfillment";
|
|
6
5
|
import type { UnifiedPaymentCollectionType } from "./payments";
|
|
7
6
|
|
|
@@ -46,7 +45,7 @@ export interface UnifiedOrderType {
|
|
|
46
45
|
discounts: UnifiedDiscountType[];
|
|
47
46
|
fulfillment: {
|
|
48
47
|
status: UnifiedFulfillmentStatus;
|
|
49
|
-
fulfillments:
|
|
48
|
+
fulfillments: string[];// id(s) of the fulfillments
|
|
50
49
|
};
|
|
51
50
|
refunds: {
|
|
52
51
|
id: string;
|
|
@@ -108,7 +107,7 @@ export interface UnifiedOrderPaymentDetailsType {
|
|
|
108
107
|
currency: string;
|
|
109
108
|
date: number; // Timestamp in milliseconds
|
|
110
109
|
timestamp: string; // ISO string format
|
|
111
|
-
payments:
|
|
110
|
+
payments: string[]; // id(s) of the payments
|
|
112
111
|
status: "pending" | "processing" | "paid" | "partially_paid";
|
|
113
112
|
metadata?: Record<string, any>;
|
|
114
113
|
}
|
|
@@ -148,7 +147,7 @@ export interface UnifiedOrderRefundType {
|
|
|
148
147
|
name: string;
|
|
149
148
|
cost_per_item: number;
|
|
150
149
|
}[];
|
|
151
|
-
payments:
|
|
150
|
+
payments: string[]; // id(s) of the payments
|
|
152
151
|
staff_id: string;
|
|
153
152
|
device_id: string;
|
|
154
153
|
location_id: string;
|
package/src/payments.d.ts
CHANGED
|
@@ -31,13 +31,10 @@ export interface UnifiedPaymentMethodType {
|
|
|
31
31
|
type: UnifiedMethodsType;
|
|
32
32
|
offline_support: boolean;
|
|
33
33
|
instant_clear: boolean; // whether the payment is cleared instantly like cash or custom
|
|
34
|
+
express: boolean; // for mobile money, a phone number is required to collect the payment
|
|
35
|
+
requires_otp: boolean; // for mobile money, an OTP is required to collect the payment
|
|
34
36
|
}
|
|
35
37
|
|
|
36
|
-
// The method actually used to collect one specific payment — richer than
|
|
37
|
-
// UnifiedPaymentMethodType (which just describes what a provider supports), since it
|
|
38
|
-
// captures the named device config and this collection's own details. No optional fields —
|
|
39
|
-
// original_amount/cash always carry real (possibly zero) values so callers never need to
|
|
40
|
-
// null-check them.
|
|
41
38
|
export interface UnifiedChargedPaymentMethodType extends UnifiedPaymentMethodType {
|
|
42
39
|
name: string;
|
|
43
40
|
method_id: string; // the device's payment-method serial/reference; distinct from the
|
|
@@ -47,6 +44,9 @@ export interface UnifiedChargedPaymentMethodType extends UnifiedPaymentMethodTyp
|
|
|
47
44
|
tendered: number;
|
|
48
45
|
change: number;
|
|
49
46
|
};
|
|
47
|
+
metadata?: {
|
|
48
|
+
[key: string]: any;
|
|
49
|
+
};
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
export interface UnifiedPaymentProviderConfigType {
|
|
@@ -84,19 +84,10 @@ export interface FrontendPaymentMethodType {
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
export type UnifiedPaymentCollectionStatus =
|
|
87
|
-
| "
|
|
88
|
-
| "processing"
|
|
89
|
-
| "completed"
|
|
90
|
-
| "failed"
|
|
91
|
-
| "cancelled";
|
|
87
|
+
"pending" | "processing" | "completed" | "failed" | "cancelled";
|
|
92
88
|
|
|
93
89
|
export type UnifiedPaymentCollectionTransactionType =
|
|
94
|
-
| "
|
|
95
|
-
| "return"
|
|
96
|
-
| "refund"
|
|
97
|
-
| "void"
|
|
98
|
-
| "pay-out"
|
|
99
|
-
| "pay-in";
|
|
90
|
+
"sale" | "return" | "refund" | "void" | "pay-out" | "pay-in";
|
|
100
91
|
|
|
101
92
|
export interface UnifiedPaymentCollectionType {
|
|
102
93
|
id: string;
|