@use-stall/types 0.1.1 → 0.1.3

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.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Type declarations for Stall SDKs",
5
5
  "types": "index.d.ts",
6
6
  "type": "module",
@@ -60,6 +60,7 @@ export interface IntegrationType {
60
60
  }
61
61
 
62
62
  export interface IntegrationConfigurationType {
63
+ id: string;
63
64
  integration_id: string;
64
65
  type: IntegrationConnectionType;
65
66
  created_at: number;
@@ -71,6 +72,7 @@ export interface IntegrationConfigurationType {
71
72
  token: string; // For bearer authentication
72
73
  api_key_header: string; // For API key authentication or Custom header
73
74
  api_key_value: string; // For API key authentication or Custom header
75
+ [key: string]: any;
74
76
  };
75
77
  }
76
78
 
@@ -25,7 +25,7 @@ export interface OrganizationType {
25
25
  fulfillments: boolean;
26
26
  fiscalizations: boolean;
27
27
  };
28
- email: string[]; // Other email addresses with access, the primary one is the one with matching the owner uid
28
+ emails: string[]; // Other email addresses with access, the primary one is the one with matching the owner uid
29
29
  created_at: number;
30
30
  updated_at: number;
31
31
  }
package/src/payments.d.ts CHANGED
@@ -1,55 +1,45 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
- export interface UnifiedPaymentMethodType {
1
+ export type MethodsType =
2
+ | "card_present"
3
+ | "tap_to_pay" // mobile tap to pay on android and ios
4
+ | "online_checkout"
5
+ | "payment_link"
6
+ | "qr_code"
7
+ | "mobile_money"
8
+ | "cash"
9
+ | "manual";
10
+
11
+ export interface PaymentProviderType {
3
12
  id: string;
4
- external_id: string;
5
- name: string;
13
+ title: string;
6
14
  description: string;
7
- processing_type: "online" | "manual" | "hardware";
8
- provider_id: string;
9
- provider_name: string;
10
- icon: string;
11
- enabled: boolean;
12
- editable: boolean;
13
- sort_order: number;
14
- supported_options: UnifiedPaymentMethodSupportedOptionsType;
15
- supported_currencies: string[]; // Supported currencies (e.g., ["USD", "EUR"])
16
- payment_plan: {
17
- default: "full" | "partial" | "layaway" | "installment";
18
- options: Array<"full" | "partial" | "layaway" | "installment">;
19
- };
20
- config?: UnifiedPaymentMethodConfigType;
21
- rules: UnifiedPaymentMethodRulesType;
22
- metadata?: Record<string, any>;
15
+ logo: string;
16
+ supported_methods: PaymentMethodType[];
23
17
  }
24
18
 
25
- export interface UnifiedPaymentMethodSupportedOptionsType {
26
- refunds: boolean;
27
- void: boolean;
28
- tipping: boolean;
29
- split: boolean;
30
- offline: boolean;
31
- register: boolean; // Track register sessions
19
+ export interface PaymentMethodType {
20
+ type: MethodsType;
21
+ offline_support: boolean;
32
22
  }
33
23
 
34
- export interface UnifiedPaymentMethodConfigType {
35
- auth_type: "none" | "basic" | "bearer" | "apikey";
36
- headers: Record<string, any>;
37
- params: Record<string, any>;
38
- body: Record<string, any>;
39
- method: "GET" | "POST" | "PUT" | "PATCH";
40
- endpoint: string;
41
- callback_url: string;
42
- webhook_url: string;
43
- redirect: boolean;
44
- redirect_url: string;
45
- }
24
+ export type PaymentCollectionStatus =
25
+ | "pending"
26
+ | "processing"
27
+ | "completed"
28
+ | "failed"
29
+ | "cancelled"
30
+ | "refunded"
31
+ | "partially_refunded";
46
32
 
47
- interface UnifiedPaymentMethodRulesType {
48
- minimum_amount: number;
49
- maximum_amount: number;
50
- requires_approval: boolean;
51
- marks_as_paid: boolean;
52
- marks_as_fulfilled: boolean;
53
- open_drawer: boolean;
54
- has_tendered_amount: boolean;
33
+ export interface PaymentCollectionType {
34
+ id: string;
35
+ created_at: string;
36
+ updated_at: string;
37
+ status: PaymentCollectionStatus;
38
+ amount: {
39
+ currency: string;
40
+ value: number;
41
+ };
42
+ provider_id: string;
43
+ payment_method: PaymentMethodType;
44
+ note: string;
55
45
  }