@globalpayments/js 2.1.2 → 2.1.3

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 CHANGED
@@ -24,7 +24,7 @@ This plugin allows you to use online payments (eCommerce) features of a variety
24
24
  ## Usage
25
25
 
26
26
  ```html
27
- <script src="https://js.globalpay.com/v1/globalpayments.js"></script>
27
+ <script src="https://js.globalpay.com/2.1.3/globalpayments.js"></script>
28
28
  ```
29
29
 
30
30
  > Note: Installing via NPM will only provide TypeScript types for type-checking.
@@ -174,6 +174,37 @@ Enables a mandatory restriction for card holdername field
174
174
 
175
175
  enables the use of the fingerprint mode with "ALWAYS" value
176
176
 
177
+ ##### `fieldValidation` - `object` (Optional)
178
+
179
+ > Note: Applies to GP API only.
180
+
181
+ enables the use of the HF Built-in Validations. The object structure is:
182
+ ```javascript
183
+ fieldValidation?: {
184
+ enabled?: boolean, // (Optional)
185
+ characterValidation?: string // Supported values: [`englishOnly`, `none`] (Optional)
186
+ }
187
+ ```
188
+ The optional `characterValidation` string config can be set as `englishOnly` or `none` and this will indicate if the Card Holder name contains or not English characters.
189
+
190
+ ##### `qrCodePayments` - `object` (Optional - under `apms` configs)
191
+
192
+ > Note: Applies to GP API only.
193
+
194
+ enables the use of the QR Code Payments. The object structure is:
195
+ ```javascript
196
+ apms.qrCodePayments?: {
197
+ enabled?: boolean, // (Optional)
198
+ allowedPaymentMethods?: [ // Array of allowed Payment Methods (Optional)
199
+ {
200
+ provider: string,
201
+ image: string,
202
+ },
203
+ ]
204
+ }
205
+ ```
206
+ The optional `allowedPaymentMethods` object config can be set to manually add the preferred Payment methods.
207
+
177
208
  #### Examples
178
209
 
179
210
  ##### Heartland eCommerce
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@globalpayments/js",
3
- "version": "2.1.2",
3
+ "version": "2.1.3",
4
4
  "author": "Heartland Developer Portal <developers@heartland.us>",
5
5
  "license": "GPL-2.0",
