@globalpayments/js 1.10.2 → 2.0.1

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.10.2",
3
+ "version": "2.0.1",
4
4
  "author": "Heartland Developer Portal <developers@heartland.us>",
5
5
  "license": "GPL-2.0",
6
6
  "repository": {
@@ -18,7 +18,7 @@
18
18
  "cypress:open": "cypress open",
19
19
  "format": "prettier --write config/**/* src/**/* !src/assets/**/* !test/run.sh !test/run.ps1 test/fixtures/**/*.html",
20
20
 
21
- "postbuild": "cross-os postbuild-cross",
21
+ "postbuild": "xcopy src\\assets dist\\ /e/y/h && node bin/replace-gp-ref.js",
22
22
 
23
23
  "prebuild": "yarn test:lint && node bin/update-version.js",
24
24
  "prepublish": "yarn build",
package/types/index.d.ts CHANGED
@@ -9,7 +9,7 @@ import Events from "./internal/lib/events";
9
9
  import * as paymentRequest from "./payment-request";
10
10
  import * as configure from "./tools/configure";
11
11
  import * as ui from "./ui";
12
- import * as enums from "./internal/lib/eums";
12
+ import * as enums from "./internal/lib/enums";
13
13
  declare const _default: {
14
14
  configure: (options: configure.IConfiguration) => void;
15
15
  creditCard: typeof creditCard;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Validate a string to accept only english characters
3
+ *
4
+ * @param value
5
+ * @returns escaped text
6
+ */
7
+ export default function containsOnlyEnglishCharacters(value: string): boolean;
@@ -3,6 +3,7 @@ export declare const ValidationMessages: {
3
3
  Required: any;
4
4
  CharactersLessThan12: any;
5
5
  NumberIsNotValid: any;
6
+ NotAllowedCardType: any;
6
7
  };
7
8
  CardExpiration: {
8
9
  NotCompleted: any;
@@ -18,5 +19,6 @@ export declare const ValidationMessages: {
18
19
  };
19
20
  CardHolderName: {
20
21
  NotValidCardHolderName: any;
22
+ CharactersMoreThan100: any;
21
23
  };
22
24
  };
@@ -1,2 +1,3 @@
1
- export declare function setCurrentLanguage(lang?: string): string;
1
+ import { Language } from "./enums";
2
+ export declare function setCurrentLanguage(lang?: Language): string;
2
3
  export declare function getCurrentLanguage(): string;
@@ -9,3 +9,11 @@ export declare enum CardNetwork {
9
9
  Amex = "AMEX",
10
10
  Discover = "DISCOVER"
11
11
  }
12
+ export declare enum CharacterValidation {
13
+ englishOnly = "englishOnly",
14
+ none = "none"
15
+ }
16
+ export declare enum Language {
17
+ en = "en",
18
+ zh = "zh"
19
+ }
@@ -15,6 +15,7 @@ declare const en: {
15
15
  Required: string;
16
16
  CharactersLessThan12: string;
17
17
  NumberIsNotValid: string;
18
+ NotAllowedCardType: string;
18
19
  };
19
20
  CardExpiration: {
20
21
  NotCompleted: string;
@@ -30,6 +31,7 @@ declare const en: {
30
31
  };
31
32
  CardHolderName: {
32
33
  NotValidCardHolderName: string;
34
+ CharactersMoreThan100: string;
33
35
  };
34
36
  };
35
37
  footer: {
@@ -14,6 +14,7 @@ declare const zh: {
14
14
  Required: string;
15
15
  CharactersLessThan12: string;
16
16
  NumberIsNotValid: string;
17
+ NotAllowedCardType: string;
17
18
  };
18
19
  CardExpiration: {
19
20
  NotCompleted: string;
@@ -29,6 +30,7 @@ declare const zh: {
29
30
  };
30
31
  CardHolderName: {
31
32
  NotValidCardHolderName: string;
33
+ CharactersMoreThan100: string;
32
34
  };
33
35
  };
34
36
  footer: {
@@ -1,2 +1,2 @@
1
- declare const _default: "1.10.2";
1
+ declare const _default: "2.0.1";
2
2
  export default _default;
@@ -21,6 +21,7 @@ export interface IConfiguration extends IDictionary {
21
21
  customerReference?: string;
22
22
  validateOnly?: boolean;
23
23
  env?: string;
24
+ allowedCardTypes?: string[];
24
25
  apms?: {
25
26
  allowedCardNetworks?: string[];
26
27
  currencyCode?: string;
@@ -78,7 +79,10 @@ export interface IConfiguration extends IDictionary {
78
79
  mcc: string;
79
80
  currency: string;
80
81
  };
81
- fieldValidation?: boolean;
82
+ fieldValidation?: {
83
+ enabled?: boolean;
84
+ characterValidation?: string;
85
+ };
82
86
  }
83
87
  declare const _default: (options: IConfiguration) => void;
84
88
  /**
@@ -143,7 +143,11 @@ export declare const fieldStyles: () => {
143
143
  "background-position-y": string;
144
144
  };
145
145
  "img.card-number-icon.valid.card-type-discover": {
146
- background: string;
146
+ background: string; /**
147
+ * Appends additional CSS rules to the group of hosted fields
148
+ *
149
+ * @param json New CSS rules
150
+ */
147
151
  "background-size": string;
148
152
  "background-position-y": string;
149
153
  width: string;
@@ -382,7 +386,9 @@ export declare const fieldStyles: () => {
382
386
  "background-size": string;
383
387
  };
384
388
  "img.card-number-icon[src$='/gp-cc-generic.svg']": {
385
- background: string;
389
+ background: string; /**
390
+ * Represents logic surrounding a group of hosted fields.
391
+ */
386
392
  "background-size": string;
387
393
  "background-position-y": string;
388
394
  };
@@ -535,9 +541,7 @@ export declare const parentStyles: () => {
535
541
  "background-color": string;
536
542
  color: string;
537
543
  "text-align": string;
538
- "border-radius": string; /**
539
- * Represents logic surrounding a group of hosted fields.
540
- */
544
+ "border-radius": string;
541
545
  border: string;
542
546
  padding: string;
543
547
  position: string;
@@ -970,9 +974,7 @@ export declare const parentStyles: () => {
970
974
  "background-color": string;
971
975
  color: string;
972
976
  "text-align": string;
973
- "border-radius": string; /**
974
- * Represents logic surrounding a group of hosted fields.
975
- */
977
+ "border-radius": string;
976
978
  border: string;
977
979
  padding: string;
978
980
  position: string;
@@ -1571,6 +1573,12 @@ export declare const parentStyles: () => {
1571
1573
  "vertical-align": string;
1572
1574
  "text-align": string;
1573
1575
  "margin-left": string;
1576
+ /**
1577
+ * Sets a special-case event listener that fires when all hosted
1578
+ * fields in a form have registered / loaded
1579
+ *
1580
+ * @param fn The listener function
1581
+ */
1574
1582
  "margin-right": string;
1575
1583
  "margin-top": string;
1576
1584
  };
@@ -1599,9 +1607,6 @@ export declare const parentStyles: () => {
1599
1607
  ".secure-payment-form div[class$='-logo'] img": {
1600
1608
  "vertical-align": string;
1601
1609
  };
1602
- /**
1603
- * Deletes all hosted fields within the form
1604
- */
1605
1610
  ".secure-payment-form .credit-card-submit": {
1606
1611
  margin: string;
1607
1612
  };
@@ -1783,9 +1788,7 @@ export declare const parentStyles: () => {
1783
1788
  "background-color": string;
1784
1789
  color: string;
1785
1790
  "text-align": string;
1786
- "border-radius": string; /**
1787
- * Represents logic surrounding a group of hosted fields.
1788
- */
1791
+ "border-radius": string;
1789
1792
  border: string;
1790
1793
  padding: string;
1791
1794
  position: string;
@@ -2027,9 +2030,6 @@ export declare const parentStyles: () => {
2027
2030
  width: string;
2028
2031
  height: string;
2029
2032
  "text-align": string;
2030
- /**
2031
- * Deletes all hosted fields within the form
2032
- */
2033
2033
  margin: string;
2034
2034
  display: string;
2035
2035
  "justify-content": string;