@spot-flow/checkout-inline-js 0.1.16 → 0.1.22
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/README.md +37 -55
- package/dist/api.d.ts +8 -7
- package/dist/apis/payment.service.d.ts +47 -0
- package/dist/checkout-class.d.ts +6 -0
- package/dist/checkout-inline.es.js +30230 -1645
- package/dist/checkout-inline.js +521 -624
- package/dist/data/countryStateCode.json.d.ts +22019 -0
- package/dist/data.d.ts +17 -0
- package/dist/index.css +1 -1
- package/dist/modules/Card.d.ts +23 -4
- package/dist/modules/Transfer.d.ts +27 -6
- package/dist/modules/Ussd.d.ts +37 -7
- package/dist/types/types.d.ts +48 -6
- package/dist/types.d.ts +2 -0
- package/dist/utils/format-date.d.ts +9 -0
- package/dist/utils/keys.d.ts +1 -0
- package/dist/utils/mask-text.d.ts +2 -0
- package/dist/utils/number-format.d.ts +6 -0
- package/dist/utils/set-baseurl.d.ts +1 -0
- package/dist/utils/stringTransform.d.ts +8 -0
- package/dist/utils.d.ts +7 -0
- package/dist/views/card/avs-validation.d.ts +10 -2
- package/dist/views/card/card-detail-form.d.ts +15 -7
- package/dist/views/card/card-otp-validation-form.d.ts +14 -2
- package/dist/views/card/card-pin-form.d.ts +11 -4
- package/dist/views/shared/main-footer.d.ts +15 -0
- package/dist/views/shared/main-header.d.ts +17 -0
- package/dist/views/shared/main-page.d.ts +40 -7
- package/dist/views/shared/main-sidebar.d.ts +17 -0
- package/dist/views/shared/page-loader.d.ts +1 -0
- package/dist/views/shared/payment-warning.d.ts +13 -2
- package/dist/views/shared/shared-main-option.d.ts +23 -0
- package/dist/views/transfer/transfer-confirmation-one.d.ts +13 -0
- package/dist/views/transfer/transfer-confirmation-two.d.ts +13 -0
- package/dist/views/transfer/transfer-confirmtation-progress.d.ts +34 -0
- package/dist/views/transfer/transfer-details.d.ts +23 -0
- package/dist/views/transfer/transfer-expired.d.ts +11 -0
- package/dist/views/ussd/ussd-bank-detail-form.d.ts +14 -2
- package/dist/views/ussd/ussd-error-screen.d.ts +3 -0
- package/dist/views/ussd/ussd-view-code.d.ts +36 -1
- package/package.json +20 -4
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { GetMerchantPlanDetail } from '../../types/types';
|
|
2
|
+
|
|
3
|
+
type Props = {
|
|
4
|
+
container: HTMLDivElement;
|
|
5
|
+
email: string;
|
|
6
|
+
amount?: number;
|
|
7
|
+
};
|
|
8
|
+
export declare class MainHeader {
|
|
9
|
+
container: HTMLDivElement;
|
|
10
|
+
email: string;
|
|
11
|
+
amount: number;
|
|
12
|
+
constructor(props: Props);
|
|
13
|
+
attachListener(): void;
|
|
14
|
+
renderComponent(values: GetMerchantPlanDetail, amount: number, currency: string): void;
|
|
15
|
+
render(): string;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -2,16 +2,39 @@ import { default as Card } from '../../modules/Card';
|
|
|
2
2
|
import { default as Transfer } from '../../modules/Transfer';
|
|
3
3
|
import { default as Ussd } from '../../modules/Ussd';
|
|
4
4
|
import { GetMerchantPlanDetail } from '../../types/types';
|
|
5
|
+
import { MainHeader } from './main-header';
|
|
6
|
+
import { MainSidebar } from './main-sidebar';
|
|
7
|
+
import { SharedMainOption } from './shared-main-option';
|
|
8
|
+
import { MainFooter } from './main-footer';
|
|
5
9
|
|
|
10
|
+
type Props = {
|
|
11
|
+
container: HTMLDivElement;
|
|
12
|
+
modalContainer: HTMLDivElement;
|
|
13
|
+
merchantKey: string;
|
|
14
|
+
encryption: string;
|
|
15
|
+
email: string;
|
|
16
|
+
amount?: number;
|
|
17
|
+
planId?: string;
|
|
18
|
+
rdtCode?: string;
|
|
19
|
+
url?: string;
|
|
20
|
+
reference?: string;
|
|
21
|
+
onSuccess?: (_val?: any) => void;
|
|
22
|
+
onClose?: () => void;
|
|
23
|
+
};
|
|
6
24
|
export declare class MainPageScreen {
|
|
7
25
|
modalContainer: HTMLDivElement;
|
|
8
26
|
currentPaymentMethod: number;
|
|
9
27
|
mainLayout: HTMLDivElement;
|
|
28
|
+
mainHeader: MainHeader;
|
|
29
|
+
mainSidebar: MainSidebar;
|
|
30
|
+
mainFooter: MainFooter;
|
|
31
|
+
mainOption: SharedMainOption;
|
|
10
32
|
currentStep: number;
|
|
11
33
|
private merchantPlanDetail;
|
|
12
34
|
private onSuccess;
|
|
13
35
|
private onClose?;
|
|
14
36
|
mainScreen: MainPageScreen;
|
|
37
|
+
currency?: string;
|
|
15
38
|
card: Card;
|
|
16
39
|
transfer: Transfer;
|
|
17
40
|
ussd: Ussd;
|
|
@@ -20,22 +43,32 @@ export declare class MainPageScreen {
|
|
|
20
43
|
planId: string;
|
|
21
44
|
email: string;
|
|
22
45
|
amount: number;
|
|
46
|
+
rdtCode?: string;
|
|
47
|
+
url?: string;
|
|
48
|
+
reference?: string;
|
|
23
49
|
isMobile: boolean;
|
|
24
|
-
constructor(container
|
|
25
|
-
mountScreen(values: GetMerchantPlanDetail): void;
|
|
50
|
+
constructor({ container, email, encryption, merchantKey, modalContainer, amount, onClose, onSuccess, planId, rdtCode, url, reference, }: Props);
|
|
51
|
+
mountScreen(values: GetMerchantPlanDetail, currency: string): void;
|
|
26
52
|
attachInputListeners(): void;
|
|
27
53
|
closeBTN(): void;
|
|
28
|
-
displayTabLayout(): void;
|
|
29
54
|
private updatePaymentMethodView;
|
|
30
55
|
private renderPaymentMethodContent;
|
|
31
56
|
private setCurrentPaymentMethod;
|
|
32
57
|
switchTab(tabIndex: number): void;
|
|
33
|
-
private setupComponent;
|
|
34
|
-
_setup(): void;
|
|
35
|
-
private mobileContainerContent;
|
|
36
|
-
private viewMobileOptions;
|
|
37
58
|
private cleanup;
|
|
38
59
|
closeModal(func?: Function): void;
|
|
39
60
|
setupParent(func?: Function): void;
|
|
40
61
|
render(): string;
|
|
41
62
|
}
|
|
63
|
+
export {};
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
66
|
+
*
|
|
67
|
+
.content {
|
|
68
|
+
@apply hidden;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.content.active {
|
|
72
|
+
@apply block;
|
|
73
|
+
}
|
|
74
|
+
*/
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { GetMerchantPlanDetail } from '../../types/types';
|
|
2
|
+
|
|
3
|
+
type Props = {
|
|
4
|
+
container: HTMLDivElement;
|
|
5
|
+
merchantDetail: GetMerchantPlanDetail;
|
|
6
|
+
onAction: (_val: number) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare class MainSidebar {
|
|
9
|
+
container: HTMLDivElement;
|
|
10
|
+
merchantDetail: GetMerchantPlanDetail;
|
|
11
|
+
onAction: (_val: number) => void;
|
|
12
|
+
constructor(props: Props);
|
|
13
|
+
attachListeners(): void;
|
|
14
|
+
renderComponent(): void;
|
|
15
|
+
render(): string;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -1,9 +1,20 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
container: HTMLDivElement;
|
|
3
|
+
msg: string;
|
|
4
|
+
switchTab: (_val: number) => void;
|
|
5
|
+
setCurrentTab: (_val: number) => void;
|
|
6
|
+
onUssd?: () => void;
|
|
7
|
+
};
|
|
1
8
|
export declare class PaymentWarning {
|
|
2
9
|
container: HTMLDivElement;
|
|
3
10
|
switchTab: (_val: number) => void;
|
|
4
11
|
setCurrentTab: (_val: number) => void;
|
|
5
|
-
|
|
12
|
+
msg: string;
|
|
13
|
+
onUssd: () => void;
|
|
14
|
+
constructor({ container, msg, setCurrentTab, switchTab, onUssd }: Props);
|
|
6
15
|
attachListener(): void;
|
|
7
|
-
setPaymentError(text: string): void;
|
|
16
|
+
setPaymentError(text: string, isUssd?: boolean): void;
|
|
17
|
+
renderComponent(): void;
|
|
8
18
|
render(): string;
|
|
9
19
|
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { GetMerchantPlanDetail } from '../../types/types';
|
|
2
|
+
|
|
3
|
+
type Props = {
|
|
4
|
+
container: HTMLDivElement;
|
|
5
|
+
merchantPlanDetail: GetMerchantPlanDetail;
|
|
6
|
+
amount: number;
|
|
7
|
+
onAction: (_val: number) => void;
|
|
8
|
+
onCleanup: () => void;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
};
|
|
11
|
+
export declare class SharedMainOption {
|
|
12
|
+
container: HTMLDivElement;
|
|
13
|
+
onAction: (_val: number) => void;
|
|
14
|
+
private onCleanup;
|
|
15
|
+
private onClose;
|
|
16
|
+
private merchantPlanDetail;
|
|
17
|
+
private amount;
|
|
18
|
+
constructor(props: Props);
|
|
19
|
+
attachListener(): void;
|
|
20
|
+
renderComponent(): void;
|
|
21
|
+
render(): string;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
container: HTMLDivElement;
|
|
3
|
+
onAction: (_val: number) => void;
|
|
4
|
+
};
|
|
5
|
+
export declare class TransferConfirmatioOne {
|
|
6
|
+
container: HTMLDivElement;
|
|
7
|
+
onAction: (_val: number) => void;
|
|
8
|
+
constructor(props: Props);
|
|
9
|
+
attachListeners(): void;
|
|
10
|
+
renderComponent(): void;
|
|
11
|
+
render(): string;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
container: HTMLDivElement;
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
};
|
|
5
|
+
export declare class TransferConfirmationTwo {
|
|
6
|
+
container: HTMLDivElement;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
constructor(props: Props);
|
|
9
|
+
attachListeners(): void;
|
|
10
|
+
renderComponent(): void;
|
|
11
|
+
render(): string;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { PaymentResponseData } from '../../types/types';
|
|
2
|
+
|
|
3
|
+
type Props = {
|
|
4
|
+
container: HTMLDivElement;
|
|
5
|
+
onAction: (_val: number) => void;
|
|
6
|
+
ref: string;
|
|
7
|
+
token: string;
|
|
8
|
+
rdtCode?: string;
|
|
9
|
+
url?: string;
|
|
10
|
+
onSuccess: (_val: any) => void;
|
|
11
|
+
};
|
|
12
|
+
export declare class TransferConfirmationProgress {
|
|
13
|
+
container: HTMLDivElement;
|
|
14
|
+
onAction: (_val: number) => void;
|
|
15
|
+
private onSuccess;
|
|
16
|
+
private ref;
|
|
17
|
+
private token;
|
|
18
|
+
initialTime: number;
|
|
19
|
+
abortController: AbortController;
|
|
20
|
+
private timeLeft;
|
|
21
|
+
private timer;
|
|
22
|
+
timerId: null | number;
|
|
23
|
+
private rdtCode?;
|
|
24
|
+
private url?;
|
|
25
|
+
constructor(props: Props);
|
|
26
|
+
attachListeners(): void;
|
|
27
|
+
verifyTransfer(token: string, initialInterval: number, onSuccess: (data: PaymentResponseData) => void, onError: (error: Error) => void): Promise<void>;
|
|
28
|
+
stopProgressBar(): void;
|
|
29
|
+
private startTimer;
|
|
30
|
+
private stopTimer;
|
|
31
|
+
renderComponent(): void;
|
|
32
|
+
render(): string;
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { PaymentResponseData } from '../../types/types';
|
|
2
|
+
|
|
3
|
+
type Props = {
|
|
4
|
+
container: HTMLDivElement;
|
|
5
|
+
onAction: (_val: number) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare class TransferDetail {
|
|
8
|
+
container: HTMLDivElement;
|
|
9
|
+
onAction: (_val: number) => void;
|
|
10
|
+
private initialTime;
|
|
11
|
+
private timeLeft;
|
|
12
|
+
private timerId;
|
|
13
|
+
payment: PaymentResponseData;
|
|
14
|
+
constructor(props: Props);
|
|
15
|
+
attachListener(): void;
|
|
16
|
+
private startTimer;
|
|
17
|
+
private updateProgressTimerContent;
|
|
18
|
+
private stopTimer;
|
|
19
|
+
copyToClipboard(text: string, element: Element): void;
|
|
20
|
+
renderComponent(values: PaymentResponseData): void;
|
|
21
|
+
render(): string;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -1,9 +1,21 @@
|
|
|
1
|
+
import { BankService } from '../../apis/payment.service';
|
|
1
2
|
import { BankOption } from '../../types/types';
|
|
2
3
|
|
|
4
|
+
type Props = {
|
|
5
|
+
container: HTMLElement;
|
|
6
|
+
merchantKey: string;
|
|
7
|
+
rdtCode?: string;
|
|
8
|
+
url?: string;
|
|
9
|
+
onAction?: (_val: BankOption) => void;
|
|
10
|
+
};
|
|
3
11
|
export declare class UssdBankDetailForm {
|
|
4
12
|
container: HTMLElement | Element;
|
|
5
|
-
|
|
6
|
-
|
|
13
|
+
bank_service: BankService;
|
|
14
|
+
private bank_list;
|
|
15
|
+
private onAction;
|
|
16
|
+
constructor(props: Props);
|
|
17
|
+
attachListerner(): void;
|
|
7
18
|
renderContent(): void;
|
|
8
19
|
render(): string;
|
|
9
20
|
}
|
|
21
|
+
export {};
|
|
@@ -1,5 +1,40 @@
|
|
|
1
|
+
import { BankOption } from '../../types/types';
|
|
2
|
+
|
|
3
|
+
type Props = {
|
|
4
|
+
container: HTMLDivElement;
|
|
5
|
+
onAction: (_val: any, ref: string) => void;
|
|
6
|
+
selected: BankOption;
|
|
7
|
+
secret: string;
|
|
8
|
+
currency: string;
|
|
9
|
+
amount: number;
|
|
10
|
+
email: string;
|
|
11
|
+
fullname?: string;
|
|
12
|
+
reference?: string;
|
|
13
|
+
rdtCode?: string;
|
|
14
|
+
url?: string;
|
|
15
|
+
onError?: (_val: string) => void;
|
|
16
|
+
};
|
|
1
17
|
export declare class UssdViewCode {
|
|
2
18
|
container: HTMLElement;
|
|
3
|
-
|
|
19
|
+
selected: BankOption;
|
|
20
|
+
private secret;
|
|
21
|
+
onAction: (_val: BankOption, ref: string) => void;
|
|
22
|
+
private paymentService;
|
|
23
|
+
private currency;
|
|
24
|
+
private amount;
|
|
25
|
+
private ussd_detail?;
|
|
26
|
+
private fullname?;
|
|
27
|
+
private reference?;
|
|
28
|
+
private email?;
|
|
29
|
+
private abortController;
|
|
30
|
+
private activeRef;
|
|
31
|
+
private pageLoader;
|
|
32
|
+
onError: (_val: string) => void;
|
|
33
|
+
constructor(props: Props);
|
|
34
|
+
private makePayment;
|
|
35
|
+
attachListener(): void;
|
|
36
|
+
verifyPayment(): void;
|
|
37
|
+
renderComponent(): void;
|
|
4
38
|
render(): string;
|
|
5
39
|
}
|
|
40
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spot-flow/checkout-inline-js",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.22",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/checkout-inline.js",
|
|
6
6
|
"module": "dist/checkout-inline.es.js",
|
|
@@ -8,7 +8,12 @@
|
|
|
8
8
|
"scripts": {
|
|
9
9
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
10
10
|
"dev": "vite",
|
|
11
|
-
"build": "vite build"
|
|
11
|
+
"build": "vite build",
|
|
12
|
+
"prepare": "husky",
|
|
13
|
+
"commitlint": "commitlint --edit",
|
|
14
|
+
"lint-yarn": "eslint '**/*.{js,ts,tsx}'",
|
|
15
|
+
"format": "prettier --write",
|
|
16
|
+
"lint:fix": "yarn lint --fix"
|
|
12
17
|
},
|
|
13
18
|
"type": "module",
|
|
14
19
|
"types": "dist/index.d.ts",
|
|
@@ -16,16 +21,23 @@
|
|
|
16
21
|
"dist"
|
|
17
22
|
],
|
|
18
23
|
"devDependencies": {
|
|
24
|
+
"@commitlint/cli": "^19.4.0",
|
|
25
|
+
"@commitlint/config-conventional": "^19.2.2",
|
|
19
26
|
"@types/node": "^20.14.9",
|
|
20
27
|
"autoprefixer": "^10.4.19",
|
|
28
|
+
"eslint-config-prettier": "^9.1.0",
|
|
29
|
+
"husky": "^9.1.5",
|
|
30
|
+
"lint-staged": "^15.2.9",
|
|
21
31
|
"postcss": "^8.4.39",
|
|
32
|
+
"prettier": "^3.3.3",
|
|
22
33
|
"tailwindcss": "^3.4.4",
|
|
34
|
+
"tailwindcss-scoped-preflight": "^3.4.3",
|
|
23
35
|
"typescript": "^5.5.3",
|
|
24
36
|
"vite": "^5.3.2",
|
|
25
37
|
"vite-plugin-css-injected-by-js": "^3.5.1",
|
|
26
38
|
"vite-plugin-dts": "^3.9.1",
|
|
27
39
|
"vite-plugin-lib-inject-css": "^2.1.1",
|
|
28
|
-
"
|
|
40
|
+
"vite-tsconfig-paths": "^5.0.1"
|
|
29
41
|
},
|
|
30
42
|
"author": "Oluwatomisin Jimoh <jayoluwatosin@gmail.com>",
|
|
31
43
|
"license": "ISC",
|
|
@@ -42,5 +54,9 @@
|
|
|
42
54
|
"spotflow",
|
|
43
55
|
"checkout",
|
|
44
56
|
"inline"
|
|
45
|
-
]
|
|
57
|
+
],
|
|
58
|
+
"dependencies": {
|
|
59
|
+
"@types/mixpanel-browser": "^2.50.2",
|
|
60
|
+
"mixpanel-browser": "^2.55.1"
|
|
61
|
+
}
|
|
46
62
|
}
|