@use-stall/types 0.3.10 → 0.3.12

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@use-stall/types",
3
- "version": "0.3.10",
3
+ "version": "0.3.12",
4
4
  "description": "Type declarations for Stall SDKs",
5
5
  "types": "index.d.ts",
6
6
  "type": "module",
package/src/device.d.ts CHANGED
@@ -18,18 +18,23 @@ export interface DeviceType {
18
18
  connected_at: string;
19
19
  connected_by: string;
20
20
  device_details: DeviceDetails;
21
- payment_methods: {
22
- provider: string;
23
- external_id: string;
24
- name: string;
25
- type: UnifiedMethodsType;
26
- }[];
27
- fulfillment_methods: {
28
- provider: string;
29
- external_id: string;
30
- name: string;
31
- type: UnifiedFulfillmentMethods;
32
- }[];
21
+ payment_methods: DevicePaymentMethod[];
22
+ fulfillment_methods: DeviceFulfillmentMethod[];
23
+ }
24
+
25
+ export interface DevicePaymentMethod {
26
+ provider: string;
27
+ external_id: string;
28
+ name: string;
29
+ type: UnifiedMethodsType;
30
+ supported_currencies: string[];
31
+ }
32
+
33
+ export interface DeviceFulfillmentMethod {
34
+ provider: string;
35
+ external_id: string;
36
+ name: string;
37
+ type: UnifiedFulfillmentMethods;
33
38
  }
34
39
 
35
40
  export interface DeviceDetails {
@@ -5,7 +5,6 @@ export interface OrganizationType {
5
5
  business_type: string;
6
6
  organization_name: string;
7
7
  organization_size: number | string;
8
- base_currency: string;
9
8
  business_address: string;
10
9
  owner: string;
11
10
  active: boolean;
@@ -28,6 +27,17 @@ export interface OrganizationType {
28
27
  timezone: string;
29
28
  onboarded: boolean;
30
29
  country: string;
30
+ currencies: {
31
+ base: string;
32
+ others: {
33
+ // name and rate pair e.g. ZAR: {rate :16.50, created_at:date,updated_at:date}
34
+ [key: string]: {
35
+ rate: number;
36
+ created_at: string;
37
+ updated_at: string;
38
+ };
39
+ };
40
+ };
31
41
  }
32
42
 
33
43
  export interface ReceiptType {
package/src/payments.d.ts CHANGED
@@ -1,10 +1,9 @@
1
1
  export type UnifiedMethodsType =
2
2
  | "terminal"
3
3
  | "soft_pos" // mobile tap to pay on android and ios
4
- | "online_checkout"
5
- | "payment_link"
4
+ | "payment_link" // hosted checkout, payment links, qr codes
6
5
  | "connector_payments"
7
- | "mobile_wallet"
6
+ | "mobile_money"
8
7
  | "cash"
9
8
  | "manual";
10
9
 
@@ -53,7 +52,7 @@ export interface UnifiedPaymentProviderConfigType {
53
52
  }
54
53
 
55
54
  export interface FrontendPaymentMethodType {
56
- id: string;
55
+ id: string;
57
56
  provider: {
58
57
  id: string; // provider id
59
58
  name: string;
@@ -62,6 +61,7 @@ export interface FrontendPaymentMethodType {
62
61
  external_id: string;
63
62
  name: string;
64
63
  type: UnifiedMethodsType;
64
+ supported_currencies: string[];
65
65
  }
66
66
 
67
67
  export type UnifiedPaymentCollectionStatus =
@@ -91,12 +91,19 @@ export interface UnifiedPaymentCollectionType {
91
91
  status: UnifiedPaymentCollectionStatus;
92
92
  type: UnifiedPaymentCollectionTransactionType;
93
93
  amount: {
94
+ base_currency: string;
94
95
  currency: string;
96
+ rate: number; // Rate of the currency if base then 1
95
97
  value: number;
96
98
  };
97
99
  provider_id: string;
100
+ external_id: string;
98
101
  payment_method: UnifiedPaymentMethodType;
99
102
  note: string;
103
+ device: {
104
+ id: string;
105
+ name: string;
106
+ };
100
107
  metadata: {
101
108
  stall_offline_id: string;
102
109
  stall_offline_created_at: string;