6
6
  "repository": {
@@ -1 +1,2 @@
1
1
  export declare const getSelectAnotherPaymentMethodButton: (id: string, onClickCallback: any) => HTMLDivElement;
2
+ export declare function getCountdownCounter(secondsToExpire: string, onFinishCallback: any): HTMLDivElement;
@@ -0,0 +1,3 @@
1
+ export declare function removeScriptById(scriptId: string): void;
2
+ export declare function loadQRCodeLibraryAndGenerate(text: string): Promise<string>;
3
+ export declare function generateQRCode(text: string): Promise<string>;
@@ -0,0 +1 @@
1
+ export default function handlePresentQRCodeAction(content: HTMLDivElement, props: any): void;
@@ -0,0 +1 @@
1
+ export default function handleQRCodeExpiredScreen(content: HTMLDivElement, props: any): void;
@@ -5,5 +5,6 @@ export declare const enum QRCodePaymentsInternalEvents {
5
5
  }
6
6
  export declare const enum QRCodePaymentsActions {
7
7
  RedirectAction = "REDIRECT",
8
- RedirectInFrameAction = "REDIRECT_IN_FRAME"
8
+ RedirectInFrameAction = "REDIRECT_IN_FRAME",
9
+ PresentQRCodeAction = "PRESENT_QR_CODE"
9
10
  }
@@ -1,2 +1,3 @@
1
1
  import { IPaymentMethodConfiguration, IPaymentMethodConfigurationNormalized } from "./contracts";
2
2
  export declare const normalizePaymentMethodConfigurations: (paymentMethodConfigurations: IPaymentMethodConfiguration) => IPaymentMethodConfigurationNormalized;
3
+ export declare const validateProviderBrand: (providerBrand: string) => string;
@@ -25,5 +25,11 @@ export declare enum QRCodePaymentsMerchantInteractionEvents {
25
25
  }
26
26
  export declare enum QRCodePaymentsProviderBrands {
27
27
  AlipayHK = "AlipayHK",
28
- Alipay = "Alipay"
28
+ Alipay = "Alipay",
29
+ WeChat = "WeChat"
30
+ }
31
+ export declare enum QRCodePaymentsWeChatProviderBrands {
32
+ WeChatBrand = "WeChat",
33
+ WeChatMethodResponse = "WECHAT",
34
+ WeChatAccountResponse = "WeChat Pay"
29
35
  }
@@ -201,6 +201,14 @@ export declare const parentStyles: (assetBaseUrl: string) => {
201
201
  "background-color": string;
202
202
  border: string;
203
203
  };
204
+ ".secure-payment-form .qr-code-payment-method-wechat"?: {
205
+ "background-color": string;
206
+ border: string;
207
+ };
208
+ ".secure-payment-form .qr-code-payment-method-wechat:hover"?: {
209
+ "background-color": string;
210
+ border: string;
211
+ };
204
212
  ".secure-payment-form .qr-code-payment-iframe-wrapper"?: {
205
213
  display: string;
206
214
  "flex-direction": string;
@@ -163,6 +163,14 @@ export declare const parentStyles: (assetBaseUrl: string) => {
163
163
  "background-color": string;
164
164
  border: string;
165
165
  };
166
+ ".secure-payment-form .qr-code-payment-method-wechat"?: {
167
+ "background-color": string;
168
+ border: string;
169
+ };
170
+ ".secure-payment-form .qr-code-payment-method-wechat:hover"?: {
171
+ "background-color": string;
172
+ border: string;
173
+ };
166
174
  ".secure-payment-form .qr-code-payment-iframe-wrapper"?: {
167
175
  display: string;
168
176
  "flex-direction": string;
@@ -41,6 +41,14 @@ export declare const styles: (assetBaseUrl: string) => {
41
41
  "background-color": string;
42
42
  border: string;
43
43
  };
44
+ ".secure-payment-form .qr-code-payment-method-wechat": {
45
+ "background-color": string;
46
+ border: string;
47
+ };
48
+ ".secure-payment-form .qr-code-payment-method-wechat:hover": {
49
+ "background-color": string;
50
+ border: string;
51
+ };
44
52
  ".secure-payment-form .qr-code-payment-iframe-wrapper": {
45
53
  display: string;
46
54
  "flex-direction": string;
@@ -184,6 +184,14 @@ export declare const parentStyles: (assetBaseUrl: string) => {
184
184
  "background-color": string;
185
185
  border: string;
186
186
  };
187
+ ".secure-payment-form .qr-code-payment-method-wechat"?: {
188
+ "background-color": string;
189
+ border: string;
190
+ };
191
+ ".secure-payment-form .qr-code-payment-method-wechat:hover"?: {
192
+ "background-color": string;
193
+ border: string;
194
+ };
187
195
  ".secure-payment-form .qr-code-payment-iframe-wrapper"?: {
188
196
  display: string;
189
197
  "flex-direction": string;
@@ -47,6 +47,26 @@ declare const en: {
47
47
  };
48
48
  "other-cards-label": string;
49
49
  QR: {
50
+ scanRqCode: string;
51
+ payInApp: string;
52
+ amount: {
53
+ "aria-label": string;
54
+ };
55
+ qrImage: {
56
+ alt: string;
57
+ "aria-label": string;
58
+ };
59
+ timer: {
60
+ text: string;
61
+ minutes: string;
62
+ seconds: string;
63
+ "icon-alt": string;
64
+ };
65
+ expiredScreen: {
66
+ title: string;
67
+ alt: string;
68
+ text: string;
69
+ };
50
70
  button: {
51
71
  text: string;
52
72
  "aria-label": string;
@@ -54,6 +54,26 @@ declare const zh: {
54
54
  redirectScreen: {
55
55
  redirectingToPaymentPageMessage: string;
56
56
  };
57
+ scanRqCode: string;
58
+ payInApp: string;
59
+ amount: {
60
+ "aria-label": string;
61
+ };
62
+ qrImage: {
63
+ alt: string;
64
+ "aria-label": string;
65
+ };
66
+ timer: {
67
+ text: string;
68
+ minutes: string;
69
+ seconds: string;
70
+ "icon-alt": string;
71
+ };
72
+ expiredScreen: {
73
+ title: string;
74
+ alt: string;
75
+ text: string;
76
+ };
57
77
  };
58
78
  };
59
79
  export default zh;
@@ -1,2 +1,2 @@
1
- declare const _default: "2.1.2";
1
+ declare const _default: "2.1.3";
2
2
  export default _default;
@@ -491,6 +491,14 @@ export declare const parentStyles: () => {
491
491
  "background-color": string;
492
492
  border: string;
493
493
  };
494
+ ".secure-payment-form .qr-code-payment-method-wechat"?: {
495
+ "background-color": string;
496
+ border: string;
497
+ };
498
+ ".secure-payment-form .qr-code-payment-method-wechat:hover"?: {
499
+ "background-color": string;
500
+ border: string;
501
+ };
494
502
  ".secure-payment-form .qr-code-payment-iframe-wrapper"?: {
495
503
  display: string;
496
504
  "flex-direction": string;
@@ -553,7 +561,11 @@ export declare const parentStyles: () => {
553
561
  "font-size": string;
554
562
  };
555
563
  ".secure-payment-form .qr-code-expired-alert"?: {
556
- display: string;
564
+ display: string; /**
565
+ * Appends additional CSS rules to the group of hosted fields
566
+ *
567
+ * @param json New CSS rules
568
+ */
557
569
  border: string;
558
570
  height: string;
559
571
  "margin-top": string;
@@ -1047,6 +1059,14 @@ export declare const parentStyles: () => {
1047
1059
  "background-color": string;
1048
1060
  border: string;
1049
1061
  };
1062
+ ".secure-payment-form .qr-code-payment-method-wechat"?: {
1063
+ "background-color": string;
1064
+ border: string;
1065
+ };
1066
+ ".secure-payment-form .qr-code-payment-method-wechat:hover"?: {
1067
+ "background-color": string;
1068
+ border: string;
1069
+ };
1050
1070
  ".secure-payment-form .qr-code-payment-iframe-wrapper"?: {
1051
1071
  display: string;
1052
1072
  "flex-direction": string;
@@ -1109,7 +1129,11 @@ export declare const parentStyles: () => {
1109
1129
  "font-size": string;
1110
1130
  };
1111
1131
  ".secure-payment-form .qr-code-expired-alert"?: {
1112
- display: string;
1132
+ display: string; /**
1133
+ * Appends additional CSS rules to the group of hosted fields
1134
+ *
1135
+ * @param json New CSS rules
1136
+ */
1113
1137
  border: string;
1114
1138
  height: string;
1115
1139
  "margin-top": string;
@@ -2017,6 +2041,14 @@ export declare const parentStyles: () => {
2017
2041
  "background-color": string;
2018
2042
  border: string;
2019
2043
  };
2044
+ ".secure-payment-form .qr-code-payment-method-wechat"?: {
2045
+ "background-color": string;
2046
+ border: string;
2047
+ };
2048
+ ".secure-payment-form .qr-code-payment-method-wechat:hover"?: {
2049
+ "background-color": string;
2050
+ border: string;
2051
+ };
2020
2052
  ".secure-payment-form .qr-code-payment-iframe-wrapper"?: {
2021
2053
  display: string;
2022
2054
  "flex-direction": string;
@@ -2079,7 +2111,11 @@ export declare const parentStyles: () => {
2079
2111
  "font-size": string;
2080
2112
  };
2081
2113
  ".secure-payment-form .qr-code-expired-alert"?: {
2082
- display: string;
2114
+ display: string; /**
2115
+ * Appends additional CSS rules to the group of hosted fields
2116
+ *
2117
+ * @param json New CSS rules
2118
+ */
2083
2119
  border: string;
2084
2120
  height: string;
2085
2121
  "margin-top": string;
@@ -1,3 +1,3 @@
1
1
  import { IframeField } from ".";
2
2
  import { IPaymentMethodConfigurationNormalized } from "../../apm/qr-code-payments/contracts";
3
- export default function addQRCodePaymentMethods(iframeField: IframeField | undefined, paymentMethodConfigurations: IPaymentMethodConfigurationNormalized[]): void;
3
+ export default function addQRCodePaymentMethods(iframeField: IframeField | undefined, paymentMethodConfigurations: IPaymentMethodConfigurationNormalized[], amount: string | number): void;
@@ -1,11 +0,0 @@
1
- export declare enum Apm {
2
- ClickToPay = "click-to-pay",
3
- GooglePay = "google-pay",
4
- ApplePay = "apple-pay"
5
- }
6
- export declare enum CardNetwork {
7
- Visa = "VISA",
8
- Mastercard = "MASTERCARD",
9
- Amex = "AMEX",
10
- Discover = "DISCOVER"
11
- }