@use-stall/types 0.8.0 → 0.9.1
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/payments.d.ts +10 -17
package/package.json
CHANGED
package/src/payments.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ export type UnifiedMethodsType =
|
|
|
2
2
|
| "terminal"
|
|
3
3
|
| "soft_pos" // mobile tap to pay on android and ios
|
|
4
4
|
| "payment_link" // hosted checkout, payment links, qr codes
|
|
5
|
-
| "connector_payments"
|
|
6
5
|
| "mobile_money"
|
|
7
6
|
| "cash"
|
|
8
7
|
| "manual";
|
|
@@ -28,16 +27,16 @@ export interface UnifiedPaymentProviderType {
|
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
export interface UnifiedPaymentMethodType {
|
|
30
|
+
id: string;
|
|
31
|
+
title: string;
|
|
31
32
|
type: UnifiedMethodsType;
|
|
32
33
|
offline_support: boolean;
|
|
33
34
|
instant_clear: boolean; // whether the payment is cleared instantly like cash or custom
|
|
35
|
+
express: boolean; // for mobile money, a phone number is required to collect the payment
|
|
36
|
+
requires_otp: boolean; // for mobile money, an OTP is required to collect the payment
|
|
37
|
+
currencies: string[]; // e.g [ "ZWG", "ZAR", "USD", "EUR",]
|
|
34
38
|
}
|
|
35
39
|
|
|
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
40
|
export interface UnifiedChargedPaymentMethodType extends UnifiedPaymentMethodType {
|
|
42
41
|
name: string;
|
|
43
42
|
method_id: string; // the device's payment-method serial/reference; distinct from the
|
|
@@ -47,6 +46,9 @@ export interface UnifiedChargedPaymentMethodType extends UnifiedPaymentMethodTyp
|
|
|
47
46
|
tendered: number;
|
|
48
47
|
change: number;
|
|
49
48
|
};
|
|
49
|
+
metadata?: {
|
|
50
|
+
[key: string]: any;
|
|
51
|
+
};
|
|
50
52
|
}
|
|
51
53
|
|
|
52
54
|
export interface UnifiedPaymentProviderConfigType {
|
|
@@ -84,19 +86,10 @@ export interface FrontendPaymentMethodType {
|
|
|
84
86
|
}
|
|
85
87
|
|
|
86
88
|
export type UnifiedPaymentCollectionStatus =
|
|
87
|
-
| "
|
|
88
|
-
| "processing"
|
|
89
|
-
| "completed"
|
|
90
|
-
| "failed"
|
|
91
|
-
| "cancelled";
|
|
89
|
+
"pending" | "processing" | "completed" | "failed" | "cancelled";
|
|
92
90
|
|
|
93
91
|
export type UnifiedPaymentCollectionTransactionType =
|
|
94
|
-
| "
|
|
95
|
-
| "return"
|
|
96
|
-
| "refund"
|
|
97
|
-
| "void"
|
|
98
|
-
| "pay-out"
|
|
99
|
-
| "pay-in";
|
|
92
|
+
"sale" | "return" | "refund" | "void" | "pay-out" | "pay-in";
|
|
100
93
|
|
|
101
94
|
export interface UnifiedPaymentCollectionType {
|
|
102
95
|
id: string;
|