@motopays/pay-form 2.6.6-rc.9 → 2.6.7-rc.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/CHANGELOG.md CHANGED
@@ -1,6 +1,18 @@
1
1
  # Changelog
2
2
 
3
- ## 2.6.6-rc.9
3
+ ## 2.6.7-rc.1
4
+ ### Added
5
+ - New analytics event `pay-validation-error` emitted when the user attempts to pay but the form is invalid.
6
+ - Fired when the `Pay` button is clicked while card requisites are invalid.
7
+ - Fired when the Apple Pay or Google Pay button is clicked while the form is not payable.
8
+ - Payload `IPayValidationErrorAnalytics`:
9
+ - `button`: `'pay' | 'applepay' | 'googlepay'`
10
+ - `invalidComponents`: `string[]` — keys of enabled components that are not filled or not valid.
11
+
12
+
13
+
14
+
15
+ ## 2.6.6
4
16
  ### Added
5
17
  - Redesign of cvv input on card verification, card selection dropdown instead of list, confirmation dialog on card removal
6
18
 
@@ -8,16 +20,11 @@ New phrases added:
8
20
  existingCards: {
9
21
  confirmRemoveCard: 'Are you sure you want to remove this card?',
10
22
  cancel: 'Cancel',
11
- verifyCardCodeLabels: {
12
- CVV: 'Please verify your CVV',
13
- CVC: 'Please verify your CVC',
14
- CID: 'Please verify your CID',
15
- CVN: 'Please verify your CVN',
16
- CVE: 'Please verify your CVE',
17
- CVP2: 'Please verify your CVP2',
18
- }
23
+ verifyCardCodeLabel: 'Please verify your {code}:'
19
24
  }
20
25
 
26
+ `{code}` is a placeholder that will be replaced with the card's security code type (e.g. CVV, CVC, CID).
27
+
21
28
 
22
29
 
23
30
 
