You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+59Lines changed: 59 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -321,6 +321,8 @@ const options = {
321
321
enableCopy:false, // Optional, enables the copy icon in collect and reveal elements to copy text to clipboard. Defaults to 'false').
322
322
allowedFileType: string[], // Optional, allowed extensions for the file to be uploaded.
323
323
cardMetadata: {}, // Optional, metadata to control card number element behavior. (only applicable for CARD_NUMBER ElementType).
324
+
masking:true, // Optional, indicates whether the input should be masked. Defaults to 'false'.
325
+
maskingChar:'*', // Optional, character used for masking input when masking is enabled. Defaults to '*'.
324
326
}
325
327
```
326
328
@@ -371,6 +373,63 @@ const cardMetadata = {
371
373
-`HIPERCARD`
372
374
-`CARTES_BANCAIRES`
373
375
376
+
`masking` : A boolean value for whether to mask the input of the element. When masking is enabled, user input will be replaced with a masking character.
377
+
The default masking character is `*`, but you can customize masking character using the maskingChar property.
378
+
379
+
`maskingChar`: A single character used to mask the input when masking is enabled. Defaults to `*`, but can be customized to any character of your choice.
380
+
381
+
***Collect Element Options examples for masking***:
382
+
383
+
Example for CVV:
384
+
```jsx
385
+
constoptions= {
386
+
required:true,
387
+
enableCopy:false,
388
+
masking:true,
389
+
maskingChar:'•',
390
+
}
391
+
```
392
+
User input: "1234"
393
+
Value displayed in CVV: "••••"
394
+
395
+
Example for CARDHOLDER_NAME:
396
+
```jsx
397
+
constoptions= {
398
+
required:true,
399
+
enableCopy:false,
400
+
masking:true,
401
+
}
402
+
```
403
+
User input: "John Doe"
404
+
Value displayed in CARDHOLDER_NAME: "********"
405
+
406
+
Example for CARD_NUMBER:
407
+
```jsx
408
+
constoptions= {
409
+
required:true,
410
+
enableCopy:false,
411
+
masking:true,
412
+
maskingChar:'#'
413
+
}
414
+
```
415
+
User input: "4111 1111 1111 1111"
416
+
Value displayed in CARD_NUMBER: "#### #### #### ####"
417
+
418
+
Example for PIN:
419
+
```jsx
420
+
constoptions= {
421
+
required:true,
422
+
enableCopy:false,
423
+
masking:true,
424
+
maskingChar:'&'
425
+
}
426
+
```
427
+
User input: "98364721"
428
+
Value displayed in PIN: "&&&&&&&&"
429
+
430
+
**Note**:
431
+
- Unmasked data will be stored in the vault.
432
+
374
433
### Step 3: Collect data from Elements
375
434
376
435
When the form is ready to be submitted, call the `collect(options?)` method on the container object. The `options` parameter takes a object of optional parameters as shown below:
0 commit comments