@globalpayments/js 1.9.20 → 1.9.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@globalpayments/js",
3
- "version": "1.9.20",
3
+ "version": "1.9.22",
4
4
  "author": "Heartland Developer Portal <developers@heartland.us>",
5
5
  "license": "GPL-2.0",
6
6
  "repository": {
@@ -0,0 +1 @@
1
+ export declare const HOSTED_FIELD_NAME_KEYS: string[];
@@ -0,0 +1,7 @@
1
+ export declare enum CardFormFieldNames {
2
+ CardAccountNumber = "account-number",
3
+ CardNumber = "card-number",
4
+ CardExpiration = "card-expiration",
5
+ CardCvv = "card-cvv",
6
+ CardHolderName = "card-holder-name"
7
+ }
@@ -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,4 @@
1
+ export declare const validate: (fieldType: string, value: string, extraData?: any) => {
2
+ isValid: boolean;
3
+ message?: string;
4
+ };
@@ -0,0 +1,2 @@
1
+ export declare const showHostedFieldValidation: (fieldId: string | null, validationMessage: string, target?: string | undefined) => void;
2
+ export declare const hideHostedFieldValidation: (fieldId: string | null, target?: string | undefined) => void;
@@ -0,0 +1,24 @@
1
+ export declare const ValidationMessages: {
2
+ CardNumber: {
3
+ Required: string;
4
+ CharactersLessThan12: string;
5
+ NumberIsNotValid: string;
6
+ };
7
+ CardExpiration: {
8
+ Required: string;
9
+ NotCompleted: string;
10
+ YearNotValid: string;
11
+ MonthNotValid: string;
12
+ HasExpired: string;
13
+ };
14
+ CardCvv: {
15
+ CodeIsNotValid: string;
16
+ CodeIsLessThan3Digits: string;
17
+ CodeMustBe3Digits: string;
18
+ AmexCodeMustBe4Digits: string;
19
+ };
20
+ CardHolderName: {
21
+ Required: string;
22
+ CharactersLessThan2: string;
23
+ };
24
+ };
@@ -1,3 +1,4 @@
1
+ import { HtmlAnchorTarget as _HtmlAnchorTarget } from "../../../../common/html-element";
1
2
  export declare const createHtmlElement: (elementType: string, props?: {
2
3
  id?: string | undefined;
3
4
  className?: string | undefined;
@@ -51,12 +52,7 @@ export declare const createHtmlLiElement: (props?: {
51
52
  [key: string]: string;
52
53
  }[] | undefined;
53
54
  } | undefined) => HTMLLIElement;
54
- export declare enum HtmlAnchorTarget {
55
- Blank = "_blank",
56
- Self = "_self",
57
- Parent = "_parent",
58
- Top = "_top"
59
- }
55
+ export declare const HtmlAnchorTarget: typeof _HtmlAnchorTarget;
60
56
  export declare const createHtmlAnchorElement: (props?: {
61
57
  id?: string | undefined;
62
58
  className?: string | undefined;
@@ -64,7 +60,7 @@ export declare const createHtmlAnchorElement: (props?: {
64
60
  [key: string]: string;
65
61
  }[] | undefined;
66
62
  textContent?: string | undefined;
67
- target?: HtmlAnchorTarget | undefined;
63
+ target?: _HtmlAnchorTarget | undefined;
68
64
  href: string;
69
65
  } | undefined) => HTMLAnchorElement;
70
66
  export declare const createHtmlCheckboxElement: (props?: {
@@ -0,0 +1,16 @@
1
+ export declare const fieldStyles: (assetBaseUrl: string) => {
2
+ "#secure-payment-field[type=text].field-validation-wrapper": {
3
+ "font-family": string;
4
+ };
5
+ "#secure-payment-field[type=tel].invalid": {
6
+ border: string;
7
+ };
8
+ "#secure-payment-field[type=text].invalid": {
9
+ border: string;
10
+ };
11
+ "img.card-number-icon.invalid": {
12
+ "margin-top": string;
13
+ };
14
+ };
15
+ declare const styles: (assetBaseUrl: string) => {};
16
+ export default styles;
@@ -74,7 +74,6 @@ export declare const fieldStyles: (assetBaseUrl: string) => {
74
74
  "background-size": string;
75
75
  width: string;
76
76
  height: string;
77
- position: string;
78
77
  right: string;
79
78
  top: string;
80
79
  "margin-top": string;
@@ -77,7 +77,6 @@ export declare const fieldStyles: (assetBaseUrl: string) => {
77
77
  };
78
78
  "img.card-number-icon": {
79
79
  background: string;
80
- position: string;
81
80
  right: string;
82
81
  top: string;
83
82
  width: string;
@@ -56,7 +56,6 @@ export declare const fieldStyles: (assetBaseUrl: string) => {
56
56
  "background-size": string;
57
57
  width: string;
58
58
  height: string;
59
- position: string;
60
59
  right: string;
61
60
  top: string;
62
61
  "margin-top": string;
@@ -1,2 +1,2 @@
1
- declare const _default: "1.9.20";
1
+ declare const _default: "1.9.22";
2
2
  export default _default;
@@ -38,6 +38,7 @@ export interface IConfiguration extends IDictionary {
38
38
  merchantIdentifier?: string;
39
39
  merchantName?: string;
40
40
  merchantSessionUrl?: string;
41
+ validateMerchantHeaders?: object;
41
42
  };
42
43
  clickToPay?: {
43
44
  allowedCardNetworks?: string[];
@@ -80,7 +80,6 @@ export declare const fieldStyles: () => {
80
80
  "background-size": string;
81
81
  width: string;
82
82
  height: string;
83
- position: string;
84
83
  right: string;
85
84
  top: string;
86
85
  "margin-top": string;
@@ -129,6 +128,11 @@ export declare const fieldStyles: () => {
129
128
  width: string;
130
129
  };
131
130
  "img.card-number-icon.valid.card-type-jcb": {
131
+ /**
132
+ * Appends additional CSS rules to the group of hosted fields
133
+ *
134
+ * @param json New CSS rules
135
+ */
132
136
  background: string;
133
137
  "background-size": string;
134
138
  "background-position-y": string;
@@ -229,13 +233,9 @@ export declare const fieldStyles: () => {
229
233
  };
230
234
  "img.card-number-icon": {
231
235
  background: string;
232
- position: string;
233
236
  right: string;
234
237
  top: string;
235
238
  width: string;
236
- /**
237
- * Represents logic surrounding a group of hosted fields.
238
- */
239
239
  height: string;
240
240
  "margin-top": string;
241
241
  "background-size": string;
@@ -320,7 +320,6 @@ export declare const fieldStyles: () => {
320
320
  "background-size": string;
321
321
  width: string;
322
322
  height: string;
323
- position: string;
324
323
  right: string;
325
324
  top: string;
326
325
  "margin-top": string;
@@ -336,12 +335,6 @@ export declare const fieldStyles: () => {
336
335
  "background-size": string;
337
336
  "background-position-y": string;
338
337
  };
339
- /**
340
- * Instantiates a new UIForm object for a group of hosted fields
341
- *
342
- * @param fields Hosted field configuration
343
- * @param styles Custom CSS configuration
344
- */
345
338
  "img.card-number-icon.invalid.card-type-discover": {
346
339
  background: string;
347
340
  "background-size": string;
@@ -486,6 +479,9 @@ export declare const parentStyles: () => {
486
479
  "background-color": string;
487
480
  color: string;
488
481
  "text-align": string;
482
+ /**
483
+ * Represents logic surrounding a group of hosted fields.
484
+ */
489
485
  "border-radius": string;
490
486
  border: string;
491
487
  padding: string;
@@ -493,7 +489,12 @@ export declare const parentStyles: () => {
493
489
  "z-index": string;
494
490
  "margin-left": string;
495
491
  "margin-top": string;
496
- opacity: string;
492
+ opacity: string; /**
493
+ * Instantiates a new UIForm object for a group of hosted fields
494
+ *
495
+ * @param fields Hosted field configuration
496
+ * @param styles Custom CSS configuration
497
+ */
497
498
  transition: string;
498
499
  "font-family": string;
499
500
  "font-size": string;
@@ -501,16 +502,7 @@ export declare const parentStyles: () => {
501
502
  "box-shadow": string;
502
503
  };
503
504
  ".secure-payment-form .ctp-info-tooltip-content .ctp-icon": {
504
- "margin-left": string; /**
505
- * Sets an event listener for an event type
506
- *
507
- * @param fieldTypeOrEventName The field type on which the listener should
508
- * be applied, or the type of event that should trigger the listener
509
- * @param eventNameOrListener The type of event that should trigger the
510
- * listener, or the listener function
511
- * @param listener The listener function when both field type and event type
512
- * are provided
513
- */
505
+ "margin-left": string;
514
506
  };
515
507
  ".secure-payment-form .ctp-info-tooltip .ctp-heading": {
516
508
  "max-width": string;
@@ -726,6 +718,9 @@ export declare const parentStyles: () => {
726
718
  "margin-bottom": string;
727
719
  };
728
720
  ".secure-payment-form div[class$='-shield']": {
721
+ /**
722
+ * Deletes all hosted fields within the form
723
+ */
729
724
  flex: string;
730
725
  "margin-right": string;
731
726
  float: string;
@@ -905,6 +900,9 @@ export declare const parentStyles: () => {
905
900
  "background-color": string;
906
901
  color: string;
907
902
  "text-align": string;
903
+ /**
904
+ * Represents logic surrounding a group of hosted fields.
905
+ */
908
906
  "border-radius": string;
909
907
  border: string;
910
908
  padding: string;
@@ -912,7 +910,12 @@ export declare const parentStyles: () => {
912
910
  "z-index": string;
913
911
  "margin-left": string;
914
912
  "margin-top": string;
915
- opacity: string;
913
+ opacity: string; /**
914
+ * Instantiates a new UIForm object for a group of hosted fields
915
+ *
916
+ * @param fields Hosted field configuration
917
+ * @param styles Custom CSS configuration
918
+ */
916
919
  transition: string;
917
920
  "font-family": string;
918
921
  "font-size": string;
@@ -920,16 +923,7 @@ export declare const parentStyles: () => {
920
923
  "box-shadow": string;
921
924
  };
922
925
  ".secure-payment-form .ctp-info-tooltip-content .ctp-icon": {
923
- "margin-left": string; /**
924
- * Sets an event listener for an event type
925
- *
926
- * @param fieldTypeOrEventName The field type on which the listener should
927
- * be applied, or the type of event that should trigger the listener
928
- * @param eventNameOrListener The type of event that should trigger the
929
- * listener, or the listener function
930
- * @param listener The listener function when both field type and event type
931
- * are provided
932
- */
926
+ "margin-left": string;
933
927
  };
934
928
  ".secure-payment-form .ctp-info-tooltip .ctp-heading": {
935
929
  "max-width": string;
@@ -1204,6 +1198,12 @@ export declare const parentStyles: () => {
1204
1198
  "border-bottom": string;
1205
1199
  padding: string;
1206
1200
  };
1201
+ /**
1202
+ * Instantiates a new UIForm object for a group of hosted fields
1203
+ *
1204
+ * @param fields Hosted field configuration
1205
+ * @param styles Custom CSS configuration
1206
+ */
1207
1207
  ".secure-payment-form .installment-plan-monthly-amount": {
1208
1208
  color: string;
1209
1209
  "font-style": string;
@@ -1711,6 +1711,9 @@ export declare const parentStyles: () => {
1711
1711
  "background-color": string;
1712
1712
  color: string;
1713
1713
  "text-align": string;
1714
+ /**
1715
+ * Represents logic surrounding a group of hosted fields.
1716
+ */
1714
1717
  "border-radius": string;
1715
1718
  border: string;
1716
1719
  padding: string;
@@ -1718,7 +1721,12 @@ export declare const parentStyles: () => {
1718
1721
  "z-index": string;
1719
1722
  "margin-left": string;
1720
1723
  "margin-top": string;
1721
- opacity: string;
1724
+ opacity: string; /**
1725
+ * Instantiates a new UIForm object for a group of hosted fields
1726
+ *
1727
+ * @param fields Hosted field configuration
1728
+ * @param styles Custom CSS configuration
1729
+ */
1722
1730
  transition: string;
1723
1731
  "font-family": string;
1724
1732
  "font-size": string;
@@ -1726,16 +1734,7 @@ export declare const parentStyles: () => {
1726
1734
  "box-shadow": string;
1727
1735
  };
1728
1736
  ".secure-payment-form .ctp-info-tooltip-content .ctp-icon": {
1729
- "margin-left": string; /**
1730
- * Sets an event listener for an event type
1731
- *
1732
- * @param fieldTypeOrEventName The field type on which the listener should
1733
- * be applied, or the type of event that should trigger the listener
1734
- * @param eventNameOrListener The type of event that should trigger the
1735
- * listener, or the listener function
1736
- * @param listener The listener function when both field type and event type
1737
- * are provided
1738
- */
1737
+ "margin-left": string;
1739
1738
  };
1740
1739
  ".secure-payment-form .ctp-info-tooltip .ctp-heading": {
1741
1740
  "max-width": string;
@@ -1967,9 +1966,7 @@ export declare const parentStyles: () => {
1967
1966
  ".secure-payment-form div[class$='-shield'] .ssl-logo_ico": {
1968
1967
  width: string;
1969
1968
  height: string;
1970
- "margin-top": string; /**
1971
- * Deletes all hosted fields within the form
1972
- */
1969
+ "margin-top": string;
1973
1970
  "vertical-align": string;
1974
1971
  };
1975
1972
  ".secure-payment-form div[class$='-shield'] .ssl-msg": {
@@ -2139,4 +2136,5 @@ export default class UIForm {
2139
2136
  private requestDataFromAll;
2140
2137
  setSubtotalAmount(amount: string): void;
2141
2138
  private requestInstallmentData;
2139
+ private submitForm;
2142
2140
  }
@@ -0,0 +1,6 @@
1
+ declare const _default: (fieldType: string) => void;
2
+ /**
3
+ * Hide the validation message for a hosted field
4
+ *
5
+ */
6
+ export default _default;
@@ -0,0 +1,7 @@
1
+ declare const _default: (validationMessage: string, fieldType: string) => void;
2
+ /**
3
+ * Show the validation message for a hosted field
4
+ *
5
+ * @param validationMessage The desired validation message
6
+ */
7
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import { IDictionary } from "../../internal/lib/util";
2
+ declare const _default: (id: string, data: IDictionary) => void;
3
+ export default _default;
@@ -0,0 +1,5 @@
1
+ declare const _default: (id: string, type: string, target: string) => void;
2
+ /**
3
+ * Validate the value for a hosted field
4
+ */
5
+ export default _default;