package/README.md CHANGED
@@ -372,7 +372,10 @@ const settings: ISettings = {
372
372
  existingCards: {
373
373
  addNewCard: 'custom',
374
374
  manageCardsHeader: 'custom',
375
- removeCard: 'custom'
375
+ removeCard: 'custom',
376
+ confirmRemoveCard: 'custom',
377
+ cancel: 'custom',
378
+ verifyCardCodeLabel: 'custom {code}:'
376
379
  },
377
380
  header: 'custom',
378
381
  noAvailablePaymentMethods: 'custom',
@@ -568,6 +571,7 @@ For receiving analytics listen analyticsTracked events.
568
571
  'apms-show-button-click' - the apm collapse text has been clicked. Payload: ICardAnalytics.<br>
569
572
  'master-click' - the master checkbox has been clicked. <br>
570
573
  'master-focus' - the master checkbox has been clicked. <br>
574
+ 'pay-validation-error' - the payment was attempted but validation failed. Emitted when the 'Pay' button is clicked while card requisites are invalid, or when an Apple Pay / Google Pay button is clicked while the form is not payable. Payload: IPayValidationErrorAnalytics.<br>
571
575
 
572
576
  Examples of dynamic event types (number inserting):
573
577
  &emsp;1. Example of the first checkbox: 'charge-term-checkbox-0-check'
@@ -622,7 +626,8 @@ type TAnalyticsServiceAction =
622
626
  | ServiceAction<'cards-toggle-button-click', ICardListAnalytics>
623
627
  | ServiceAction<'remove-card-button-click', ICardAnalytics>
624
628
  | ServiceAction<'select-card-button-click', ICardAnalytics>
625
- | ServiceAction<'apms-show-button-click', ICardAnalytics>;
629
+ | ServiceAction<'apms-show-button-click', ICardAnalytics>
630
+ | ServiceAction<'pay-validation-error', IPayValidationErrorAnalytics>;
626
631
 
627
632
 
628
633
  //payload types
@@ -642,6 +647,11 @@ interface IUserPreferencesAnalytics {
642
647
  name: string;
643
648
  text: string;
644
649
  }
650
+
651
+ interface IPayValidationErrorAnalytics {
652
+ button: string; // 'pay' | 'applepay' | 'googlepay'
653
+ invalidComponents: string[]; // keys of components that are enabled but not filled or not valid
654
+ }
645
655
  ```
646
656
 
647
657
  ### Linkify
package/index.d.ts CHANGED
@@ -80,7 +80,7 @@ export interface ILanguage {
80
80
  removeCard: string;
81
81
  confirmRemoveCard: string;
82
82
  cancel: string;
83
- verifyCardCodeLabels?: Record<string, string>;
83
+ verifyCardCodeLabel?: string;
84
84
  };
85
85
  paymentResult: {
86
86
  success: string;
@@ -347,7 +347,11 @@ export interface IUserPreferencesAnalytics {
347
347
  name: string;
348
348
  text: string;
349
349
  }
350
- export type TAnalyticsServiceAction = ServiceAction<"init-start"> | ServiceAction<"loading-finish"> | ServiceAction<"card-number-field-focus"> | ServiceAction<"expiration-date-field-focus"> | ServiceAction<"cvv-field-focus"> | ServiceAction<"card-holder-field-focus"> | ServiceAction<"number-field-focus"> | ServiceAction<"master-click"> | ServiceAction<"master-focus"> | ServiceAction<`charge-term-checkbox${`-${number}`}-focus`, IChargeTermsAnalytics> | ServiceAction<`charge-term-checkbox${`-${number}`}-check`, IChargeTermsAnalytics> | ServiceAction<`charge-term-checkbox${`-${number}`}-uncheck`, IChargeTermsAnalytics> | ServiceAction<`user-preference-checkbox${`-${number}`}-focus`, IUserPreferencesAnalytics> | ServiceAction<`user-preference-checkbox${`-${number}`}-check`, IUserPreferencesAnalytics> | ServiceAction<`user-preference-checkbox${`-${number}`}-uncheck`, IUserPreferencesAnalytics> | ServiceAction<"pay-button-focus"> | ServiceAction<"pay-button-click"> | ServiceAction<`${string}-button-focus`> | ServiceAction<`${string}-button-click`> | ServiceAction<"add-card-button-focus"> | ServiceAction<"add-card-button-click"> | ServiceAction<"card-options-button-click", ICardAnalytics> | ServiceAction<"cards-toggle-button-click", ICardListAnalytics> | ServiceAction<"remove-card-button-click", ICardAnalytics> | ServiceAction<"select-card-button-click", ICardAnalytics> | ServiceAction<"apms-show-button-click", ICardAnalytics>;
350
+ export interface IPayValidationErrorAnalytics {
351
+ button: string;
352
+ invalidComponents: string[];
353
+ }
354
+ export type TAnalyticsServiceAction = ServiceAction<"init-start"> | ServiceAction<"loading-finish"> | ServiceAction<"card-number-field-focus"> | ServiceAction<"expiration-date-field-focus"> | ServiceAction<"cvv-field-focus"> | ServiceAction<"card-holder-field-focus"> | ServiceAction<"number-field-focus"> | ServiceAction<"master-click"> | ServiceAction<"master-focus"> | ServiceAction<`charge-term-checkbox${`-${number}`}-focus`, IChargeTermsAnalytics> | ServiceAction<`charge-term-checkbox${`-${number}`}-check`, IChargeTermsAnalytics> | ServiceAction<`charge-term-checkbox${`-${number}`}-uncheck`, IChargeTermsAnalytics> | ServiceAction<`user-preference-checkbox${`-${number}`}-focus`, IUserPreferencesAnalytics> | ServiceAction<`user-preference-checkbox${`-${number}`}-check`, IUserPreferencesAnalytics> | ServiceAction<`user-preference-checkbox${`-${number}`}-uncheck`, IUserPreferencesAnalytics> | ServiceAction<"pay-button-focus"> | ServiceAction<"pay-button-click"> | ServiceAction<`${string}-button-focus`> | ServiceAction<`${string}-button-click`> | ServiceAction<"add-card-button-focus"> | ServiceAction<"add-card-button-click"> | ServiceAction<"card-options-button-click", ICardAnalytics> | ServiceAction<"cards-toggle-button-click", ICardListAnalytics> | ServiceAction<"remove-card-button-click", ICardAnalytics> | ServiceAction<"select-card-button-click", ICardAnalytics> | ServiceAction<"apms-show-button-click", ICardAnalytics> | ServiceAction<"pay-validation-error", IPayValidationErrorAnalytics>;
351
355
  export interface IApmsShowAnalytics {
352
356
  show: boolean;
353
357
  }