@use-stall/types 0.3.17 → 0.4.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/device.d.ts +1 -0
- package/src/payments.d.ts +19 -2
package/package.json
CHANGED
package/src/device.d.ts
CHANGED
package/src/payments.d.ts
CHANGED
|
@@ -33,6 +33,22 @@ export interface UnifiedPaymentMethodType {
|
|
|
33
33
|
instant_clear: boolean; // whether the payment is cleared instantly like cash or custom
|
|
34
34
|
}
|
|
35
35
|
|
|
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
|
+
export interface UnifiedChargedPaymentMethodType extends UnifiedPaymentMethodType {
|
|
42
|
+
name: string;
|
|
43
|
+
method_id: string; // the device's payment-method serial/reference; distinct from the
|
|
44
|
+
// top-level UnifiedPaymentCollectionType.external_id (an external provider's own reference)
|
|
45
|
+
original_amount: number;
|
|
46
|
+
cash: {
|
|
47
|
+
tendered: number;
|
|
48
|
+
change: number;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
36
52
|
export interface UnifiedPaymentProviderConfigType {
|
|
37
53
|
id: string;
|
|
38
54
|
provider: string; // provider id
|
|
@@ -53,7 +69,8 @@ export interface UnifiedPaymentProviderConfigType {
|
|
|
53
69
|
|
|
54
70
|
export interface FrontendPaymentMethodType {
|
|
55
71
|
id: string;
|
|
56
|
-
|
|
72
|
+
// Absent for methods with no payment gateway to resolve, e.g. cash.
|
|
73
|
+
provider?: {
|
|
57
74
|
id: string; // provider id
|
|
58
75
|
name: string;
|
|
59
76
|
logo: string;
|
|
@@ -98,7 +115,7 @@ export interface UnifiedPaymentCollectionType {
|
|
|
98
115
|
};
|
|
99
116
|
provider_id: string;
|
|
100
117
|
external_id: string;
|
|
101
|
-
payment_method:
|
|
118
|
+
payment_method: UnifiedChargedPaymentMethodType;
|
|
102
119
|
note: string;
|
|
103
120
|
device: {
|
|
104
121
|
id: string;
|