@globalpayments/js 1.9.15 → 1.9.18
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/package.json +1 -1
- package/types/internal/gateways/gp-api/action-query-installment-plans.d.ts +3 -0
- package/types/internal/gateways/gp-api/index.d.ts +1 -0
- package/types/internal/gateways/index.d.ts +6 -0
- package/types/internal/lib/card.d.ts +17 -0
- package/types/internal/lib/installments/components/add-issuer-banner.d.ts +2 -0
- package/types/internal/lib/installments/components/modal/create-modal-component.d.ts +9 -0
- package/types/internal/lib/installments/components/modal/styles.d.ts +23 -0
- package/types/internal/lib/installments/contracts/constants.d.ts +3 -0
- package/types/internal/lib/installments/contracts/enums.d.ts +13 -0
- package/types/internal/lib/installments/contracts/installment-action.d.ts +20 -0
- package/types/internal/lib/installments/contracts/installment-payment-method.d.ts +21 -0
- package/types/internal/lib/installments/contracts/installment-plans-data.d.ts +50 -0
- package/types/internal/lib/installments/contracts/installment-term-fees.d.ts +16 -0
- package/types/internal/lib/installments/contracts/installment-term.d.ts +35 -0
- package/types/internal/lib/installments/helpers/currency.d.ts +2 -0
- package/types/internal/lib/installments/helpers/html-element.d.ts +88 -0
- package/types/internal/lib/installments/installments-handler.d.ts +48 -0
- package/types/internal/lib/installments/requests/query-installment-plans.d.ts +3 -0
- package/types/internal/lib/installments/templates/common.d.ts +6 -0
- package/types/internal/lib/installments/templates/create-step-0.d.ts +3 -0
- package/types/internal/lib/installments/templates/create-step-1.d.ts +3 -0
- package/types/internal/lib/installments/templates/modals.d.ts +6 -0
- package/types/internal/lib/styles/gp-default.d.ts +335 -6
- package/types/internal/lib/styles/installments/common.d.ts +335 -0
- package/types/internal/lib/styles/installments/default.d.ts +335 -0
- package/types/internal/lib/styles/installments/gp-default.d.ts +335 -0
- package/types/internal/lib/styles/installments/simple.d.ts +335 -0
- package/types/lib/version.d.ts +1 -1
- package/types/tools/configure.d.ts +6 -0
- package/types/ui/form/index.d.ts +373 -55
- package/types/ui/iframe-field/action-add-installments.d.ts +3 -0
- package/types/ui/iframe-field/action-card-request-installments.d.ts +6 -0
package/package.json
CHANGED
|
@@ -21,6 +21,7 @@ export declare const supports: {
|
|
|
21
21
|
export declare const urls: {
|
|
22
22
|
assetBaseUrl: (result: string) => string;
|
|
23
23
|
tokenization: (prod: boolean) => string;
|
|
24
|
+
queryInstallmentPlans: (prod: boolean) => string;
|
|
24
25
|
};
|
|
25
26
|
export declare const actions: IActions;
|
|
26
27
|
export declare const requiredSettings: string[];
|
|
@@ -42,6 +42,10 @@ export interface ISuccess {
|
|
|
42
42
|
orderId?: string;
|
|
43
43
|
reference?: string;
|
|
44
44
|
apmProvider?: string;
|
|
45
|
+
installment?: {
|
|
46
|
+
id: string;
|
|
47
|
+
reference: string;
|
|
48
|
+
};
|
|
45
49
|
};
|
|
46
50
|
methodName?: string;
|
|
47
51
|
payerEmail?: string;
|
|
@@ -65,10 +69,12 @@ export interface IActions {
|
|
|
65
69
|
setup?: () => any;
|
|
66
70
|
tokenize: (url: string, env: string, data: IDictionary) => Promise<any>;
|
|
67
71
|
validateData: (data: IDictionary) => IErrorReason[];
|
|
72
|
+
queryInstallmentPlans?: (url: string, env: string, data: IDictionary) => Promise<any>;
|
|
68
73
|
}
|
|
69
74
|
export interface IUrlGenerators {
|
|
70
75
|
assetBaseUrl?: (result: string) => string;
|
|
71
76
|
tokenization: (prod: boolean) => string;
|
|
77
|
+
queryInstallmentPlans?: (prod: boolean) => string;
|
|
72
78
|
}
|
|
73
79
|
export interface IGatewayModule {
|
|
74
80
|
[key: string]: any;
|
|
@@ -93,6 +93,23 @@ export default class Card {
|
|
|
93
93
|
* @param e
|
|
94
94
|
*/
|
|
95
95
|
static validateExpiration(e: Event): void;
|
|
96
|
+
/**
|
|
97
|
+
* validateInstallments
|
|
98
|
+
*
|
|
99
|
+
* Validates a target element"s value based on the
|
|
100
|
+
* availability of use installment plans.
|
|
101
|
+
*
|
|
102
|
+
* @param e
|
|
103
|
+
*/
|
|
104
|
+
static validateInstallments(e: Event, fieldType: string): void;
|
|
105
|
+
/**
|
|
106
|
+
* displayInstallmentOptions
|
|
107
|
+
*
|
|
108
|
+
* Post an event to start the installment data request
|
|
109
|
+
*
|
|
110
|
+
* @param e
|
|
111
|
+
*/
|
|
112
|
+
static displayInstallmentOptions(e: Event): void;
|
|
96
113
|
/**
|
|
97
114
|
* attachNumberEvents
|
|
98
115
|
*
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare const styles: (_assetBaseUrl: string) => {
|
|
2
|
+
".secure-payment-form .modal-overlay": {
|
|
3
|
+
background: string;
|
|
4
|
+
position: string;
|
|
5
|
+
top: string;
|
|
6
|
+
left: string;
|
|
7
|
+
margin: string;
|
|
8
|
+
width: string;
|
|
9
|
+
height: string;
|
|
10
|
+
display: string;
|
|
11
|
+
"justify-content": string;
|
|
12
|
+
"align-items": string;
|
|
13
|
+
"z-index": string;
|
|
14
|
+
};
|
|
15
|
+
".secure-payment-form .modal-wrapper": {
|
|
16
|
+
"font-family": string;
|
|
17
|
+
background: string;
|
|
18
|
+
"border-width": string;
|
|
19
|
+
"border-radius": string;
|
|
20
|
+
overflow: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export default styles;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare enum InstallmentEvents {
|
|
2
|
+
CardInstallmentsRequestStart = "card-installments-request-start",
|
|
3
|
+
CardInstallmentsRequestCompleted = "card-installments-request-completed",
|
|
4
|
+
CardInstallmentsHide = "card-installments-hide"
|
|
5
|
+
}
|
|
6
|
+
export declare enum InstallmentAvailableStatus {
|
|
7
|
+
Available = "AVAILABLE",
|
|
8
|
+
NotAvailable = "NOT_AVAILABLE"
|
|
9
|
+
}
|
|
10
|
+
export declare enum InstallmentTermModes {
|
|
11
|
+
APR = "APR",
|
|
12
|
+
FEE = "FEE"
|
|
13
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* InstallmentAction class model.
|
|
3
|
+
*/
|
|
4
|
+
export default class InstallmentAction {
|
|
5
|
+
id: string;
|
|
6
|
+
type: string;
|
|
7
|
+
timeCreated: string;
|
|
8
|
+
resultCode: string;
|
|
9
|
+
appId: string;
|
|
10
|
+
appName: string;
|
|
11
|
+
constructor(_id: string, _type: string, _timeCreated: string, _resultCode: string, _appId: string, _appName: string);
|
|
12
|
+
}
|
|
13
|
+
export declare function installmentActionMapper(origin: {
|
|
14
|
+
id: string;
|
|
15
|
+
type: string;
|
|
16
|
+
time_created: string;
|
|
17
|
+
result_code: string;
|
|
18
|
+
app_id: string;
|
|
19
|
+
app_name: string;
|
|
20
|
+
}): InstallmentAction;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* InstallmentPaymentMethod class model.
|
|
3
|
+
*/
|
|
4
|
+
export default class InstallmentPaymentMethod {
|
|
5
|
+
entryMode: string;
|
|
6
|
+
card: {
|
|
7
|
+
brand: string;
|
|
8
|
+
maskedNumberLast4: string;
|
|
9
|
+
};
|
|
10
|
+
constructor(_entryMode: string, _card: {
|
|
11
|
+
brand: string;
|
|
12
|
+
maskedNumberLast4: string;
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
export declare function installmentPaymentMethodMapper(origin: {
|
|
16
|
+
entry_mode: string;
|
|
17
|
+
card: {
|
|
18
|
+
brand: string;
|
|
19
|
+
masked_number_last4: string;
|
|
20
|
+
};
|
|
21
|
+
}): InstallmentPaymentMethod;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import InstallmentAction from "./installment-action";
|
|
2
|
+
import InstallmentPaymentMethod from "./installment-payment-method";
|
|
3
|
+
import InstallmentTerm from "./installment-term";
|
|
4
|
+
/**
|
|
5
|
+
* InstallmentPlansData class models the data returned from the server with the installment plans and terms.
|
|
6
|
+
*/
|
|
7
|
+
export default class InstallmentPlansData {
|
|
8
|
+
id: string;
|
|
9
|
+
timeCreated: string;
|
|
10
|
+
type: string;
|
|
11
|
+
status: string;
|
|
12
|
+
channel: string;
|
|
13
|
+
amount: string;
|
|
14
|
+
currency: string;
|
|
15
|
+
country: string;
|
|
16
|
+
merchantId: string;
|
|
17
|
+
merchantName: string;
|
|
18
|
+
accountId: string;
|
|
19
|
+
accountName: string;
|
|
20
|
+
reference: string;
|
|
21
|
+
termsAndConditionsUrl: string;
|
|
22
|
+
providerImageUrl: string;
|
|
23
|
+
terms: InstallmentTerm[];
|
|
24
|
+
paymentMethod: InstallmentPaymentMethod;
|
|
25
|
+
action: InstallmentAction;
|
|
26
|
+
constructor(_id: string, _timeCreated: string, _type: string, _status: string, _channel: string, _amount: string, _currency: string, _country: string, _merchantId: string, _merchantName: string, _accountId: string, _accountName: string, _reference: string, _termsAndConditionsUrl: string, _providerImageUrl: string, _terms: InstallmentTerm[], _paymentMethod: InstallmentPaymentMethod, _action: InstallmentAction);
|
|
27
|
+
}
|
|
28
|
+
export declare function installmentPlansDataMapper(origin: {
|
|
29
|
+
id: string;
|
|
30
|
+
time_created: string;
|
|
31
|
+
type: string;
|
|
32
|
+
status: string;
|
|
33
|
+
channel: string;
|
|
34
|
+
amount: string;
|
|
35
|
+
currency: string;
|
|
36
|
+
country: string;
|
|
37
|
+
merchant_id: string;
|
|
38
|
+
merchant_name: string;
|
|
39
|
+
account_id: string;
|
|
40
|
+
account_name: string;
|
|
41
|
+
reference: string;
|
|
42
|
+
terms_and_conditions_url: string;
|
|
43
|
+
provider_image_url: string;
|
|
44
|
+
terms: any[];
|
|
45
|
+
payment_method: any;
|
|
46
|
+
action: any;
|
|
47
|
+
}): InstallmentPlansData;
|
|
48
|
+
export declare function verifyInstallmentAvailability(installmentPlansData: {
|
|
49
|
+
status: string;
|
|
50
|
+
}): boolean;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* InstallmentTermFees class model.
|
|
3
|
+
*/
|
|
4
|
+
export default class InstallmentTermFees {
|
|
5
|
+
currency: string;
|
|
6
|
+
totalAmount: string;
|
|
7
|
+
fixedAmount: string;
|
|
8
|
+
monthlyAmount: string;
|
|
9
|
+
constructor(_currency: string, _totalAmount: string, _fixedAmount: string, _monthlyAmount: string);
|
|
10
|
+
}
|
|
11
|
+
export declare function installmentTermFeesMapper(origin: {
|
|
12
|
+
currency: string;
|
|
13
|
+
total_amount: string;
|
|
14
|
+
fixed_amount: string;
|
|
15
|
+
monthly_amount: string;
|
|
16
|
+
}): InstallmentTermFees;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import InstallmentTermFees from "./installment-term-fees";
|
|
2
|
+
/**
|
|
3
|
+
* InstallmentTerm class model.
|
|
4
|
+
*/
|
|
5
|
+
export default class InstallmentTerm {
|
|
6
|
+
reference: string;
|
|
7
|
+
timeUnitAmount: string;
|
|
8
|
+
currency: string;
|
|
9
|
+
mode: string;
|
|
10
|
+
totalTimeUnitCount: string;
|
|
11
|
+
interestRate: string;
|
|
12
|
+
totalAmount?: string;
|
|
13
|
+
description: string;
|
|
14
|
+
expirationDate: string;
|
|
15
|
+
expirationInterestRate: string;
|
|
16
|
+
timeUnit: string;
|
|
17
|
+
termsAndConditionsUrl: string;
|
|
18
|
+
fees?: InstallmentTermFees;
|
|
19
|
+
constructor(_reference: string, _timeUnitAmount: string, _currency: string, _mode: string, _totalTimeUnitCount: string, _interestRate: string, _totalAmount: string, _description: string, _expirationDate: string, _expirationInterestRate: string, _timeUnit: string, _termsAndConditionsUrl: string, _fees?: InstallmentTermFees);
|
|
20
|
+
}
|
|
21
|
+
export declare function installmentTermMapper(origin: {
|
|
22
|
+
reference: string;
|
|
23
|
+
time_unit_amount: string;
|
|
24
|
+
currency: string;
|
|
25
|
+
mode: string;
|
|
26
|
+
total_time_unit_count: string;
|
|
27
|
+
interest_rate: string;
|
|
28
|
+
total_amount: string;
|
|
29
|
+
description: string;
|
|
30
|
+
expiration_date: string;
|
|
31
|
+
expiration_interest_rate: string;
|
|
32
|
+
terms_and_conditions_url: string;
|
|
33
|
+
time_unit: string;
|
|
34
|
+
fees?: any;
|
|
35
|
+
}): InstallmentTerm;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export declare const createHtmlElement: (elementType: string, props?: {
|
|
2
|
+
id?: string | undefined;
|
|
3
|
+
className?: string | undefined;
|
|
4
|
+
attributes?: {
|
|
5
|
+
[key: string]: string;
|
|
6
|
+
}[] | undefined;
|
|
7
|
+
} | undefined) => HTMLElement;
|
|
8
|
+
export declare const createHtmlDivElement: (props?: {
|
|
9
|
+
id?: string | undefined;
|
|
10
|
+
className?: string | undefined;
|
|
11
|
+
attributes?: {
|
|
12
|
+
[key: string]: string;
|
|
13
|
+
}[] | undefined;
|
|
14
|
+
} | undefined) => HTMLDivElement;
|
|
15
|
+
export declare const createHtmlSpanElement: (props?: {
|
|
16
|
+
id?: string | undefined;
|
|
17
|
+
className?: string | undefined;
|
|
18
|
+
attributes?: {
|
|
19
|
+
[key: string]: string;
|
|
20
|
+
}[] | undefined;
|
|
21
|
+
textContent?: string | undefined;
|
|
22
|
+
} | undefined) => HTMLSpanElement;
|
|
23
|
+
export declare const createHtmlButtonElement: (props?: {
|
|
24
|
+
id?: string | undefined;
|
|
25
|
+
className?: string | undefined;
|
|
26
|
+
attributes?: {
|
|
27
|
+
[key: string]: string;
|
|
28
|
+
}[] | undefined;
|
|
29
|
+
textContent?: string | undefined;
|
|
30
|
+
} | undefined) => HTMLButtonElement;
|
|
31
|
+
export declare const createHtmlImageElement: (props?: {
|
|
32
|
+
id?: string | undefined;
|
|
33
|
+
className?: string | undefined;
|
|
34
|
+
attributes?: {
|
|
35
|
+
[key: string]: string;
|
|
36
|
+
}[] | undefined;
|
|
37
|
+
src: string;
|
|
38
|
+
alt: string;
|
|
39
|
+
} | undefined) => HTMLImageElement;
|
|
40
|
+
export declare const createHtmlUlElement: (props?: {
|
|
41
|
+
id?: string | undefined;
|
|
42
|
+
className?: string | undefined;
|
|
43
|
+
attributes?: {
|
|
44
|
+
[key: string]: string;
|
|
45
|
+
}[] | undefined;
|
|
46
|
+
} | undefined) => HTMLUListElement;
|
|
47
|
+
export declare const createHtmlLiElement: (props?: {
|
|
48
|
+
id?: string | undefined;
|
|
49
|
+
className?: string | undefined;
|
|
50
|
+
attributes?: {
|
|
51
|
+
[key: string]: string;
|
|
52
|
+
}[] | undefined;
|
|
53
|
+
} | undefined) => HTMLLIElement;
|
|
54
|
+
export declare enum HtmlAnchorTarget {
|
|
55
|
+
Blank = "_blank",
|
|
56
|
+
Self = "_self",
|
|
57
|
+
Parent = "_parent",
|
|
58
|
+
Top = "_top"
|
|
59
|
+
}
|
|
60
|
+
export declare const createHtmlAnchorElement: (props?: {
|
|
61
|
+
id?: string | undefined;
|
|
62
|
+
className?: string | undefined;
|
|
63
|
+
attributes?: {
|
|
64
|
+
[key: string]: string;
|
|
65
|
+
}[] | undefined;
|
|
66
|
+
textContent?: string | undefined;
|
|
67
|
+
target?: HtmlAnchorTarget | undefined;
|
|
68
|
+
href: string;
|
|
69
|
+
} | undefined) => HTMLAnchorElement;
|
|
70
|
+
export declare const createHtmlCheckboxElement: (props?: {
|
|
71
|
+
id?: string | undefined;
|
|
72
|
+
className?: string | undefined;
|
|
73
|
+
attributes?: {
|
|
74
|
+
[key: string]: string;
|
|
75
|
+
}[] | undefined;
|
|
76
|
+
name?: string | undefined;
|
|
77
|
+
textContent?: string | undefined;
|
|
78
|
+
checked: boolean;
|
|
79
|
+
} | undefined) => HTMLInputElement;
|
|
80
|
+
export declare const createHtmlLabelElement: (props?: {
|
|
81
|
+
id?: string | undefined;
|
|
82
|
+
className?: string | undefined;
|
|
83
|
+
attributes?: {
|
|
84
|
+
[key: string]: string;
|
|
85
|
+
}[] | undefined;
|
|
86
|
+
htmlFor: string;
|
|
87
|
+
textContent?: string | undefined;
|
|
88
|
+
} | undefined) => HTMLLabelElement;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { IframeField } from "../../../ui";
|
|
2
|
+
import InstallmentPlansData from "./contracts/installment-plans-data";
|
|
3
|
+
export declare class InstallmentsHandler {
|
|
4
|
+
private readonly iframeField;
|
|
5
|
+
private readonly installmentPlans;
|
|
6
|
+
private currentStepIndex;
|
|
7
|
+
private steps;
|
|
8
|
+
private context;
|
|
9
|
+
private selectedTermIndex;
|
|
10
|
+
private tokenizationCallback;
|
|
11
|
+
constructor(_iframeField: IframeField | undefined, _installmentPlans: InstallmentPlansData, _tokenizationCallback: (installment: InstallmentPaymentData) => void);
|
|
12
|
+
init(): void;
|
|
13
|
+
private moveNext;
|
|
14
|
+
private moveToInitialStep;
|
|
15
|
+
private updateContainerContent;
|
|
16
|
+
private createContainerElement;
|
|
17
|
+
private getInstallmentSteps;
|
|
18
|
+
private getInitialContext;
|
|
19
|
+
private explorePlansHanlder;
|
|
20
|
+
private selectTermHandler;
|
|
21
|
+
private payHandler;
|
|
22
|
+
private changePaymentMethodHandler;
|
|
23
|
+
private changeCreditCardFormFieldsVisibility;
|
|
24
|
+
}
|
|
25
|
+
export interface InstallmentsContext {
|
|
26
|
+
installmentPlans: InstallmentPlansData;
|
|
27
|
+
selectedTerm: number;
|
|
28
|
+
hasIssuerInfo?: boolean;
|
|
29
|
+
explorePlans: () => void;
|
|
30
|
+
selectTerm: (i: number) => void;
|
|
31
|
+
changePaymentMethod: () => void;
|
|
32
|
+
pay: (e: Event) => void;
|
|
33
|
+
updateContainerContent: () => void;
|
|
34
|
+
}
|
|
35
|
+
export interface InstallmentStepDefinition {
|
|
36
|
+
initialize?: (context: InstallmentsContext) => void;
|
|
37
|
+
contentHandler: (context: InstallmentsContext) => HTMLElement;
|
|
38
|
+
eventsListeners: (context: InstallmentsContext) => InstallmentEventListenerDefinition[];
|
|
39
|
+
}
|
|
40
|
+
export interface InstallmentEventListenerDefinition {
|
|
41
|
+
elementSelector: string;
|
|
42
|
+
eventName: string;
|
|
43
|
+
eventHandler: (e: Event) => void;
|
|
44
|
+
}
|
|
45
|
+
export interface InstallmentPaymentData {
|
|
46
|
+
id: string;
|
|
47
|
+
reference: string;
|
|
48
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const getProvidedByIssuerTemplate: (props: {
|
|
2
|
+
providerImageSrc: string;
|
|
3
|
+
providerImageAlt: string;
|
|
4
|
+
}) => HTMLElement;
|
|
5
|
+
export declare const getChangePaymentMethodTemplate: (buttonId: string) => HTMLElement;
|
|
6
|
+
export declare const getHaveVirginMoneyCreditCardBannerTemplate: () => HTMLElement;
|