@tap-payments/os-micro-frontend-shared 0.1.324-test.1 → 0.1.324-test.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/build/types/segment.d.ts +7 -1
- package/build/types/segment.js +6 -0
- package/build/utils/segment.d.ts +60 -0
- package/build/utils/segment.js +51 -0
- package/package.json +2 -2
package/build/types/segment.d.ts
CHANGED
|
@@ -8,8 +8,14 @@ export declare enum SEGMENT_CODE {
|
|
|
8
8
|
BUSINESS = "BUSINESS",
|
|
9
9
|
PLATFORM = "PLATFORM",
|
|
10
10
|
DEVELOPMENT = "DEVELOPMENT",
|
|
11
|
+
PSP = "PSP",
|
|
11
12
|
PAYMENT_TECHNOLOGY = "PAYMENT_TECHNOLOGY",
|
|
12
13
|
PAYMENT_FACILITATOR = "PAYMENT_FACILITATOR",
|
|
13
14
|
PAYMENT_ACQUIRER = "PAYMENT_ACQUIRER",
|
|
14
|
-
PAYMENT_GATEWAY = "PAYMENT_GATEWAY"
|
|
15
|
+
PAYMENT_GATEWAY = "PAYMENT_GATEWAY",
|
|
16
|
+
BILLING_PLATFORM = "BILLING_PLATFORM",
|
|
17
|
+
COMMERCE_PLATFORM = "COMMERCE_PLATFORM",
|
|
18
|
+
DEVELOPMENT_HOUSE = "DEVELOPMENT_HOUSE",
|
|
19
|
+
PAYMENT_GATEWAY_PROVIDER = "PAYMENT_GATEWAY_PROVIDER",
|
|
20
|
+
RETAIL_PLATFORM = "RETAIL_PLATFORM"
|
|
15
21
|
}
|
package/build/types/segment.js
CHANGED
|
@@ -3,8 +3,14 @@ export var SEGMENT_CODE;
|
|
|
3
3
|
SEGMENT_CODE["BUSINESS"] = "BUSINESS";
|
|
4
4
|
SEGMENT_CODE["PLATFORM"] = "PLATFORM";
|
|
5
5
|
SEGMENT_CODE["DEVELOPMENT"] = "DEVELOPMENT";
|
|
6
|
+
SEGMENT_CODE["PSP"] = "PSP";
|
|
6
7
|
SEGMENT_CODE["PAYMENT_TECHNOLOGY"] = "PAYMENT_TECHNOLOGY";
|
|
7
8
|
SEGMENT_CODE["PAYMENT_FACILITATOR"] = "PAYMENT_FACILITATOR";
|
|
8
9
|
SEGMENT_CODE["PAYMENT_ACQUIRER"] = "PAYMENT_ACQUIRER";
|
|
9
10
|
SEGMENT_CODE["PAYMENT_GATEWAY"] = "PAYMENT_GATEWAY";
|
|
11
|
+
SEGMENT_CODE["BILLING_PLATFORM"] = "BILLING_PLATFORM";
|
|
12
|
+
SEGMENT_CODE["COMMERCE_PLATFORM"] = "COMMERCE_PLATFORM";
|
|
13
|
+
SEGMENT_CODE["DEVELOPMENT_HOUSE"] = "DEVELOPMENT_HOUSE";
|
|
14
|
+
SEGMENT_CODE["PAYMENT_GATEWAY_PROVIDER"] = "PAYMENT_GATEWAY_PROVIDER";
|
|
15
|
+
SEGMENT_CODE["RETAIL_PLATFORM"] = "RETAIL_PLATFORM";
|
|
10
16
|
})(SEGMENT_CODE || (SEGMENT_CODE = {}));
|
package/build/utils/segment.d.ts
CHANGED
|
@@ -1,2 +1,62 @@
|
|
|
1
1
|
import { Segment, SegmentData } from '../types/index.js';
|
|
2
2
|
export declare const getSegmentData: (segments: Segment[], activeSegmentId: string, activeSegments: Segment[]) => SegmentData;
|
|
3
|
+
export declare const getBusinessSegmentConfig: (merchantsIds: string[]) => {
|
|
4
|
+
business?: undefined;
|
|
5
|
+
} | {
|
|
6
|
+
business: {
|
|
7
|
+
merchant: string[];
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export declare const getNonBusinessSegmentConfig: (segmentCode: string, segmentId: string) => {
|
|
11
|
+
payment_provider: {
|
|
12
|
+
technology: {
|
|
13
|
+
orchestrator: string[];
|
|
14
|
+
gateway?: undefined;
|
|
15
|
+
};
|
|
16
|
+
institution?: undefined;
|
|
17
|
+
};
|
|
18
|
+
platform?: undefined;
|
|
19
|
+
development_agency?: undefined;
|
|
20
|
+
} | {
|
|
21
|
+
payment_provider: {
|
|
22
|
+
technology: {
|
|
23
|
+
gateway: string[];
|
|
24
|
+
orchestrator?: undefined;
|
|
25
|
+
};
|
|
26
|
+
institution?: undefined;
|
|
27
|
+
};
|
|
28
|
+
platform?: undefined;
|
|
29
|
+
development_agency?: undefined;
|
|
30
|
+
} | {
|
|
31
|
+
payment_provider: {
|
|
32
|
+
institution: {
|
|
33
|
+
facilitator: string[];
|
|
34
|
+
acquirer?: undefined;
|
|
35
|
+
};
|
|
36
|
+
technology?: undefined;
|
|
37
|
+
};
|
|
38
|
+
platform?: undefined;
|
|
39
|
+
development_agency?: undefined;
|
|
40
|
+
} | {
|
|
41
|
+
payment_provider: {
|
|
42
|
+
institution: {
|
|
43
|
+
acquirer: string[];
|
|
44
|
+
facilitator?: undefined;
|
|
45
|
+
};
|
|
46
|
+
technology?: undefined;
|
|
47
|
+
};
|
|
48
|
+
platform?: undefined;
|
|
49
|
+
development_agency?: undefined;
|
|
50
|
+
} | {
|
|
51
|
+
platform: string[];
|
|
52
|
+
payment_provider?: undefined;
|
|
53
|
+
development_agency?: undefined;
|
|
54
|
+
} | {
|
|
55
|
+
development_agency: string[];
|
|
56
|
+
payment_provider?: undefined;
|
|
57
|
+
platform?: undefined;
|
|
58
|
+
} | {
|
|
59
|
+
payment_provider?: undefined;
|
|
60
|
+
platform?: undefined;
|
|
61
|
+
development_agency?: undefined;
|
|
62
|
+
};
|
package/build/utils/segment.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SEGMENT_CODE } from '../types/index.js';
|
|
1
2
|
import { getDefaultEntityCountry } from './entity';
|
|
2
3
|
export const getSegmentData = (segments, activeSegmentId, activeSegments) => {
|
|
3
4
|
var _a, _b, _c;
|
|
@@ -11,3 +12,53 @@ export const getSegmentData = (segments, activeSegmentId, activeSegments) => {
|
|
|
11
12
|
return Object.assign(Object.assign({}, newSegment), { defaultCountry,
|
|
12
13
|
defaultEntity });
|
|
13
14
|
};
|
|
15
|
+
export const getBusinessSegmentConfig = (merchantsIds) => {
|
|
16
|
+
if (!merchantsIds || !(merchantsIds === null || merchantsIds === void 0 ? void 0 : merchantsIds.length))
|
|
17
|
+
return {};
|
|
18
|
+
return { business: { merchant: merchantsIds } };
|
|
19
|
+
};
|
|
20
|
+
export const getNonBusinessSegmentConfig = (segmentCode, segmentId) => {
|
|
21
|
+
if (segmentCode === SEGMENT_CODE.PAYMENT_TECHNOLOGY) {
|
|
22
|
+
return {
|
|
23
|
+
payment_provider: {
|
|
24
|
+
technology: {
|
|
25
|
+
orchestrator: [segmentId],
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
if (segmentCode === SEGMENT_CODE.PAYMENT_GATEWAY || segmentCode === SEGMENT_CODE.PAYMENT_GATEWAY_PROVIDER) {
|
|
31
|
+
return {
|
|
32
|
+
payment_provider: {
|
|
33
|
+
technology: {
|
|
34
|
+
gateway: [segmentId],
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
if (segmentCode === SEGMENT_CODE.PAYMENT_FACILITATOR) {
|
|
40
|
+
return {
|
|
41
|
+
payment_provider: {
|
|
42
|
+
institution: {
|
|
43
|
+
facilitator: [segmentId],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
if (segmentCode === SEGMENT_CODE.PAYMENT_ACQUIRER) {
|
|
49
|
+
return {
|
|
50
|
+
payment_provider: {
|
|
51
|
+
institution: {
|
|
52
|
+
acquirer: [segmentId],
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
if (segmentCode === SEGMENT_CODE.PLATFORM) {
|
|
58
|
+
return { platform: [segmentId] };
|
|
59
|
+
}
|
|
60
|
+
if (segmentCode === SEGMENT_CODE.DEVELOPMENT) {
|
|
61
|
+
return { development_agency: [segmentId] };
|
|
62
|
+
}
|
|
63
|
+
return {};
|
|
64
|
+
};
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tap-payments/os-micro-frontend-shared",
|
|
3
3
|
"description": "Shared components and utilities for Tap Payments micro frontends",
|
|
4
|
-
"version": "0.1.324-test.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.324-test.3",
|
|
5
|
+
"testVersion": 3,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|