@tap-payments/os-micro-frontend-shared 0.1.335 → 0.1.336
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/utils/segment.d.ts +13 -20
- package/build/utils/segment.js +13 -17
- package/package.json +1 -1
package/build/utils/segment.d.ts
CHANGED
|
@@ -1,66 +1,59 @@
|
|
|
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
|
|
3
|
+
export declare const getBusinessSegmentConfig: ({ merchantsIds, options }: {
|
|
4
|
+
merchantsIds: string[];
|
|
5
|
+
options?: Record<string, unknown> | undefined;
|
|
6
|
+
}) => {
|
|
4
7
|
business?: undefined;
|
|
5
8
|
} | {
|
|
6
9
|
business: {
|
|
7
10
|
merchant: string[];
|
|
8
11
|
};
|
|
9
12
|
};
|
|
10
|
-
export declare const getNonBusinessSegmentConfig: ({ segmentCode, segmentId, segmentTypeCode, }: {
|
|
13
|
+
export declare const getNonBusinessSegmentConfig: ({ segmentCode, segmentId, segmentTypeCode, merchantsIds, options, }: {
|
|
11
14
|
segmentCode: string;
|
|
12
15
|
segmentTypeCode: string;
|
|
13
16
|
segmentId: string;
|
|
17
|
+
merchantsIds?: string[] | undefined;
|
|
18
|
+
options?: Record<string, unknown> | undefined;
|
|
14
19
|
}) => {
|
|
20
|
+
business?: undefined;
|
|
21
|
+
} | {
|
|
22
|
+
business: {
|
|
23
|
+
merchant: string[];
|
|
24
|
+
};
|
|
25
|
+
} | {
|
|
15
26
|
payment_provider: {
|
|
16
27
|
technology: {
|
|
17
28
|
orchestrator: string[];
|
|
18
|
-
gateway?: undefined;
|
|
19
29
|
};
|
|
20
30
|
institution?: undefined;
|
|
21
31
|
};
|
|
22
|
-
platform?: undefined;
|
|
23
|
-
development_agency?: undefined;
|
|
24
32
|
} | {
|
|
25
33
|
payment_provider: {
|
|
26
34
|
technology: {
|
|
27
35
|
gateway: string[];
|
|
28
|
-
orchestrator?: undefined;
|
|
29
36
|
};
|
|
30
37
|
institution?: undefined;
|
|
31
38
|
};
|
|
32
|
-
platform?: undefined;
|
|
33
|
-
development_agency?: undefined;
|
|
34
39
|
} | {
|
|
35
40
|
payment_provider: {
|
|
36
41
|
institution: {
|
|
37
42
|
facilitator: string[];
|
|
38
|
-
acquirer?: undefined;
|
|
39
43
|
};
|
|
40
44
|
technology?: undefined;
|
|
41
45
|
};
|
|
42
|
-
platform?: undefined;
|
|
43
|
-
development_agency?: undefined;
|
|
44
46
|
} | {
|
|
45
47
|
payment_provider: {
|
|
46
48
|
institution: {
|
|
47
49
|
acquirer: string[];
|
|
48
|
-
facilitator?: undefined;
|
|
49
50
|
};
|
|
50
51
|
technology?: undefined;
|
|
51
52
|
};
|
|
52
|
-
platform?: undefined;
|
|
53
|
-
development_agency?: undefined;
|
|
54
53
|
} | {
|
|
55
54
|
platform: string[];
|
|
56
55
|
payment_provider?: undefined;
|
|
57
|
-
development_agency?: undefined;
|
|
58
56
|
} | {
|
|
59
57
|
development_agency: string[];
|
|
60
58
|
payment_provider?: undefined;
|
|
61
|
-
platform?: undefined;
|
|
62
|
-
} | {
|
|
63
|
-
payment_provider?: undefined;
|
|
64
|
-
platform?: undefined;
|
|
65
|
-
development_agency?: undefined;
|
|
66
59
|
};
|
package/build/utils/segment.js
CHANGED
|
@@ -11,54 +11,50 @@ export const getSegmentData = (segments, activeSegmentId, activeSegments) => {
|
|
|
11
11
|
return Object.assign(Object.assign({}, newSegment), { defaultCountry,
|
|
12
12
|
defaultEntity });
|
|
13
13
|
};
|
|
14
|
-
export const getBusinessSegmentConfig = (merchantsIds) => {
|
|
14
|
+
export const getBusinessSegmentConfig = ({ merchantsIds, options }) => {
|
|
15
15
|
if (!merchantsIds || !(merchantsIds === null || merchantsIds === void 0 ? void 0 : merchantsIds.length))
|
|
16
16
|
return {};
|
|
17
|
-
return { business: { merchant: merchantsIds } };
|
|
17
|
+
return { business: Object.assign({ merchant: merchantsIds }, options) };
|
|
18
18
|
};
|
|
19
|
-
export const getNonBusinessSegmentConfig = ({ segmentCode, segmentId, segmentTypeCode, }) => {
|
|
19
|
+
export const getNonBusinessSegmentConfig = ({ segmentCode, segmentId, segmentTypeCode, merchantsIds = [], options = {}, }) => {
|
|
20
20
|
const code = SEGMENT_CODE.PSP === segmentTypeCode ? segmentCode : segmentTypeCode;
|
|
21
|
+
const specialBusinessSegmentsIDs = ['payment_facilitator_14po8231419aIsi1fN7F385'];
|
|
22
|
+
if (specialBusinessSegmentsIDs.includes(segmentId)) {
|
|
23
|
+
return getBusinessSegmentConfig({ merchantsIds, options });
|
|
24
|
+
}
|
|
21
25
|
if (code === SEGMENT_CODE.PAYMENT_TECHNOLOGY) {
|
|
22
26
|
return {
|
|
23
27
|
payment_provider: {
|
|
24
|
-
technology: {
|
|
25
|
-
orchestrator: [segmentId],
|
|
26
|
-
},
|
|
28
|
+
technology: Object.assign({ orchestrator: [segmentId] }, options),
|
|
27
29
|
},
|
|
28
30
|
};
|
|
29
31
|
}
|
|
30
32
|
if (code === SEGMENT_CODE.PAYMENT_GATEWAY || code === SEGMENT_CODE.PAYMENT_GATEWAY_PROVIDER) {
|
|
31
33
|
return {
|
|
32
34
|
payment_provider: {
|
|
33
|
-
technology: {
|
|
34
|
-
gateway: [segmentId],
|
|
35
|
-
},
|
|
35
|
+
technology: Object.assign({ gateway: [segmentId] }, options),
|
|
36
36
|
},
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
if (code === SEGMENT_CODE.PAYMENT_FACILITATOR) {
|
|
40
40
|
return {
|
|
41
41
|
payment_provider: {
|
|
42
|
-
institution: {
|
|
43
|
-
facilitator: [segmentId],
|
|
44
|
-
},
|
|
42
|
+
institution: Object.assign({ facilitator: [segmentId] }, options),
|
|
45
43
|
},
|
|
46
44
|
};
|
|
47
45
|
}
|
|
48
46
|
if (code === SEGMENT_CODE.PAYMENT_ACQUIRER) {
|
|
49
47
|
return {
|
|
50
48
|
payment_provider: {
|
|
51
|
-
institution: {
|
|
52
|
-
acquirer: [segmentId],
|
|
53
|
-
},
|
|
49
|
+
institution: Object.assign({ acquirer: [segmentId] }, options),
|
|
54
50
|
},
|
|
55
51
|
};
|
|
56
52
|
}
|
|
57
53
|
if (code === SEGMENT_CODE.PLATFORM) {
|
|
58
|
-
return { platform: [segmentId] };
|
|
54
|
+
return Object.assign({ platform: [segmentId] }, options);
|
|
59
55
|
}
|
|
60
56
|
if (code === SEGMENT_CODE.DEVELOPMENT) {
|
|
61
|
-
return { development_agency: [segmentId] };
|
|
57
|
+
return Object.assign({ development_agency: [segmentId] }, options);
|
|
62
58
|
}
|
|
63
59
|
return {};
|
|
64
60
|
};
|
package/package.json
CHANGED