@plyaz/types 1.14.4 → 1.14.6
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/dist/index.cjs +210 -210
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +202 -202
- package/dist/index.js.map +1 -1
- package/dist/logger/types.d.ts +3 -0
- package/dist/payments/base-error/types.d.ts +10 -10
- package/dist/payments/events/emitter/types.d.ts +9 -9
- package/dist/payments/events/enums.d.ts +3 -3
- package/dist/payments/events/types.d.ts +11 -11
- package/dist/payments/events/unified-event/types.d.ts +7 -7
- package/dist/payments/gateways/provider/types.d.ts +5 -5
- package/dist/payments/gateways/routings/types.d.ts +18 -18
- package/dist/payments/index.cjs +210 -210
- package/dist/payments/index.cjs.map +1 -1
- package/dist/payments/index.js +202 -202
- package/dist/payments/index.js.map +1 -1
- package/dist/payments/provider/adapter/types.d.ts +5 -5
- package/dist/payments/provider/core/types.d.ts +18 -18
- package/dist/payments/provider/payment-provider/types.d.ts +8 -8
- package/dist/payments/provider/provider-capability/enums.d.ts +6 -6
- package/dist/payments/request/types.d.ts +6 -6
- package/dist/payments/service/types.d.ts +5 -5
- package/package.json +1 -1
package/dist/logger/types.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export interface LoggerInterface {
|
|
|
21
21
|
}
|
|
22
22
|
export type LoggerMethodTypes = 'debug' | 'info' | 'warn' | 'error' | 'fatal';
|
|
23
23
|
export type LoggerEnvironment = 'development' | 'production' | 'staging';
|
|
24
|
+
export type LoggerTransport = 'pino' | 'console';
|
|
24
25
|
/**
|
|
25
26
|
* Configuration for PackageLogger instances
|
|
26
27
|
*/
|
|
@@ -35,6 +36,8 @@ export interface PackageLoggerConfig {
|
|
|
35
36
|
correlationId?: string;
|
|
36
37
|
/** Minimum log level to output */
|
|
37
38
|
minLevel?: LoggerMethodTypes;
|
|
39
|
+
/** Transport type: 'pino' (structured JSON) or 'console' (formatted output with ANSI colors). Default: 'pino' */
|
|
40
|
+
transport?: LoggerTransport;
|
|
38
41
|
}
|
|
39
42
|
/**
|
|
40
43
|
* Extended logger interface with package context support
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PAYMENT_METHOD, PAYMENT_PROVIDER_TYPE, ProviderCapabilities, ProviderConfiguration } from '../provider';
|
|
2
2
|
import type { Money } from '../transaction';
|
|
3
3
|
import type { BaseErrorContext } from '../../api';
|
|
4
|
-
import type { EventProcessingMetadata, PaymentEventPayload,
|
|
4
|
+
import type { EventProcessingMetadata, PaymentEventPayload, PAYMENT_EVENT_TYPE } from '../events';
|
|
5
5
|
import type { PAYMENT_ERROR_CATEGORY } from './enum';
|
|
6
6
|
import type { ERROR_SEVERITY } from '../../errors';
|
|
7
7
|
import type { CurrencyCode } from '../../locale/types';
|
|
@@ -9,9 +9,9 @@ import type { CurrencyCode } from '../../locale/types';
|
|
|
9
9
|
* Base adapter options used for constructing provider adapters.
|
|
10
10
|
*/
|
|
11
11
|
export interface BasePaymentAdapterOptions {
|
|
12
|
-
name:
|
|
12
|
+
name: PAYMENT_PROVIDER_TYPE;
|
|
13
13
|
apiVersion: string;
|
|
14
|
-
methods:
|
|
14
|
+
methods: PAYMENT_METHOD[];
|
|
15
15
|
currencies: CurrencyCode[];
|
|
16
16
|
capabilities: ProviderCapabilities;
|
|
17
17
|
providerConfiguration: ProviderConfiguration;
|
|
@@ -19,7 +19,7 @@ export interface BasePaymentAdapterOptions {
|
|
|
19
19
|
export interface ErrorPatternAnalysis {
|
|
20
20
|
totalErrors: number;
|
|
21
21
|
errorsByCategory: Record<PAYMENT_ERROR_CATEGORY, number>;
|
|
22
|
-
errorsByProvider: Record<
|
|
22
|
+
errorsByProvider: Record<PAYMENT_PROVIDER_TYPE, number>;
|
|
23
23
|
errorsBySeverity: Record<SeverityError, number>;
|
|
24
24
|
errorsByCode: Record<string, number>;
|
|
25
25
|
retryableErrorsCount: number;
|
|
@@ -56,7 +56,7 @@ export interface VelocityMetrics {
|
|
|
56
56
|
*/
|
|
57
57
|
export interface PaymentErrorOptions {
|
|
58
58
|
/** Payment provider involved */
|
|
59
|
-
provider?:
|
|
59
|
+
provider?: PAYMENT_PROVIDER_TYPE;
|
|
60
60
|
/** Related transaction ID */
|
|
61
61
|
transactionId?: string;
|
|
62
62
|
/** Affected user ID */
|
|
@@ -91,7 +91,7 @@ export interface PaymentErrorContext extends BaseErrorContext {
|
|
|
91
91
|
/** IP address of the request */
|
|
92
92
|
ipAddress?: string;
|
|
93
93
|
/** Payment method being used */
|
|
94
|
-
paymentMethod?:
|
|
94
|
+
paymentMethod?: PAYMENT_METHOD;
|
|
95
95
|
/** Payment amount involved */
|
|
96
96
|
amount?: Money;
|
|
97
97
|
/** Provider-specific error information */
|
|
@@ -144,7 +144,7 @@ export interface PaymentErrorLogFormat {
|
|
|
144
144
|
severity: SeverityError;
|
|
145
145
|
retryable: boolean;
|
|
146
146
|
userFacing: boolean;
|
|
147
|
-
provider?:
|
|
147
|
+
provider?: PAYMENT_PROVIDER_TYPE;
|
|
148
148
|
transactionId?: string;
|
|
149
149
|
userId?: string;
|
|
150
150
|
context: PaymentErrorContext;
|
|
@@ -154,8 +154,8 @@ export interface PaymentErrorLogFormat {
|
|
|
154
154
|
}
|
|
155
155
|
export interface BuildUnifiedEventOptions {
|
|
156
156
|
rawEvent: Record<string, unknown>;
|
|
157
|
-
provider:
|
|
158
|
-
normalizedEventType:
|
|
157
|
+
provider: PAYMENT_PROVIDER_TYPE;
|
|
158
|
+
normalizedEventType: PAYMENT_EVENT_TYPE;
|
|
159
159
|
normalizedData: PaymentEventPayload;
|
|
160
160
|
processingMetadata: EventProcessingMetadata;
|
|
161
161
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PAYMENT_EVENT_TYPE } from '../enums';
|
|
2
2
|
import type { EventRetryConfig, PaymentEvent, PaymentEventPayload } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* Payment event emitter interface that extends the base event system
|
|
@@ -19,7 +19,7 @@ export interface EventProcessingResult<TMetadata extends object = {}> {
|
|
|
19
19
|
/** Unique emission ID for tracking this processing */
|
|
20
20
|
emissionId: string;
|
|
21
21
|
/** Event type that was processed */
|
|
22
|
-
eventType:
|
|
22
|
+
eventType: PAYMENT_EVENT_TYPE;
|
|
23
23
|
/** Total number of handlers triggered */
|
|
24
24
|
totalHandlers: number;
|
|
25
25
|
/** Number of handlers that succeeded */
|
|
@@ -51,7 +51,7 @@ export interface PaymentEventEmitter {
|
|
|
51
51
|
* @param options - Additional emission options
|
|
52
52
|
* @returns Promise that resolves when emission is complete
|
|
53
53
|
*/
|
|
54
|
-
emit(eventType:
|
|
54
|
+
emit(eventType: PAYMENT_EVENT_TYPE, payload: PaymentEventPayload, options?: EventEmissionOptions): Promise<EventEmissionResult>;
|
|
55
55
|
/**
|
|
56
56
|
* Emit event and wait for all handlers to complete processing.
|
|
57
57
|
* Useful for critical events that require synchronous processing.
|
|
@@ -61,7 +61,7 @@ export interface PaymentEventEmitter {
|
|
|
61
61
|
* @param timeout - Maximum wait time in milliseconds
|
|
62
62
|
* @returns Promise with aggregated handler results
|
|
63
63
|
*/
|
|
64
|
-
emitAndWait(eventType:
|
|
64
|
+
emitAndWait(eventType: PAYMENT_EVENT_TYPE, payload: PaymentEventPayload, timeout?: number): Promise<EventProcessingResult[]>;
|
|
65
65
|
/**
|
|
66
66
|
* Subscribe to specific payment event types with typed handlers.
|
|
67
67
|
* Handlers will be called for matching events.
|
|
@@ -70,7 +70,7 @@ export interface PaymentEventEmitter {
|
|
|
70
70
|
* @param handler - Typed event handler function
|
|
71
71
|
* @param options - Handler configuration options
|
|
72
72
|
*/
|
|
73
|
-
on(eventType:
|
|
73
|
+
on(eventType: PAYMENT_EVENT_TYPE, handler: PaymentEventHandler, options?: EventHandlerOptions): void;
|
|
74
74
|
/**
|
|
75
75
|
* Subscribe to multiple event types with pattern matching.
|
|
76
76
|
* Supports wildcards and complex filtering patterns.
|
|
@@ -96,20 +96,20 @@ export interface PaymentEventEmitter {
|
|
|
96
96
|
* @param handler - Event handler function
|
|
97
97
|
* @param options - Handler configuration options
|
|
98
98
|
*/
|
|
99
|
-
once(eventType:
|
|
99
|
+
once(eventType: PAYMENT_EVENT_TYPE, handler: PaymentEventHandler, options?: EventHandlerOptions): void;
|
|
100
100
|
/**
|
|
101
101
|
* Remove event listener for specific event type and handler.
|
|
102
102
|
*
|
|
103
103
|
* @param eventType - Event type to unsubscribe from
|
|
104
104
|
* @param handler - Handler function to remove
|
|
105
105
|
*/
|
|
106
|
-
off(eventType:
|
|
106
|
+
off(eventType: PAYMENT_EVENT_TYPE, handler: PaymentEventHandler): void;
|
|
107
107
|
/**
|
|
108
108
|
* Remove all event listeners for specific event type.
|
|
109
109
|
*
|
|
110
110
|
* @param eventType - Event type to clear all handlers for
|
|
111
111
|
*/
|
|
112
|
-
removeAllListeners(eventType:
|
|
112
|
+
removeAllListeners(eventType: PAYMENT_EVENT_TYPE): void;
|
|
113
113
|
/**
|
|
114
114
|
* Get current event emission metrics and statistics.
|
|
115
115
|
*
|
|
@@ -276,7 +276,7 @@ export interface EventEmissionMetrics {
|
|
|
276
276
|
averageExecutionTime: number;
|
|
277
277
|
};
|
|
278
278
|
/** Event type breakdown */
|
|
279
|
-
eventTypeBreakdown: Record<
|
|
279
|
+
eventTypeBreakdown: Record<PAYMENT_EVENT_TYPE, number>;
|
|
280
280
|
/** Error statistics */
|
|
281
281
|
errorStatistics: {
|
|
282
282
|
totalErrors: number;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* - Use present tense for ongoing events, past tense for completed events
|
|
9
9
|
* - Include both success and failure events for complete audit trails
|
|
10
10
|
*/
|
|
11
|
-
export declare enum
|
|
11
|
+
export declare enum PAYMENT_EVENT_TYPE {
|
|
12
12
|
PaymentInitiated = "payment.initiated",
|
|
13
13
|
PaymentProcessing = "payment.processing",
|
|
14
14
|
PaymentRequiresAction = "payment.requires_action",
|
|
@@ -82,7 +82,7 @@ export declare enum PAYMENTEVENTTYPE {
|
|
|
82
82
|
/**
|
|
83
83
|
* Payment event categories for organization and routing.
|
|
84
84
|
*/
|
|
85
|
-
export declare enum
|
|
85
|
+
export declare enum PAYMENT_EVENT_CATEGORY {
|
|
86
86
|
TRANSACTION = "transaction",
|
|
87
87
|
REFUND = "refund",
|
|
88
88
|
PROVIDER = "provider",
|
|
@@ -96,7 +96,7 @@ export declare enum PAYMENTEVENTCATEGORY {
|
|
|
96
96
|
/**
|
|
97
97
|
* Error categories for payment events.
|
|
98
98
|
*/
|
|
99
|
-
export declare enum
|
|
99
|
+
export declare enum PAYMENT_EVENT_ERROR_CATEGORY {
|
|
100
100
|
UserError = "user_error",// User input or action errors
|
|
101
101
|
ProviderError = "provider_error",// Payment provider errors
|
|
102
102
|
SystemError = "system_error",// Internal system errors
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PAYMENT_METHOD, PAYMENT_PROVIDER_TYPE, PAYMENT_STATUS, PRODUCT_TYPE, USER_TYPE } from '../provider';
|
|
2
2
|
import type { FeeBreakdown, Money } from '../transaction';
|
|
3
|
-
import type {
|
|
3
|
+
import type { PAYMENT_EVENT_ERROR_CATEGORY, PAYMENT_EVENT_CATEGORY, PAYMENT_EVENT_TYPE } from './enums';
|
|
4
4
|
/**
|
|
5
5
|
* Core payment event interface that extends the base Event interface
|
|
6
6
|
* from @plyaz/events while adding payment-specific data and context.
|
|
7
7
|
*/
|
|
8
8
|
export interface PaymentEvent extends Event {
|
|
9
9
|
/** Payment-specific event type */
|
|
10
|
-
type:
|
|
10
|
+
type: PAYMENT_EVENT_TYPE;
|
|
11
11
|
/** Payment event payload with business data */
|
|
12
12
|
payload: PaymentEventPayload;
|
|
13
13
|
/** Event metadata for processing and routing */
|
|
@@ -24,21 +24,21 @@ export interface PaymentEventPayload<TProviderMetadata extends Record<string, st
|
|
|
24
24
|
/** User ID who initiated or is affected by this event */
|
|
25
25
|
userId: string;
|
|
26
26
|
/** Type of user for business logic and permissions */
|
|
27
|
-
userType:
|
|
27
|
+
userType: USER_TYPE;
|
|
28
28
|
/** Payment amount and currency (for monetary events) */
|
|
29
29
|
amount?: Money;
|
|
30
30
|
/** Payment provider involved in this event */
|
|
31
|
-
provider:
|
|
31
|
+
provider: PAYMENT_PROVIDER_TYPE;
|
|
32
32
|
/** Current payment status after this event */
|
|
33
|
-
status:
|
|
33
|
+
status: PAYMENT_STATUS;
|
|
34
34
|
/** Previous status before this event (for status changes) */
|
|
35
|
-
previousStatus?:
|
|
35
|
+
previousStatus?: PAYMENT_STATUS;
|
|
36
36
|
/** Payment method used or affected */
|
|
37
|
-
paymentMethod?:
|
|
37
|
+
paymentMethod?: PAYMENT_METHOD;
|
|
38
38
|
/** Product information related to the payment */
|
|
39
39
|
productInfo?: {
|
|
40
40
|
productId: string;
|
|
41
|
-
productType:
|
|
41
|
+
productType: PRODUCT_TYPE;
|
|
42
42
|
productTitle?: string;
|
|
43
43
|
};
|
|
44
44
|
/** Error information for failed events */
|
|
@@ -78,7 +78,7 @@ export interface PaymentEventMetadata {
|
|
|
78
78
|
/** Whether this event requires immediate processing */
|
|
79
79
|
urgent: boolean;
|
|
80
80
|
/** Event category for filtering and routing */
|
|
81
|
-
category:
|
|
81
|
+
category: PAYMENT_EVENT_CATEGORY;
|
|
82
82
|
/** Tags for event classification and filtering */
|
|
83
83
|
tags: string[];
|
|
84
84
|
/** Correlation ID for tracking related events */
|
|
@@ -115,7 +115,7 @@ export interface PaymentEventError {
|
|
|
115
115
|
/** Human-readable error message */
|
|
116
116
|
message: string;
|
|
117
117
|
/** Error category for handling logic */
|
|
118
|
-
category:
|
|
118
|
+
category: PAYMENT_EVENT_ERROR_CATEGORY;
|
|
119
119
|
/** Whether this error condition is retryable */
|
|
120
120
|
retryable: boolean;
|
|
121
121
|
/** Provider-specific error code if applicable */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { PAYMENT_PROVIDER_TYPE, PAYMENT_STATUS } from '../../provider';
|
|
2
|
+
import type { PAYMENT_EVENT_TYPE } from '../enums';
|
|
3
3
|
import type { PaymentEventPayload } from '../types';
|
|
4
4
|
import type { EVENTPROCESSINGSTATUS } from './enums';
|
|
5
5
|
/**
|
|
@@ -16,13 +16,13 @@ export interface UnifiedProviderEvent<TRawEvent extends object = {}, TNormalized
|
|
|
16
16
|
/** Unique event ID generated by our system */
|
|
17
17
|
id: string;
|
|
18
18
|
/** Provider that sent this event */
|
|
19
|
-
provider:
|
|
19
|
+
provider: PAYMENT_PROVIDER_TYPE;
|
|
20
20
|
/** Provider's original event ID for reference */
|
|
21
21
|
providerEventId: string;
|
|
22
22
|
/** Provider's original event type as received */
|
|
23
23
|
providerEventType: string;
|
|
24
24
|
/** Our normalized event type */
|
|
25
|
-
normalizedEventType:
|
|
25
|
+
normalizedEventType: PAYMENT_EVENT_TYPE;
|
|
26
26
|
/** Normalized event data in our standard format */
|
|
27
27
|
normalizedData: TNormalizedData;
|
|
28
28
|
/** Original raw event data from provider (for debugging/audit) */
|
|
@@ -110,7 +110,7 @@ export interface DataExtractionResult<TValue extends object | string | number |
|
|
|
110
110
|
*/
|
|
111
111
|
export interface ProviderEventMapping {
|
|
112
112
|
/** Provider this mapping applies to */
|
|
113
|
-
provider:
|
|
113
|
+
provider: PAYMENT_PROVIDER_TYPE;
|
|
114
114
|
/** Provider API version this mapping supports */
|
|
115
115
|
providerApiVersion?: string;
|
|
116
116
|
/** Mapping configuration version */
|
|
@@ -135,7 +135,7 @@ export interface EventTypeMapping {
|
|
|
135
135
|
/** Provider's event type */
|
|
136
136
|
providerEventType: string;
|
|
137
137
|
/** Our normalized event type */
|
|
138
|
-
normalizedEventType:
|
|
138
|
+
normalizedEventType: PAYMENT_EVENT_TYPE;
|
|
139
139
|
/** Confidence level of this mapping (0.0 - 1.0) */
|
|
140
140
|
confidence: number;
|
|
141
141
|
/** Whether this mapping is currently active */
|
|
@@ -152,7 +152,7 @@ export interface StatusMapping<TContext extends object = {}> {
|
|
|
152
152
|
/** Provider's status value */
|
|
153
153
|
providerStatus: string;
|
|
154
154
|
/** Our normalized status */
|
|
155
|
-
normalizedStatus:
|
|
155
|
+
normalizedStatus: PAYMENT_STATUS;
|
|
156
156
|
/** Additional context required for this mapping */
|
|
157
157
|
context?: TContext;
|
|
158
158
|
/** Whether this is a terminal status */
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { CurrencyCode } from '../../../locale/types';
|
|
2
|
-
import type {
|
|
2
|
+
import type { PAYMENT_METHOD, PAYMENT_PROVIDER_TYPE } from '../../provider';
|
|
3
3
|
/**
|
|
4
4
|
* Base configuration interface that all payment providers must implement.
|
|
5
5
|
* This ensures consistent configuration structure across all providers.
|
|
6
6
|
*/
|
|
7
7
|
export interface BaseProviderConfig {
|
|
8
8
|
/** Provider identification */
|
|
9
|
-
provider:
|
|
9
|
+
provider: PAYMENT_PROVIDER_TYPE;
|
|
10
10
|
/** Display name for this provider */
|
|
11
11
|
displayName: string;
|
|
12
12
|
/** Whether this provider is currently enabled */
|
|
@@ -241,7 +241,7 @@ export interface ProviderFeeConfiguration {
|
|
|
241
241
|
currency: CurrencyCode;
|
|
242
242
|
};
|
|
243
243
|
/** Payment method specific fees */
|
|
244
|
-
methodFees: Record<
|
|
244
|
+
methodFees: Record<PAYMENT_METHOD, {
|
|
245
245
|
percentage: number;
|
|
246
246
|
fixed: number;
|
|
247
247
|
currency: CurrencyCode;
|
|
@@ -322,12 +322,12 @@ export interface ProviderLimitsConfiguration<TProviderSpecific extends object =
|
|
|
322
322
|
/** Transaction amount limits */
|
|
323
323
|
amounts: {
|
|
324
324
|
/** Minimum transaction amount */
|
|
325
|
-
minimum: Record<
|
|
325
|
+
minimum: Record<PAYMENT_METHOD, {
|
|
326
326
|
amount: number;
|
|
327
327
|
currency: CurrencyCode;
|
|
328
328
|
}>;
|
|
329
329
|
/** Maximum transaction amount */
|
|
330
|
-
maximum: Record<
|
|
330
|
+
maximum: Record<PAYMENT_METHOD, {
|
|
331
331
|
amount: number;
|
|
332
332
|
currency: CurrencyCode;
|
|
333
333
|
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CurrencyCode } from '../../../locale/types';
|
|
2
|
-
import type {
|
|
2
|
+
import type { PAYMENT_METHOD, PAYMENT_PROVIDER_TYPE, TRANSACTION_TYPE, USER_TYPE } from '../../provider';
|
|
3
3
|
import type { VolumeTier } from '../provider/types';
|
|
4
4
|
import type { COSTOPTIMIZATIONSTRATEGY, FAILOVERSTRATEGY, LOADBALANCINGSTRATEGY, PERFORMANCEMETRICTYPE, REGULATORYFRAMEWORK, ROUTINGSTRATEGY } from './enums';
|
|
5
5
|
/**
|
|
@@ -31,7 +31,7 @@ export interface ProviderSelectionRules {
|
|
|
31
31
|
/** Default provider preferences */
|
|
32
32
|
defaultProviders: ProviderPreference[];
|
|
33
33
|
/** Payment method specific preferences */
|
|
34
|
-
methodSpecificProviders: Record<
|
|
34
|
+
methodSpecificProviders: Record<PAYMENT_METHOD, ProviderPreference[]>;
|
|
35
35
|
/** Amount-based provider selection */
|
|
36
36
|
amountBasedSelection: AmountBasedRule[];
|
|
37
37
|
/** Currency-specific provider preferences */
|
|
@@ -39,7 +39,7 @@ export interface ProviderSelectionRules {
|
|
|
39
39
|
/** Region-specific provider preferences */
|
|
40
40
|
regionSpecificProviders: Record<string, ProviderPreference[]>;
|
|
41
41
|
/** User type specific preferences */
|
|
42
|
-
userTypeProviders: Record<
|
|
42
|
+
userTypeProviders: Record<USER_TYPE, ProviderPreference[]>;
|
|
43
43
|
/** Time-based provider selection */
|
|
44
44
|
timeBasedSelection: TimeBasedRule[];
|
|
45
45
|
/** Custom selection rules */
|
|
@@ -50,7 +50,7 @@ export interface ProviderSelectionRules {
|
|
|
50
50
|
*/
|
|
51
51
|
export interface ProviderPreference {
|
|
52
52
|
/** Provider identifier */
|
|
53
|
-
provider:
|
|
53
|
+
provider: PAYMENT_PROVIDER_TYPE;
|
|
54
54
|
/** Weight/priority (higher = preferred) */
|
|
55
55
|
weight: number;
|
|
56
56
|
/** Traffic allocation percentage */
|
|
@@ -159,11 +159,11 @@ export interface CustomSelectionRule {
|
|
|
159
159
|
/** Provider selection when rule matches */
|
|
160
160
|
providerSelection: {
|
|
161
161
|
/** Providers to prefer */
|
|
162
|
-
preferred:
|
|
162
|
+
preferred: PAYMENT_PROVIDER_TYPE[];
|
|
163
163
|
/** Providers to avoid */
|
|
164
|
-
excluded:
|
|
164
|
+
excluded: PAYMENT_PROVIDER_TYPE[];
|
|
165
165
|
/** Weight adjustments */
|
|
166
|
-
weightAdjustments: Record<
|
|
166
|
+
weightAdjustments: Record<PAYMENT_PROVIDER_TYPE, number>;
|
|
167
167
|
};
|
|
168
168
|
/** Rule priority */
|
|
169
169
|
priority: number;
|
|
@@ -228,7 +228,7 @@ export interface FailoverConfiguration {
|
|
|
228
228
|
/** Failover strategy */
|
|
229
229
|
strategy: FAILOVERSTRATEGY;
|
|
230
230
|
/** Provider priority order for failover */
|
|
231
|
-
providerOrder:
|
|
231
|
+
providerOrder: PAYMENT_PROVIDER_TYPE[];
|
|
232
232
|
/** Failure detection settings */
|
|
233
233
|
failureDetection: {
|
|
234
234
|
/** Consecutive failures before failover */
|
|
@@ -287,7 +287,7 @@ export interface GeographicRoutingConfig {
|
|
|
287
287
|
/** Enable cross-border payments */
|
|
288
288
|
enabled: boolean;
|
|
289
289
|
/** Preferred providers for cross-border */
|
|
290
|
-
preferredProviders:
|
|
290
|
+
preferredProviders: PAYMENT_PROVIDER_TYPE[];
|
|
291
291
|
/** Additional fees for cross-border */
|
|
292
292
|
additionalFees: {
|
|
293
293
|
percentage: number;
|
|
@@ -308,7 +308,7 @@ export interface GeographicRoutingConfig {
|
|
|
308
308
|
/** Zone definitions */
|
|
309
309
|
zones: Record<string, {
|
|
310
310
|
currencies: CurrencyCode[];
|
|
311
|
-
preferredProviders:
|
|
311
|
+
preferredProviders: PAYMENT_PROVIDER_TYPE[];
|
|
312
312
|
}>;
|
|
313
313
|
};
|
|
314
314
|
}
|
|
@@ -321,7 +321,7 @@ export interface RegionRoutingConfig {
|
|
|
321
321
|
/** Preferred providers for this region */
|
|
322
322
|
preferredProviders: ProviderPreference[];
|
|
323
323
|
/** Local payment methods */
|
|
324
|
-
localPaymentMethods:
|
|
324
|
+
localPaymentMethods: PAYMENT_METHOD[];
|
|
325
325
|
/** Regulatory requirements */
|
|
326
326
|
regulations: {
|
|
327
327
|
/** KYC requirements */
|
|
@@ -363,7 +363,7 @@ export interface ComplianceRule {
|
|
|
363
363
|
/** Rule conditions */
|
|
364
364
|
conditions: {
|
|
365
365
|
/** Transaction types affected */
|
|
366
|
-
transactionTypes:
|
|
366
|
+
transactionTypes: TRANSACTION_TYPE[];
|
|
367
367
|
/** Amount thresholds */
|
|
368
368
|
amountThresholds?: {
|
|
369
369
|
min?: {
|
|
@@ -376,7 +376,7 @@ export interface ComplianceRule {
|
|
|
376
376
|
};
|
|
377
377
|
};
|
|
378
378
|
/** User types affected */
|
|
379
|
-
userTypes?:
|
|
379
|
+
userTypes?: USER_TYPE[];
|
|
380
380
|
};
|
|
381
381
|
/** Required actions */
|
|
382
382
|
actions: {
|
|
@@ -401,9 +401,9 @@ export interface LoadBalancingConfig {
|
|
|
401
401
|
/** Load balancing strategy */
|
|
402
402
|
strategy: LOADBALANCINGSTRATEGY;
|
|
403
403
|
/** Traffic weights per provider */
|
|
404
|
-
providerWeights: Record<
|
|
404
|
+
providerWeights: Record<PAYMENT_PROVIDER_TYPE, number>;
|
|
405
405
|
/** Maximum concurrent connections per provider */
|
|
406
|
-
maxConnections?: Record<
|
|
406
|
+
maxConnections?: Record<PAYMENT_PROVIDER_TYPE, number>;
|
|
407
407
|
/** Session stickiness settings */
|
|
408
408
|
stickiness?: {
|
|
409
409
|
enabled: boolean;
|
|
@@ -489,7 +489,7 @@ export interface ABTestExperiment {
|
|
|
489
489
|
/** Routing strategy for variant group */
|
|
490
490
|
strategy?: ROUTINGSTRATEGY;
|
|
491
491
|
/** Preferred provider list */
|
|
492
|
-
preferredProviders?:
|
|
492
|
+
preferredProviders?: PAYMENT_PROVIDER_TYPE[];
|
|
493
493
|
/** Special fee or cost weighting */
|
|
494
494
|
costOptimization?: Partial<CostOptimizationConfig>;
|
|
495
495
|
};
|
|
@@ -498,9 +498,9 @@ export interface ABTestExperiment {
|
|
|
498
498
|
/** Regions to include */
|
|
499
499
|
regions?: string[];
|
|
500
500
|
/** User types to include */
|
|
501
|
-
userTypes?:
|
|
501
|
+
userTypes?: USER_TYPE[];
|
|
502
502
|
/** Payment methods to include */
|
|
503
|
-
paymentMethods?:
|
|
503
|
+
paymentMethods?: PAYMENT_METHOD[];
|
|
504
504
|
};
|
|
505
505
|
/** Start and end times */
|
|
506
506
|
schedule?: {
|