@plyaz/types 1.38.1 → 1.38.2
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { CurrencyCode } from '../../../../locale/types';
|
|
2
2
|
import type { PAYMENT_METHOD, PAYMENT_PROVIDER_TYPE } from '../../../provider';
|
|
3
|
-
import type { Money } from '../../../transaction';
|
|
3
|
+
import type { FeeBreakdown, Money } from '../../../transaction';
|
|
4
|
+
import type { ProviderFeeConfiguration } from '../types';
|
|
4
5
|
import type { FEE_CONTEXT, FEE_TYPE } from './enum';
|
|
5
6
|
export interface CalculateFeeParams {
|
|
6
7
|
amount: Money;
|
|
@@ -11,14 +12,6 @@ export interface CalculateFeeParams {
|
|
|
11
12
|
expedite?: boolean;
|
|
12
13
|
highRisk?: boolean;
|
|
13
14
|
}
|
|
14
|
-
export interface FeeMetadata {
|
|
15
|
-
processingRate?: number;
|
|
16
|
-
platformRate?: number;
|
|
17
|
-
crossBorderRate?: number;
|
|
18
|
-
conversionRate?: number;
|
|
19
|
-
calculatedAt: Date;
|
|
20
|
-
ruleVersion?: string;
|
|
21
|
-
}
|
|
22
15
|
/**
|
|
23
16
|
* Unified Fee Rule
|
|
24
17
|
*/
|
|
@@ -36,3 +29,31 @@ export interface FeeRule<TMetadata extends object = {}> {
|
|
|
36
29
|
maxLimit?: number;
|
|
37
30
|
metadata?: TMetadata;
|
|
38
31
|
}
|
|
32
|
+
export type HandlerParams = CalculateFeeParams;
|
|
33
|
+
export type FeeSection = Partial<{
|
|
34
|
+
processingFee: Money;
|
|
35
|
+
platformFee: Money;
|
|
36
|
+
crossBorderFee: Money;
|
|
37
|
+
currencyConversionFee: Money;
|
|
38
|
+
riskFee: Money;
|
|
39
|
+
complianceFee: Money;
|
|
40
|
+
expediteFee: Money;
|
|
41
|
+
networkFee: Money;
|
|
42
|
+
gasFee: Money;
|
|
43
|
+
chargebackFee: Money;
|
|
44
|
+
refundFee: Money;
|
|
45
|
+
}>;
|
|
46
|
+
export type FeeMetadata = Partial<{
|
|
47
|
+
calculatedAt: Date;
|
|
48
|
+
processingRate: number;
|
|
49
|
+
platformRate: number;
|
|
50
|
+
crossBorderRate: number;
|
|
51
|
+
conversionRate: number;
|
|
52
|
+
}>;
|
|
53
|
+
export interface ApplyFeeRuleType {
|
|
54
|
+
config: FeeRule;
|
|
55
|
+
params: CalculateFeeParams;
|
|
56
|
+
fees: Partial<FeeBreakdown>;
|
|
57
|
+
metadata: FeeMetadata;
|
|
58
|
+
calculation: ProviderFeeConfiguration['calculation'];
|
|
59
|
+
}
|
package/package.json
CHANGED