@spot-flow/checkout-inline-js 0.1.33-dev.4 → 0.1.33-dev.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/api.d.ts +2 -1
- package/dist/checkout-inline.es.js +1795 -1729
- package/dist/checkout-inline.js +468 -460
- package/dist/modules/Card.d.ts +5 -3
- package/dist/modules/EFT.d.ts +5 -4
- package/dist/modules/MobileMoney.d.ts +6 -4
- package/dist/modules/Transfer.d.ts +5 -3
- package/dist/modules/Ussd.d.ts +6 -4
- package/dist/types/types.d.ts +12 -0
- package/dist/views/eft/authenticate.d.ts +0 -15
- package/dist/views/mobile-money/mobile-money-form.d.ts +3 -0
- package/dist/views/shared/main-header.d.ts +3 -3
- package/dist/views/shared/main-page.d.ts +3 -2
- package/dist/views/shared/payment-success.d.ts +0 -1
- package/dist/views/ussd/ussd-bank-detail-form.d.ts +2 -0
- package/dist/views/ussd/ussd-view-code.d.ts +1 -2
- package/package.json +1 -1
package/dist/modules/Card.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PaymentAPIResponse } from '../api';
|
|
2
|
-
import {
|
|
2
|
+
import { GetMerchantDetailsTax } from '../types/types';
|
|
3
3
|
|
|
4
4
|
type Props = {
|
|
5
5
|
container: HTMLElement;
|
|
@@ -7,6 +7,7 @@ type Props = {
|
|
|
7
7
|
encryption: string;
|
|
8
8
|
email: string;
|
|
9
9
|
amount: number;
|
|
10
|
+
totalAmount: number;
|
|
10
11
|
switchTab: (val: number) => void;
|
|
11
12
|
planId: string;
|
|
12
13
|
onSuccess?: (_val?: any) => void;
|
|
@@ -40,6 +41,7 @@ declare class Card {
|
|
|
40
41
|
private email;
|
|
41
42
|
private token;
|
|
42
43
|
private amount;
|
|
44
|
+
private totalAmount;
|
|
43
45
|
private encryption;
|
|
44
46
|
private currency;
|
|
45
47
|
private _currentStep;
|
|
@@ -60,7 +62,7 @@ declare class Card {
|
|
|
60
62
|
private retryingPayment;
|
|
61
63
|
isMaxRetriesReached: boolean;
|
|
62
64
|
isMobile: boolean;
|
|
63
|
-
constructor({ amount, container, email, encryption, planId, token, currency, rdtCode, url, reference, onSuccess, callBackUrl, metadata, localCurrency, hidePaymentMethods, showPaymentMethods, onClose, restartTransactionProcess, retryingPayment, }: Props);
|
|
65
|
+
constructor({ amount, totalAmount, container, email, encryption, planId, token, currency, rdtCode, url, reference, onSuccess, callBackUrl, metadata, localCurrency, hidePaymentMethods, showPaymentMethods, onClose, restartTransactionProcess, retryingPayment, }: Props);
|
|
64
66
|
get currentStep(): number;
|
|
65
67
|
set currentStep(step: number);
|
|
66
68
|
submitCardDetails(e: Event, _values: {
|
|
@@ -79,7 +81,7 @@ declare class Card {
|
|
|
79
81
|
verifyPayment(onSuccess: (data: PaymentAPIResponse) => void, onError: (data: PaymentAPIResponse) => void): Promise<void>;
|
|
80
82
|
verifyPaymentProcess(): Promise<void>;
|
|
81
83
|
goBackToMerchant(): void;
|
|
82
|
-
renderCardContent(values?:
|
|
84
|
+
renderCardContent(values?: GetMerchantDetailsTax): void;
|
|
83
85
|
private redirectTo;
|
|
84
86
|
private displayButtonText;
|
|
85
87
|
}
|
package/dist/modules/EFT.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GetMerchantDetailsTax } from '../types/types';
|
|
2
2
|
|
|
3
3
|
type Props = {
|
|
4
4
|
container: HTMLElement;
|
|
5
5
|
token: string;
|
|
6
6
|
email: string;
|
|
7
7
|
amount: number;
|
|
8
|
+
totalAmount: number;
|
|
8
9
|
switchTab: (val: number) => void;
|
|
9
10
|
onSuccess?: (_val?: any) => void;
|
|
10
11
|
currency: string;
|
|
@@ -31,9 +32,9 @@ declare class Eft {
|
|
|
31
32
|
private email;
|
|
32
33
|
private token;
|
|
33
34
|
private amount;
|
|
35
|
+
private totalAmount;
|
|
34
36
|
private currency;
|
|
35
37
|
private _currentStep;
|
|
36
|
-
private activeRef;
|
|
37
38
|
private rdtCode?;
|
|
38
39
|
private url?;
|
|
39
40
|
private reference;
|
|
@@ -49,7 +50,7 @@ declare class Eft {
|
|
|
49
50
|
isMobile: boolean;
|
|
50
51
|
private paymentResponse;
|
|
51
52
|
private paymentResponseHeaders;
|
|
52
|
-
constructor({ amount, container, email, token, currency, rdtCode, url, reference, callBackUrl, metadata, localCurrency, hidePaymentMethods, showPaymentMethods, restartTransactionProcess, retryingPayment, }: Props);
|
|
53
|
+
constructor({ amount, totalAmount, container, email, token, currency, rdtCode, url, reference, callBackUrl, metadata, localCurrency, hidePaymentMethods, showPaymentMethods, restartTransactionProcess, retryingPayment, }: Props);
|
|
53
54
|
get currentStep(): number;
|
|
54
55
|
set currentStep(step: number);
|
|
55
56
|
showLoader(): void;
|
|
@@ -58,6 +59,6 @@ declare class Eft {
|
|
|
58
59
|
createEftPayment(): Promise<void>;
|
|
59
60
|
private redirectToOzow;
|
|
60
61
|
verifyPaymentProcess(): Promise<void>;
|
|
61
|
-
renderEftContent(values?:
|
|
62
|
+
renderEftContent(values?: GetMerchantDetailsTax): void;
|
|
62
63
|
}
|
|
63
64
|
export default Eft;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GetMerchantDetailsTax } from '../types/types';
|
|
2
2
|
import { PageLoader } from '../views/shared/page-loader';
|
|
3
3
|
|
|
4
4
|
type Props = {
|
|
@@ -7,6 +7,7 @@ type Props = {
|
|
|
7
7
|
email: string;
|
|
8
8
|
onSuccess?: (_val?: any) => void;
|
|
9
9
|
amount: number;
|
|
10
|
+
totalAmount: number;
|
|
10
11
|
rdtCode?: string;
|
|
11
12
|
metadata: Record<string, unknown>;
|
|
12
13
|
url?: string;
|
|
@@ -42,6 +43,7 @@ declare class MobileMoney {
|
|
|
42
43
|
private activeRef;
|
|
43
44
|
private warningScreen;
|
|
44
45
|
private amount;
|
|
46
|
+
private totalAmount;
|
|
45
47
|
private url?;
|
|
46
48
|
private reference;
|
|
47
49
|
private metadata;
|
|
@@ -50,7 +52,7 @@ declare class MobileMoney {
|
|
|
50
52
|
private token;
|
|
51
53
|
private callBackUrl;
|
|
52
54
|
private rdtCode?;
|
|
53
|
-
merchantDetails:
|
|
55
|
+
merchantDetails: GetMerchantDetailsTax;
|
|
54
56
|
private onClose;
|
|
55
57
|
private hidePaymentMethods;
|
|
56
58
|
private showPaymentMethods;
|
|
@@ -61,7 +63,7 @@ declare class MobileMoney {
|
|
|
61
63
|
private retryingPayment;
|
|
62
64
|
isMaxRetriesReached: boolean;
|
|
63
65
|
isMobile: boolean;
|
|
64
|
-
constructor({ container, merchantKey, localCurrency, metadata, callBackUrl, rdtCode, reference, onSuccess, url, email, amount, token, currency, disablePaymentMethods, hidePaymentMethods, showPaymentMethods, onClose, restartTransactionProcess, retryingPayment, }: Props);
|
|
66
|
+
constructor({ container, merchantKey, localCurrency, metadata, callBackUrl, rdtCode, reference, onSuccess, url, email, amount, totalAmount, token, currency, disablePaymentMethods, hidePaymentMethods, showPaymentMethods, onClose, restartTransactionProcess, retryingPayment, }: Props);
|
|
65
67
|
get currentStep(): number;
|
|
66
68
|
set currentStep(step: number);
|
|
67
69
|
attachInputListeners(): void;
|
|
@@ -73,6 +75,6 @@ declare class MobileMoney {
|
|
|
73
75
|
submitOtp(e: Event, values: string): void;
|
|
74
76
|
verifyPaymentProcess(): Promise<void>;
|
|
75
77
|
goBackToMerchant(): void;
|
|
76
|
-
renderMobileMoneyContent(values?:
|
|
78
|
+
renderMobileMoneyContent(values?: GetMerchantDetailsTax): void;
|
|
77
79
|
}
|
|
78
80
|
export default MobileMoney;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GetMerchantDetailsTax } from '../types/types';
|
|
2
2
|
import { PageLoader } from '../views/shared/page-loader';
|
|
3
3
|
|
|
4
4
|
type Props = {
|
|
@@ -7,6 +7,7 @@ type Props = {
|
|
|
7
7
|
token: string;
|
|
8
8
|
email: string;
|
|
9
9
|
amount: number;
|
|
10
|
+
totalAmount: number;
|
|
10
11
|
currency: string;
|
|
11
12
|
rdtCode?: string;
|
|
12
13
|
url?: string;
|
|
@@ -35,6 +36,7 @@ declare class Transfer {
|
|
|
35
36
|
private token;
|
|
36
37
|
private currency;
|
|
37
38
|
private amount;
|
|
39
|
+
private totalAmount;
|
|
38
40
|
private rdtCode?;
|
|
39
41
|
private url?;
|
|
40
42
|
private reference;
|
|
@@ -54,7 +56,7 @@ declare class Transfer {
|
|
|
54
56
|
private retryingPayment;
|
|
55
57
|
isMaxRetriesReached: boolean;
|
|
56
58
|
isMobile: boolean;
|
|
57
|
-
constructor({ amount, closeModal, container, email, token, currency, rdtCode, url, reference, callBackUrl, metadata, localCurrency, disablePaymentMethods, restartTransactionProcess, hidePaymentMethods, retryingPayment, }: Props);
|
|
59
|
+
constructor({ amount, totalAmount, closeModal, container, email, token, currency, rdtCode, url, reference, callBackUrl, metadata, localCurrency, disablePaymentMethods, restartTransactionProcess, hidePaymentMethods, retryingPayment, }: Props);
|
|
58
60
|
get currentStep(): number;
|
|
59
61
|
set currentStep(step: number);
|
|
60
62
|
attachInputListeners(): void;
|
|
@@ -62,7 +64,7 @@ declare class Transfer {
|
|
|
62
64
|
verifyTransfer(): Promise<void>;
|
|
63
65
|
createTransfer(): Promise<void>;
|
|
64
66
|
goBackToMerchant(): void;
|
|
65
|
-
renderTransferContent(values?:
|
|
67
|
+
renderTransferContent(values?: GetMerchantDetailsTax): void;
|
|
66
68
|
private stopTimer;
|
|
67
69
|
stopProgressBar(): void;
|
|
68
70
|
copyToClipboard(text: string, element: Element): void;
|
package/dist/modules/Ussd.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GetMerchantDetailsTax } from '../types/types';
|
|
2
2
|
|
|
3
3
|
type Props = {
|
|
4
4
|
container: HTMLElement;
|
|
5
5
|
onSuccess?: (_val?: any) => void;
|
|
6
6
|
secret: string;
|
|
7
7
|
amount: number;
|
|
8
|
+
totalAmount: number;
|
|
8
9
|
currency: string;
|
|
9
10
|
reference: string;
|
|
10
11
|
email?: string;
|
|
@@ -24,6 +25,7 @@ declare class Ussd {
|
|
|
24
25
|
private selectedCode?;
|
|
25
26
|
private secret;
|
|
26
27
|
private amount;
|
|
28
|
+
private totalAmount;
|
|
27
29
|
private currency;
|
|
28
30
|
private email?;
|
|
29
31
|
private pageLoader;
|
|
@@ -45,17 +47,17 @@ declare class Ussd {
|
|
|
45
47
|
private callBackUrl;
|
|
46
48
|
private metadata;
|
|
47
49
|
private localCurrency;
|
|
48
|
-
merchantDetails:
|
|
50
|
+
merchantDetails: GetMerchantDetailsTax;
|
|
49
51
|
private hidePaymentMethods;
|
|
50
52
|
private showPaymentMethods;
|
|
51
53
|
disablePaymentMethods: (name: string) => void;
|
|
52
|
-
constructor({ container, onSuccess, secret, amount, currency, email, reference, rdtCode, url, callBackUrl, metadata, localCurrency, hidePaymentMethods, showPaymentMethods, disablePaymentMethods, }: Props);
|
|
54
|
+
constructor({ container, onSuccess, secret, amount, totalAmount, currency, email, reference, rdtCode, url, callBackUrl, metadata, localCurrency, hidePaymentMethods, showPaymentMethods, disablePaymentMethods, }: Props);
|
|
53
55
|
get currentStep(): number;
|
|
54
56
|
set currentStep(step: number);
|
|
55
57
|
private onCodeSelect;
|
|
56
58
|
private validate;
|
|
57
59
|
private redirectTo;
|
|
58
|
-
renderUssdContent(values?:
|
|
60
|
+
renderUssdContent(values?: GetMerchantDetailsTax): void;
|
|
59
61
|
handleSelectChange(_e: Event): void;
|
|
60
62
|
}
|
|
61
63
|
export default Ussd;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export type PaymentRequestPayload = {
|
|
|
16
16
|
callBackUrl?: string;
|
|
17
17
|
metadata?: Record<string, unknown>;
|
|
18
18
|
isCheckout: boolean;
|
|
19
|
+
taxQuoteId?: string;
|
|
19
20
|
};
|
|
20
21
|
export type CardDetails = {
|
|
21
22
|
pan: string;
|
|
@@ -98,6 +99,8 @@ export type PaymentResponseData = {
|
|
|
98
99
|
code: string;
|
|
99
100
|
paymentCode: string;
|
|
100
101
|
};
|
|
102
|
+
totalLocalAmount?: number;
|
|
103
|
+
totalTaxAmount?: number;
|
|
101
104
|
};
|
|
102
105
|
export interface Authorization {
|
|
103
106
|
mode: string;
|
|
@@ -156,6 +159,7 @@ export type GetMerchantPlanDetail = {
|
|
|
156
159
|
channel: PaymentChannel;
|
|
157
160
|
amount: number;
|
|
158
161
|
}>;
|
|
162
|
+
taxEnabled: boolean;
|
|
159
163
|
};
|
|
160
164
|
export type GetBanksRequestParams = {
|
|
161
165
|
ussd: boolean;
|
|
@@ -194,3 +198,11 @@ export type PusherResponse = {
|
|
|
194
198
|
status: string;
|
|
195
199
|
};
|
|
196
200
|
export type PaymentChannel = "card" | "bank_transfer" | "ussd" | "mobile_money" | "eft";
|
|
201
|
+
export type TaxQuoteResponse = {
|
|
202
|
+
id: string;
|
|
203
|
+
totalAmount: number;
|
|
204
|
+
};
|
|
205
|
+
export type GetMerchantDetailsTax = GetMerchantPlanDetail & {
|
|
206
|
+
totalAmount?: number;
|
|
207
|
+
taxQuoteId?: string;
|
|
208
|
+
};
|
|
@@ -5,14 +5,6 @@ import { PaymentWarning } from '../shared/payment-warning';
|
|
|
5
5
|
type Props = {
|
|
6
6
|
container: HTMLElement;
|
|
7
7
|
onAction: () => Promise<void>;
|
|
8
|
-
ref: string;
|
|
9
|
-
merchantKey: string;
|
|
10
|
-
rdtCode?: string;
|
|
11
|
-
url?: string;
|
|
12
|
-
currency: string;
|
|
13
|
-
amount: number;
|
|
14
|
-
localCurrency?: string;
|
|
15
|
-
rate?: number;
|
|
16
8
|
restartTransactionProcess: () => void;
|
|
17
9
|
};
|
|
18
10
|
export declare class EftAuthenticate {
|
|
@@ -20,13 +12,6 @@ export declare class EftAuthenticate {
|
|
|
20
12
|
payment: PaymentResponseData;
|
|
21
13
|
warningError: PaymentWarning;
|
|
22
14
|
pageLoader: PageLoader;
|
|
23
|
-
localCurrency?: string;
|
|
24
|
-
rate?: number;
|
|
25
|
-
amount: number;
|
|
26
|
-
merchantKey: string;
|
|
27
|
-
rdtCode?: string;
|
|
28
|
-
url?: string;
|
|
29
|
-
currency: string;
|
|
30
15
|
onAction: () => Promise<void>;
|
|
31
16
|
private restartTransactionProcess;
|
|
32
17
|
constructor(props: Props);
|
|
@@ -16,6 +16,7 @@ type Props = {
|
|
|
16
16
|
url?: string;
|
|
17
17
|
currency: string;
|
|
18
18
|
amount: number;
|
|
19
|
+
totalAmount: number;
|
|
19
20
|
localCurrency?: string;
|
|
20
21
|
rate?: number;
|
|
21
22
|
restartTransactionProcess: () => void;
|
|
@@ -28,6 +29,7 @@ export declare class MobileMoneyForm {
|
|
|
28
29
|
localCurrency?: string;
|
|
29
30
|
rate?: number;
|
|
30
31
|
amount: number;
|
|
32
|
+
totalAmount: number;
|
|
31
33
|
private onAction;
|
|
32
34
|
private switchScreen;
|
|
33
35
|
private merchantKey;
|
|
@@ -35,6 +37,7 @@ export declare class MobileMoneyForm {
|
|
|
35
37
|
private url?;
|
|
36
38
|
private currency;
|
|
37
39
|
private restartTransactionProcess;
|
|
40
|
+
private countryCode;
|
|
38
41
|
constructor(props: Props);
|
|
39
42
|
private validateForm;
|
|
40
43
|
attachListener(): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GetMerchantDetailsTax } from '../../types/types';
|
|
2
2
|
|
|
3
3
|
type Props = {
|
|
4
4
|
container: HTMLDivElement;
|
|
@@ -7,7 +7,7 @@ type Props = {
|
|
|
7
7
|
metadata?: Record<string, unknown>;
|
|
8
8
|
currency: string;
|
|
9
9
|
localCurrency?: string;
|
|
10
|
-
merchantDetail:
|
|
10
|
+
merchantDetail: GetMerchantDetailsTax;
|
|
11
11
|
onAction: (_val: string) => void;
|
|
12
12
|
isMobile: boolean;
|
|
13
13
|
onClose: (notClosePayment: boolean) => void;
|
|
@@ -20,7 +20,7 @@ export declare class MainHeader {
|
|
|
20
20
|
metadata?: Record<string, unknown>;
|
|
21
21
|
currency: string;
|
|
22
22
|
localCurrency?: string;
|
|
23
|
-
merchantDetail:
|
|
23
|
+
merchantDetail: GetMerchantDetailsTax;
|
|
24
24
|
onAction: (_val: string) => void;
|
|
25
25
|
isMobile: boolean;
|
|
26
26
|
onClose: (notClosePayment: boolean) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
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
|
-
import {
|
|
4
|
+
import { GetMerchantDetailsTax } from '../../types/types';
|
|
5
5
|
import { MainHeader } from './main-header';
|
|
6
6
|
import { MainFooter } from './main-footer';
|
|
7
7
|
import { default as MobileMoney } from '../../modules/MobileMoney';
|
|
@@ -58,8 +58,9 @@ export declare class MainPageScreen {
|
|
|
58
58
|
localCurrency: string;
|
|
59
59
|
closePayment: () => void;
|
|
60
60
|
retryingPayment: boolean;
|
|
61
|
+
totalAmount: number;
|
|
61
62
|
constructor({ container, email, phoneNumber, code, encryption, merchantKey, modalContainer, amount, planId, rdtCode, url, reference, callBackUrl, metadata, localCurrency, closePayment, }: Props);
|
|
62
|
-
mountScreen(values:
|
|
63
|
+
mountScreen(values: GetMerchantDetailsTax, currency: string, validChannels: Array<string>, disabledChannels: Array<string>): void;
|
|
63
64
|
private setupPaymentMethodButtons;
|
|
64
65
|
attachListeners(): void;
|
|
65
66
|
closeBTN(notClosePayment: boolean): void;
|
|
@@ -11,6 +11,7 @@ type Props = {
|
|
|
11
11
|
localCurrency?: string;
|
|
12
12
|
rate?: number;
|
|
13
13
|
amount: number;
|
|
14
|
+
totalAmount: number;
|
|
14
15
|
};
|
|
15
16
|
export declare class UssdBankDetailForm {
|
|
16
17
|
container: HTMLElement | Element;
|
|
@@ -22,6 +23,7 @@ export declare class UssdBankDetailForm {
|
|
|
22
23
|
localCurrency?: string;
|
|
23
24
|
rate?: number;
|
|
24
25
|
amount: number;
|
|
26
|
+
totalAmount: number;
|
|
25
27
|
constructor(props: Props);
|
|
26
28
|
attachListerner(): void;
|
|
27
29
|
private validateForm;
|
|
@@ -7,6 +7,7 @@ type Props = {
|
|
|
7
7
|
secret: string;
|
|
8
8
|
currency: string;
|
|
9
9
|
amount: number;
|
|
10
|
+
totalAmount: number;
|
|
10
11
|
email: string;
|
|
11
12
|
reference: string;
|
|
12
13
|
rdtCode?: string;
|
|
@@ -27,7 +28,6 @@ export declare class UssdViewCode {
|
|
|
27
28
|
private ussd_detail?;
|
|
28
29
|
private reference;
|
|
29
30
|
private email?;
|
|
30
|
-
private abortController;
|
|
31
31
|
private activeRef;
|
|
32
32
|
private pageLoader;
|
|
33
33
|
private callBackUrl;
|
|
@@ -37,7 +37,6 @@ export declare class UssdViewCode {
|
|
|
37
37
|
constructor(props: Props);
|
|
38
38
|
private makePayment;
|
|
39
39
|
attachListener(): void;
|
|
40
|
-
verifyPayment(): void;
|
|
41
40
|
renderComponent(): void;
|
|
42
41
|
render(): string;
|
|
43
42
|
}
|