@globalpayments/js 2.1.2 → 3.0.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.
Files changed (32) hide show
  1. package/README.md +32 -1
  2. package/package.json +1 -1
  3. package/types/apm/enums.d.ts +10 -0
  4. package/types/apm/non-card-payments/components/common.d.ts +5 -0
  5. package/types/apm/non-card-payments/components/constants.d.ts +1 -0
  6. package/types/apm/non-card-payments/components/redirect-action-handler.d.ts +1 -0
  7. package/types/apm/non-card-payments/contracts.d.ts +8 -0
  8. package/types/apm/qr-code-payments/components/common.d.ts +1 -1
  9. package/types/apm/qr-code-payments/components/generate-qr-code.d.ts +3 -0
  10. package/types/apm/qr-code-payments/components/present-qr-code-action-handler.d.ts +1 -0
  11. package/types/apm/qr-code-payments/components/qr-code-expired-handler.d.ts +1 -0
  12. package/types/apm/qr-code-payments/contracts.d.ts +3 -7
  13. package/types/apm/qr-code-payments/helpers.d.ts +1 -0
  14. package/types/common/html-element.d.ts +1 -0
  15. package/types/internal/gateways/gp-api/get-apm-payment-methods.d.ts +3 -0
  16. package/types/internal/lib/enums.d.ts +25 -10
  17. package/types/internal/lib/styles/apple-pay/common.d.ts +12 -0
  18. package/types/internal/lib/styles/default.d.ts +81 -24
  19. package/types/internal/lib/styles/google-pay/common.d.ts +11 -0
  20. package/types/internal/lib/styles/gp-default.d.ts +81 -24
  21. package/types/internal/lib/styles/payment-methods/common.d.ts +191 -0
  22. package/types/internal/lib/styles/payment-methods/open-banking.d.ts +40 -0
  23. package/types/internal/lib/styles/payment-methods/qr-code-payments.d.ts +121 -0
  24. package/types/internal/lib/styles/simple.d.ts +16 -34
  25. package/types/internal/lib/translations/en.d.ts +25 -0
  26. package/types/internal/lib/translations/fr.d.ts +60 -0
  27. package/types/internal/lib/translations/zh.d.ts +20 -0
  28. package/types/lib/version.d.ts +1 -1
  29. package/types/tools/configure.d.ts +3 -0
  30. package/types/ui/form/index.d.ts +201 -113
  31. package/types/ui/iframe-field/action-add-open-banking.d.ts +2 -0
  32. package/types/ui/iframe-field/action-add-qr-code-payment-methods.d.ts +1 -1
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/3.0.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": "3.0.3",
4
4
  "author": "Heartland Developer Portal <developers@heartland.us>",
5
5
  "license": "GPL-2.0",
