@use-stall/types 0.1.2 → 0.1.4

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.2",
3
+ "version": "0.1.4",
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
 
package/src/payments.d.ts CHANGED
@@ -1,55 +1,47 @@
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
+ | "connector_payments"
9
+ | "cash"
10
+ | "manual";
11
+
12
+ export interface PaymentProviderType {
3
13
  id: string;
4
- external_id: string;
5
- name: string;
14
+ title: string;
6
15
  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>;
16
+ logo: string;
17
+ supported_methods: PaymentMethodType[];
18
+ supported_countries: string[];
23
19
  }
24
20
 
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
21
+ export interface PaymentMethodType {
22
+ type: MethodsType;
23
+ offline_support: boolean;
32
24
  }
33
25
 
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
- }
26
+ export type PaymentCollectionStatus =
27
+ | "pending"
28
+ | "processing"
29
+ | "completed"
30
+ | "failed"
31
+ | "cancelled"
32
+ | "refunded"
33
+ | "partially_refunded";
46
34
 
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;
35
+ export interface PaymentCollectionType {
36
+ id: string;
37
+ created_at: string;
38
+ updated_at: string;
39
+ status: PaymentCollectionStatus;
40
+ amount: {
41
+ currency: string;
42
+ value: number;
43
+ };
44
+ provider_id: string;
45
+ payment_method: PaymentMethodType;
46
+ note: string;
55
47
  }