6
6
  "repository": {
@@ -0,0 +1,10 @@
1
+ export declare const enum ApmInternalEvents {
2
+ PaymentMethodsRequestStart = "payment-methods-request-start",
3
+ PaymentMethodsRequestCompleted = "payment-methods-request-completed",
4
+ NavigatesBackBySelectAnotherPaymentMethod = "payment-navigates-back-select-another-payment-method"
5
+ }
6
+ export declare const enum QRCodePaymentsActions {
7
+ RedirectAction = "REDIRECT",
8
+ RedirectInFrameAction = "REDIRECT_IN_FRAME",
9
+ PresentQRCodeAction = "PRESENT_QR_CODE"
10
+ }
@@ -0,0 +1,5 @@
1
+ import { ApmProviders } from "../../../internal/lib/enums";
2
+ import { PaymentMethod } from "../contracts";
3
+ export declare function isApmProviderConfigured(configuration: PaymentMethod[], desiredProvider: ApmProviders): boolean;
4
+ export declare const getSelectAnotherPaymentMethodButton: (id: string, onClickCallback: any) => HTMLDivElement;
5
+ export declare function isUrlValid(url: string): boolean;
@@ -0,0 +1 @@
1
+ export declare const REDIRECT_ACTION_DELAY_IN_SECONDS = 2000;
@@ -0,0 +1 @@
1
+ export default function handleRedirectAction(content: HTMLDivElement, props: any): void;
@@ -0,0 +1,8 @@
1
+ export interface IApmConfiguration {
2
+ allowedPaymentMethods?: PaymentMethod[];
3
+ }
4
+ export interface PaymentMethod {
5
+ provider: string;
6
+ category?: string;
7
+ image?: string;
8
+ }
@@ -1 +1 @@
1
- export declare const getSelectAnotherPaymentMethodButton: (id: string, onClickCallback: any) => HTMLDivElement;
1
+ 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;
@@ -1,12 +1,8 @@
1
- export interface IQRCodePaymentsConfiguration {
1
+ import { IApmConfiguration } from "../non-card-payments/contracts";
2
+ export interface IQRCodePaymentsConfiguration extends IApmConfiguration {
2
3
  enabled?: boolean;
3
- allowedPaymentMethods?: IQRCodePaymentsAllowedPaymentMethod[];
4
4
  }
5
- export interface IQRCodePaymentsAllowedPaymentMethod {
6
- provider: string;
7
- image: string;
8
- }
9
- export interface IPaymentMethodConfiguration {
5
+ export interface IPaymentMethodConfiguration extends IApmConfiguration {
10
6
  provider: {
11
7
  brand: string;
12
8
  };
@@ -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;
@@ -94,3 +94,4 @@ export declare const createHtmlIFrameElement: (props?: {
94
94
  [key: string]: string;
95
95
  }[] | undefined;
96
96
  } | undefined) => HTMLIFrameElement;
97
+ export declare const changeCreditCardFormFieldsVisibility: (visible: boolean) => void;
@@ -0,0 +1,3 @@
1
+ import { IDictionary } from "../../lib/util";
2
+ declare const _default: (url: string, _env: string, data: IDictionary) => Promise<any>;
3
+ export default _default;
@@ -1,14 +1,19 @@
1
1
  export declare enum Apm {
2
+ ApplePay = "apple-pay",
2
3
  ClickToPay = "click-to-pay",
3
4
  GooglePay = "google-pay",
4
- ApplePay = "apple-pay",
5
+ OpenBankingPayment = "open-banking",
5
6
  QRCodePayments = "qr-code-payments"
6
7
  }
8
+ export declare enum ApmEvents {
9
+ PaymentMethodActionDetail = "apm-action-details",
10
+ PaymentMethodSelection = "apm-payment-method"
11
+ }
7
12
  export declare enum CardNetwork {
8
- Visa = "VISA",
9
- Mastercard = "MASTERCARD",
10
13
  Amex = "AMEX",
11
- Discover = "DISCOVER"
14
+ Discover = "DISCOVER",
15
+ Mastercard = "MASTERCARD",
16
+ Visa = "VISA"
12
17
  }
13
18
  export declare enum CharacterValidation {
14
19
  englishOnly = "englishOnly",
@@ -18,12 +23,22 @@ export declare enum Language {
18
23
  en = "en",
19
24
  zh = "zh"
20
25
  }
21
- export declare enum QRCodePaymentsMerchantInteractionEvents {
22
- PaymentMethodSelection = "apm-payment-method",
23
- ProvideQRCodeDetailsMerchantEvent = "apm-action-details",
24
- TransactionCompletedMerchantEvent = "apm-success-message"
25
- }
26
26
  export declare enum QRCodePaymentsProviderBrands {
27
+ Alipay = "Alipay",
27
28
  AlipayHK = "AlipayHK",
28
- Alipay = "Alipay"
29
+ WeChat = "WeChat"
30
+ }
31
+ export declare enum OpenBanking {
32
+ title = "Bank Payment"
33
+ }
34
+ export declare enum ApmProviders {
35
+ Alipay = "Alipay",
36
+ AlipayHK = "AlipayHK",
37
+ OpenBanking = "OPEN_BANKING",
38
+ WeChat = "WeChat"
39
+ }
40
+ export declare enum QRCodePaymentsWeChatProviderBrands {
41
+ WeChatBrand = "WeChat",
42
+ WeChatMethodResponse = "WECHAT",
43
+ WeChatAccountResponse = "WeChat Pay"
29
44
  }
@@ -0,0 +1,12 @@
1
+ declare const styles: (assetBaseUrl: string) => {
2
+ "apple-pay-button": {
3
+ "--apple-pay-button-width": string;
4
+ "--apple-pay-button-height": string;
5
+ "--apple-pay-button-border-radius": string;
6
+ "--apple-pay-button-padding": string;
7
+ "--apple-pay-button-box-sizing": string;
8
+ display: string;
9
+ margin: string;
10
+ };
11
+ };
12
+ export default styles;
@@ -185,6 +185,10 @@ export declare const parentStyles: (assetBaseUrl: string) => {
185
185
  margin: string;
186
186
  cursor: string;
187
187
  };
188
+ ".secure-payment-form .qr-code-payment-method-button:focus"?: {
189
+ outline: string;
190
+ "outline-offset": string;
191
+ };
188
192
  ".secure-payment-form .qr-code-payment-method-alipayhk"?: {
189
193
  "background-color": string;
190
194
  border: string;
@@ -201,6 +205,14 @@ export declare const parentStyles: (assetBaseUrl: string) => {
201
205
  "background-color": string;
202
206
  border: string;
203
207
  };
208
+ ".secure-payment-form .qr-code-payment-method-wechat"?: {
209
+ "background-color": string;
210
+ border: string;
211
+ };
212
+ ".secure-payment-form .qr-code-payment-method-wechat:hover"?: {
213
+ "background-color": string;
214
+ border: string;
215
+ };
204
216
  ".secure-payment-form .qr-code-payment-iframe-wrapper"?: {
205
217
  display: string;
206
218
  "flex-direction": string;
@@ -216,28 +228,6 @@ export declare const parentStyles: (assetBaseUrl: string) => {
216
228
  "line-height": string;
217
229
  width: string;
218
230
  };
219
- ".secure-payment-form .link-button"?: {
220
- background: string;
221
- border: string;
222
- color: string;
223
- "font-style": string;
224
- "font-weight": string;
225
- "line-height": string;
226
- "font-size": string;
227
- padding: string;
228
- cursor: string;
229
- margin: string;
230
- };
231
- ".secure-payment-form .link-button:hover"?: {
232
- color: string;
233
- };
234
- ".secure-payment-form .link-button:active"?: {
235
- color: string;
236
- };
237
- ".secure-payment-form .link-button:focus"?: {
238
- color: string;
239
- border: string;
240
- };
241
231
  ".secure-payment-form .qr-code-payment-countdown-timer-message"?: {
242
232
  color: string;
243
233
  "font-size": string;
@@ -288,15 +278,78 @@ export declare const parentStyles: (assetBaseUrl: string) => {
288
278
  "font-size": string;
289
279
  "line-height": string;
290
280
  };
291
- ".secure-payment-form .qr-code-redirecting-to-page"?: {
281
+ ".secure-payment-form .open-banking-button-wrapper": {
282
+ display: string;
283
+ "flex-direction": string;
284
+ "align-items": string;
285
+ };
286
+ ".secure-payment-form .open-banking-button::before": {
287
+ content: string;
288
+ width: string;
289
+ height: string;
290
+ position: string;
291
+ top: string;
292
+ right: string;
293
+ };
294
+ ".secure-payment-form .open-banking-button": {
295
+ position: string;
296
+ background: string;
297
+ color: string;
298
+ height: string;
299
+ width: string;
300
+ "border-radius": string;
301
+ border: string;
302
+ margin: string;
303
+ cursor: string;
304
+ "-webkit-box-shadow": string;
305
+ "-moz-box-shadow": string;
306
+ "box-shadow": string;
307
+ };
308
+ ".secure-payment-form .open-banking-button:hover": {
309
+ "border-color": string;
310
+ "-webkit-box-shadow": string;
311
+ "-moz-box-shadow": string;
312
+ "box-shadow": string;
313
+ };
314
+ ".secure-payment-form .open-banking-button:focus": {
315
+ outline: string;
316
+ "outline-offset": string;
317
+ };
318
+ ".secure-payment-form .link-button": {
319
+ display: string;
320
+ "flex-direction": string;
321
+ "align-items": string;
322
+ background: string;
323
+ border: string;
324
+ color: string;
325
+ "font-style": string;
326
+ "font-weight": string;
327
+ "line-height": string;
328
+ "font-size": string;
329
+ padding: string;
330
+ cursor: string;
331
+ margin: string;
332
+ };
333
+ ".secure-payment-form .link-button:hover": {
334
+ color: string;
335
+ };
336
+ ".secure-payment-form .link-button:active": {
337
+ color: string;
338
+ };
339
+ ".secure-payment-form .link-button:focus": {
340
+ color: string;
341
+ border: string;
342
+ };
343
+ ".secure-payment-form .apms-redirecting-to-page": {
292
344
  "justify-content": string;
293
345
  height: string;
294
346
  display: string;
295
347
  "flex-direction": string;
296
348
  "align-items": string;
297
349
  };
298
- ".secure-payment-form .qr-code-redirecting-to-page-message"?: {
350
+ ".secure-payment-form .apms-redirecting-to-page-message": {
299
351
  color: string;
352
+ "font-family": string;
300
353
  "font-size": string;
301
354
  "line-height": string;
302
355
  };
@@ -304,6 +357,10 @@ export declare const parentStyles: (assetBaseUrl: string) => {
304
357
  height: string;
305
358
  margin: string;
306
359
  };
360
+ "#googlePay button:focus": {
361
+ outline: string;
362
+ "outline-offset": string;
363
+ };
307
364
  ".secure-payment-form .ctp-panel": {
308
365
  border: string;
309
366
  "box-shadow": string;
@@ -0,0 +1,11 @@
1
+ declare const styles: (assetBaseUrl: string) => {
2
+ "#googlePay": {
3
+ height: string;
4
+ margin: string;
5
+ };
6
+ "#googlePay button:focus": {
7
+ outline: string;
8
+ "outline-offset": string;
9
+ };
10
+ };
11
+ export default styles;
@@ -147,6 +147,10 @@ export declare const parentStyles: (assetBaseUrl: string) => {
147
147
  margin: string;
148
148
  cursor: string;
149
149
  };
150
+ ".secure-payment-form .qr-code-payment-method-button:focus"?: {
151
+ outline: string;
152
+ "outline-offset": string;
153
+ };
150
154
  ".secure-payment-form .qr-code-payment-method-alipayhk"?: {
151
155
  "background-color": string;
152
156
  border: string;
@@ -163,6 +167,14 @@ export declare const parentStyles: (assetBaseUrl: string) => {
163
167
  "background-color": string;
164
168
  border: string;
165
169
  };
170
+ ".secure-payment-form .qr-code-payment-method-wechat"?: {
171
+ "background-color": string;
172
+ border: string;
173
+ };
174
+ ".secure-payment-form .qr-code-payment-method-wechat:hover"?: {
175
+ "background-color": string;
176
+ border: string;
177
+ };
166
178
  ".secure-payment-form .qr-code-payment-iframe-wrapper"?: {
167
179
  display: string;
168
180
  "flex-direction": string;
@@ -178,28 +190,6 @@ export declare const parentStyles: (assetBaseUrl: string) => {
178
190
  "line-height": string;
179
191
  width: string;
180
192
  };
181
- ".secure-payment-form .link-button"?: {
182
- background: string;
183
- border: string;
184
- color: string;
185
- "font-style": string;
186
- "font-weight": string;
187
- "line-height": string;
188
- "font-size": string;
189
- padding: string;
190
- cursor: string;
191
- margin: string;
192
- };
193
- ".secure-payment-form .link-button:hover"?: {
194
- color: string;
195
- };
196
- ".secure-payment-form .link-button:active"?: {
197
- color: string;
198
- };
199
- ".secure-payment-form .link-button:focus"?: {
200
- color: string;
201
- border: string;
202
- };
203
193
  ".secure-payment-form .qr-code-payment-countdown-timer-message"?: {
204
194
  color: string;
205
195
  "font-size": string;
@@ -250,15 +240,78 @@ export declare const parentStyles: (assetBaseUrl: string) => {
250
240
  "font-size": string;
251
241
  "line-height": string;
252
242
  };
253
- ".secure-payment-form .qr-code-redirecting-to-page"?: {
243
+ ".secure-payment-form .open-banking-button-wrapper": {
244
+ display: string;
245
+ "flex-direction": string;
246
+ "align-items": string;
247
+ };
248
+ ".secure-payment-form .open-banking-button::before": {
249
+ content: string;
250
+ width: string;
251
+ height: string;
252
+ position: string;
253
+ top: string;
254
+ right: string;
255
+ };
256
+ ".secure-payment-form .open-banking-button": {
257
+ position: string;
258
+ background: string;
259
+ color: string;
260
+ height: string;
261
+ width: string;
262
+ "border-radius": string;
263
+ border: string;
264
+ margin: string;
265
+ cursor: string;
266
+ "-webkit-box-shadow": string;
267
+ "-moz-box-shadow": string;
268
+ "box-shadow": string;
269
+ };
270
+ ".secure-payment-form .open-banking-button:hover": {
271
+ "border-color": string;
272
+ "-webkit-box-shadow": string;
273
+ "-moz-box-shadow": string;
274
+ "box-shadow": string;
275
+ };
276
+ ".secure-payment-form .open-banking-button:focus": {
277
+ outline: string;
278
+ "outline-offset": string;
279
+ };
280
+ ".secure-payment-form .link-button": {
281
+ display: string;
282
+ "flex-direction": string;
283
+ "align-items": string;
284
+ background: string;
285
+ border: string;
286
+ color: string;
287
+ "font-style": string;
288
+ "font-weight": string;
289
+ "line-height": string;
290
+ "font-size": string;
291
+ padding: string;
292
+ cursor: string;
293
+ margin: string;
294
+ };
295
+ ".secure-payment-form .link-button:hover": {
296
+ color: string;
297
+ };
298
+ ".secure-payment-form .link-button:active": {
299
+ color: string;
300
+ };
301
+ ".secure-payment-form .link-button:focus": {
302
+ color: string;
303
+ border: string;
304
+ };
305
+ ".secure-payment-form .apms-redirecting-to-page": {
254
306
  "justify-content": string;
255
307
  height: string;
256
308
  display: string;
257
309
  "flex-direction": string;
258
310
  "align-items": string;
259
311
  };
260
- ".secure-payment-form .qr-code-redirecting-to-page-message"?: {
312
+ ".secure-payment-form .apms-redirecting-to-page-message": {
261
313
  color: string;
314
+ "font-family": string;
262
315
  "font-size": string;
263
316
  "line-height": string;
264
317
  };
@@ -278,6 +331,10 @@ export declare const parentStyles: (assetBaseUrl: string) => {
278
331
  height: string;
279
332
  margin: string;
280
333
  };
334
+ "#googlePay button:focus": {
335
+ outline: string;
336
+ "outline-offset": string;
337
+ };
281
338
  ".secure-payment-form .ctp-panel": {
282
339
  border: string;
283
340
  "box-shadow": string;