skyflow-js 1.4.0 → 1.8.0

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
@@ -2,6 +2,49 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [1.8.0] - 2021-12-07
6
+
7
+ ### Added
8
+ - `setError(error: string)` method to set custom UI error to be displayed on the collect and reveal Elements
9
+ - `resetError()` method is used to clear the custom UI error message set through setError
10
+ - `format` parameter in `collectElementOptions` to support different type of date formats for `EXPIRATION_DATE` element
11
+ - `setValue(value: string)` and `clearValue()` method in DEV env, to set/clear the value of a collect element.
12
+ - `setToken(value: string)` method to set the token for a reveal element.
13
+ - `setAltText(value: string)` and `clearAltText()` method to set/clear the altText for a reveal
14
+ ### Changed
15
+
16
+ - Changed error messages in the logs and callback errors.
17
+ - `altText` support has been deprecated for collect element
18
+ - `vaultID` and `vaultURL` are now optional parameters in Configuration constructor
19
+
20
+ ### Fixed
21
+ - Updating UI error messages
22
+
23
+ ## [1.7.0] - 2021-11-24
24
+ ### Added
25
+ - `validations` option in `CollectElementInput` that takes an array of validation rules
26
+ - `REGEX_MATCH_RULE`, `LENGTH_MATCH_RULE` & `ELEMENT_MATCH_RULE` Validation rules types
27
+ - `PIN` Element type
28
+
29
+ ### Fixed
30
+ - Card Number validation
31
+
32
+
33
+ ## [1.6.0] - 2021-11-16
34
+
35
+ ### Added
36
+ - `enableCardIcon` option to configure Card Icon visibility
37
+ - `INPUT_FIELD` Element type for custom UI elements
38
+ - `unmount` method to reset collect element to initial state
39
+
40
+ ### Changed
41
+ - New VISA Card Icon with updated Logo
42
+
43
+ ## [1.5.0] - 2021-11-10
44
+
45
+ ### Changed
46
+ - Renamed invokeGateway to invokeConnection
47
+ - Renamed gatewayURL to connectionURL
5
48
  ## [1.4.0] - 2021-10-26
6
49
 
7
50
  ### Added
package/README.md CHANGED
@@ -8,7 +8,7 @@ Skyflow’s Javascript SDK can be used to securely collect, tokenize, and reveal
8
8
  - [**Initializing Skyflow.js**](#Initializing-Skyflowjs)
9
9
  - [**Securely collecting data client-side**](#Securely-collecting-data-client-side)
10
10
  - [**Securely revealing data client-side**](#Securely-revealing-data-client-side)
11
- - [**Securely invoking gateway client-side**](#Securely-invoking-gateway-client-side)
11
+ - [**Securely invoking Connections client-side**](#Securely-invoking-Connections-client-side)
12
12
 
13
13
  ---
14
14
 
@@ -125,13 +125,16 @@ For `env` parameter, there are 2 accepted values in Skyflow.Env
125
125
  # Securely collecting data client-side
126
126
  - [**Inserting data into the vault**](#inserting-data-into-the-vault)
127
127
  - [**Using Skyflow Elements to collect data**](#using-skyflow-elements-to-collect-data)
128
+ - [**Using validations on Collect Elements**](#validations)
128
129
  - [**Event Listener on Collect Elements**](#event-listener-on-collect-elements)
130
+ - [**UI Error for Collect Eements**](#ui-error-for-collect-elements)
131
+ - [**Set and Clear value for Collect Elements (DEV ENV ONLY)**](#set-and-clear-value-for-collect-elements-dev-env-only)
129
132
  ## Inserting data into the vault
130
133
 
131
134
  To insert data into the vault from the browser, use the `insert(records, options?)` method of the Skyflow client. The `records` parameter takes a JSON object of the records to be inserted in the below format. The `options` parameter takes a dictionary of optional parameters for the insertion. See below:
132
135
 
133
136
  ```javascript
134
- var records = {
137
+ const records = {
135
138
  "records": [
136
139
  {
137
140
  table: "string", //table into which record should be inserted
@@ -144,7 +147,7 @@ var records = {
144
147
  ]
145
148
  }
146
149
 
147
- var options = {
150
+ const options = {
148
151
  tokens: true //indicates whether or not tokens should be returned for the inserted data. Defaults to 'true'
149
152
  }
150
153
 
@@ -199,7 +202,7 @@ const container = skyflowClient.container(Skyflow.ContainerType.COLLECT)
199
202
  A Skyflow collect Element is defined as shown below:
200
203
 
201
204
  ```javascript
202
- var collectElement = {
205
+ const collectElement = {
203
206
  table: "string", //optional, the table this data belongs to
204
207
  column: "string", //optional, the column into which this data should be inserted
205
208
  type: Skyflow.ElementType, //Skyflow.ElementType enum
@@ -208,12 +211,15 @@ var collectElement = {
208
211
  errorTextStyles:{}, //optional styles that will be applied to the errorText of the collect element
209
212
  label: "string", //optional label for the form element
210
213
  placeholder: "string", //optional placeholder for the form element
211
- altText: "string" //optional string that acts as an initial value for the collect element
214
+ altText: "string" //(DEPRECATED) string that acts as an initial value for the collect element
215
+ validations:[] // optional array of validation rules
212
216
  }
213
217
  ```
214
- The `table` and `column` fields indicate which table and column in the vault the Element corresponds to. **Note**:
218
+ The `table` and `column` fields indicate which table and column in the vault the Element corresponds to.
219
+
220
+ **Note**:
215
221
  - Use dot delimited strings to specify columns nested inside JSON fields (e.g. `address.street.line1`)
216
- - `table` and `column` are optional only if the element is being used in invokeGateway()
222
+ - `table` and `column` are optional only if the element is being used in invokeConnection()
217
223
 
218
224
  The `inputStyles` field accepts a style object which consists of CSS properties that should be applied to the form element in the following states:
219
225
  - `base`: all other variants inherit from these styles
@@ -272,16 +278,44 @@ errorTextStyles: {
272
278
  }
273
279
  ```
274
280
 
275
- Finally, the `type` field takes a Skyflow ElementType. Each type applies the appropriate regex and validations to the form element. There are currently 4 types:
281
+ Finally, the `type` field takes a Skyflow ElementType. Each type applies the appropriate regex and validations to the form element. There are currently 5 types:
276
282
  - `CARDHOLDER_NAME`
277
283
  - `CARD_NUMBER`
278
284
  - `EXPIRATION_DATE`
279
285
  - `CVV`
286
+ - `INPUT_FIELD`
287
+ - `PIN`
288
+
289
+ The `INPUT_FIELD` type is a custom UI element without any built-in validations. See the section on [validations](#validations) for more information on validations.
280
290
 
281
- Once the Element object has been defined, add it to the container using the `create(element, options)` method as shown below. The `element` param takes a Skyflow Element object as defined above and the `options` parameter takes a dictionary of optional parameters as described below:
291
+ Along with CollectElement we can define other options which takes a dictionary of optional parameters as described below:
282
292
 
283
293
  ```javascript
284
- var collectElement = {
294
+ const options = {
295
+ required: false, //optional, indicates whether the field is marked as required. Defaults to 'false'
296
+ enableCardIcon: true // optional, indicates whether card icon should be enabled (only applicable for CARD_NUMBER ElementType)
297
+ format: String //optinal, format for the element (only applicable currently for EXPIRATION_DATE ElementType)
298
+ }
299
+ ```
300
+
301
+ `required` parameter indicates whether the field is marked as required or not. If not provided, it defaults to false
302
+
303
+ `enableCardIcon` paramenter indicates whether the icon is visible for the CARD_NUMBER element, defaults to true
304
+
305
+ `format` parameter takes string value and indicates the format pattern applicable to the element type. It is currently applicable to EXPIRATION_DATE element type only, the values that are accepted are
306
+
307
+ - `MM/YY`
308
+ - `MM/YYYY`
309
+ - `YY/MM`
310
+ - `YYYY/MM`
311
+
312
+ `NOTE` : If not specified or invalid value is passed to the format for EXPIRATION_DATE element, then it defaults to MM/YY format.
313
+
314
+
315
+ Once the Element object and options has been defined, add it to the container using the `create(element, options)` method as shown below. The `element` param takes a Skyflow Element object and options as defined above:
316
+
317
+ ```javascript
318
+ const collectElement = {
285
319
  table: "string", //the table this data belongs to
286
320
  column: "string", //the column into which this data should be inserted
287
321
  type: Skyflow.ElementType, //Skyflow.ElementType enum
@@ -290,11 +324,14 @@ var collectElement = {
290
324
  errorTextStyles:{}, //optional styles that will be applied to the errorText of the collect element
291
325
  label: "string", //optional label for the form element
292
326
  placeholder: "string", //optional placeholder for the form element
293
- altText: "string" //optional string that acts as an initial value for the collect element
327
+ altText: "string" //(DEPRECATED) string that acts as an initial value for the collect element
328
+ validations:[] // optional array of validation rules
294
329
  }
295
330
 
296
- var options = {
297
- required: false //indicates whether the field is marked as required. Defaults to 'false'
331
+ const options = {
332
+ required: false, //optional, indicates whether the field is marked as required. Defaults to 'false'
333
+ enableCardIcon: true // optional, indicates whether card icon should be enabled (only applicable for CARD_NUMBER ElementType)
334
+ format: String //optinal, format for the element (only applicable currently for EXPIRATION_DATE ElementType)
298
335
  }
299
336
 
300
337
  const element = container.create(collectElement, options)
@@ -322,7 +359,10 @@ Now, when the `mount(domElement)` method of the Element is called, the Element w
322
359
  ```javascript
323
360
  element.mount("#cardNumber")
324
361
  ```
325
-
362
+ you can use the `unmount` method to reset any collect element to it's initial state.
363
+ ```javascript
364
+ element.unmount();
365
+ ```
326
366
 
327
367
  ### Step 4: Collect data from Elements
328
368
 
@@ -332,7 +372,7 @@ When the form is ready to be submitted, call the `collect(options?)` method on t
332
372
  - `additionalFields`: Non-PCI elements data to be inserted into the vault which should be in the `records` object format as described in the above [Inserting data into vault](#inserting-data-into-the-vault) section.
333
373
 
334
374
  ```javascript
335
- var options = {
375
+ const options = {
336
376
  tokens: true //optional, indicates whether tokens for the collected data should be returned. Defaults to 'true'
337
377
  additionalFields: {
338
378
  records: [
@@ -421,7 +461,126 @@ container.collect({
421
461
  }
422
462
  ```
423
463
 
464
+ ### Validations
465
+
466
+ Skyflow-JS provides two types of validations on Collect Elements
467
+
468
+ #### 1. Default Validations:
469
+ Every Collect Element except of type `INPUT_FIELD` has a set of default validations listed below:
470
+ - `CARD_NUMBER`: Card number validation with checkSum algorithm(Luhn algorithm), available card lengths for defined card types
471
+ - `CARD_HOLDER_NAME`: Name should be 2 or more symbols, valid characters should match pattern - `^([a-zA-Z\\ \\,\\.\\-\\']{2,})$`
472
+ - `CVV`: Card CVV can have 3-4 digits
473
+ - `EXPIRATION_DATE`: Any date starting from current month. By default valid expiration date should be in short year format - `MM/YY`
474
+ - `PIN`: Can have 4-12 digits
475
+
476
+ #### 2. Custom Validations:
477
+ Custom validations can be added to any element which will be checked after the default validations have passed. The following Custom validation rules are currently supported:
478
+ - `REGEX_MATCH_RULE`: You can use this rule to specify any Regular Expression to be matched with the input field value
479
+
480
+ ```javascript
481
+ const regexMatchRule = {
482
+ type: Skyflow.ValidationRuleType.REGEX_MATCH_RULE,
483
+ params: {
484
+ regex: RegExp,
485
+ error: string // optional, default error is "VALIDATION FAILED"
486
+ }
487
+ }
488
+ ```
489
+
490
+ - `LENGTH_MATCH_RULE`: You can use this rule to set the minimum and maximum permissible length of the input field value
424
491
 
492
+ ```javascript
493
+ const lengthMatchRule = {
494
+ type: Skyflow.ValidationRuleType.LENGTH_MATCH_RULE,
495
+ params: {
496
+ min : number, // optional
497
+ max : number, // optional
498
+ error: string // optional, default error is "VALIDATION FAILED"
499
+ }
500
+ }
501
+ ```
502
+
503
+ - `ELEMENT_VALUE_MATCH_RULE`: You can use this rule to match the value of one element with another element
504
+
505
+ ```javascript
506
+ const elementValueMatchRule = {
507
+ type: Skyflow.ValidationRuleType.ELEMENT_VALUE_MATCH_RULE,
508
+ params: {
509
+ element: CollectElement,
510
+ error: string // optional, default error is "VALIDATION FAILED"
511
+ }
512
+ }
513
+ ```
514
+
515
+ The Sample code snippet for using custom validations:
516
+
517
+ ```javascript
518
+ /*
519
+ A simple example that illustrates custom validations.
520
+ Adding REGEX_MATCH_RULE , LENGTH_MATCH_RULE to collect element.
521
+ */
522
+
523
+ // this rule allows 1 or more alphabets
524
+ const alphabetsOnlyRegexRule = {
525
+ type: Skyflow.ValidationRuleType.REGEX_MATCH_RULE,
526
+ params:{
527
+ regex: /^[A-Za-z]+$/,
528
+ error: "Only alphabets are allowed"
529
+ }
530
+ };
531
+
532
+ // this rule allows input length between 4 and 6 characters
533
+ const lengthRule = {
534
+ type: Skyflow.ValidationRuleType.LENGTH_MATCH_RULE,
535
+ params:{
536
+ min: 4,
537
+ max: 6,
538
+ error: "Must be between 4 and 6 alphabets"
539
+ }
540
+ };
541
+
542
+ const cardHolderNameElement = collectContainer.create({
543
+ table: "pii_fields",
544
+ column: "first_name",
545
+ ...collectStylesOptions,
546
+ label: "Card Holder Name",
547
+ placeholder: "cardholder name",
548
+ type: Skyflow.ElementType.INPUT_FIELD,
549
+ validations: [alphabetsOnlyRegexRule, lengthRule]
550
+ });
551
+
552
+ /*
553
+ Reset PIN - A simple example that illustrates custom validations.
554
+ The below code shows an example of ELEMENT_VALUE_MATCH_RULE
555
+ */
556
+
557
+ // for the PIN element
558
+ const pinElement = collectContainer.create({
559
+ label: "PIN",
560
+ placeholder: "****",
561
+ type: Skyflow.ElementType.PIN,
562
+ });
563
+
564
+ // this rule allows to match the value with pinElement
565
+ let elementMatchRule = {
566
+ type: Skyflow.ValidationRuleType.ELEMENT_VALUE_MATCH_RULE,
567
+ params:{
568
+ element: pinElement,
569
+ error: "PIN doesn't match"
570
+ }
571
+ }
572
+ const confirmPinElement = collectContainer.create({
573
+ label: "Confirm PIN",
574
+ placeholder: "****",
575
+ type: Skyflow.ElementType.PIN,
576
+ validations: [elementMatchRule]
577
+ });
578
+
579
+ // mount elements on screen - errors will be shown if any of the validaitons fail
580
+ pinElement.mount("#collectPIN");
581
+ confirmPinElement.mount("#collectConfirmPIN");
582
+
583
+ ```
425
584
  ### Event Listener on Collect Elements
426
585
 
427
586
 
@@ -461,7 +620,7 @@ values of SkyflowElements will be returned in elementstate object only when `env
461
620
 
462
621
  ##### Sample code snippet for using listeners
463
622
  ```javascript
464
- //create skyflow client with loglevel:"DEBUG"
623
+ //create skyflow client
465
624
  const skyflowClient = Skyflow.init({
466
625
  vaultID: <VAULT_ID>,
467
626
  vaultURL: <VAULT_URL>,
@@ -511,12 +670,70 @@ cardNumber.on(Skyflow.EventName.CHANGE,(state) => {
511
670
  }
512
671
  ```
513
672
 
673
+ ### UI Error for Collect Elements
674
+
675
+ Helps to display custom error messages on the Skyflow Elements through the methods `setError` and `resetError` on the elements.
676
+
677
+ `setError(error: string)` method is used to set the error text for the element, when this method is trigerred, all the current errors present on the element will be overridden with the custom error message passed. This error will be displayed on the element until `resetError()` is trigerred on the same element.
678
+
679
+ `resetError()` method is used to clear the custom error message that is set using `setError`.
680
+
681
+ ##### Sample code snippet for setError and resetError
682
+
683
+ ```javascript
684
+
685
+ const container = skyflowClient.container(Skyflow.ContainerType.COLLECT)
686
+
687
+ const cardNumber = container.create({
688
+ table: "pii_fields",
689
+ column: "primary_card.card_number",
690
+ type: Skyflow.ElementType.CARD_NUMBER,
691
+ });
692
+
693
+ //Set custom error
694
+ cardNumber.setError("custom error");
695
+
696
+ //reset custom error
697
+ cardNumber.resetError();
698
+
699
+ ```
700
+
701
+ ### Set and Clear value for Collect Elements (DEV ENV ONLY)
702
+
703
+ `setValue(value: string)` method is used to set the value of the element. This method will override any previous value present in the element.
704
+
705
+ `clearValue()` method is used to reset the value of the element.
706
+
707
+ `Note:` This methods are only available in DEV env for testing/developmental purposes and MUST NOT be used in PROD env.
708
+
709
+ ##### Sample code snippet for setValue and clearValue
710
+
711
+ ```javascript
712
+ const container = skyflowClient.container(Skyflow.ContainerType.COLLECT)
713
+
714
+ const cardNumber = container.create({
715
+ table: "pii_fields",
716
+ column: "primary_card.card_number",
717
+ type: Skyflow.ElementType.CARD_NUMBER,
718
+ });
719
+
720
+ // Set a value programatically
721
+ cardNumber.setValue("4111111111111111");
722
+
723
+ // Clear the value
724
+ cardNumber.clearValue();
725
+
726
+ ```
727
+
514
728
  ---
515
729
 
516
730
 
517
731
  # Securely revealing data client-side
518
732
  - [**Retrieving data from the vault**](#retrieving-data-from-the-vault)
519
733
  - [**Using Skyflow Elements to reveal data**](#using-skyflow-elements-to-reveal-data)
734
+ - [**UI Error for Reveal Elements**](#ui-error-for-reveal-elements)
735
+ - [**Set token for Reveal Elements**](#set-token-for-reveal-elements)
736
+ - [**Set and clear altText for Reveal Elements**](#set-and-clear-alttext-for-reveal-elements)
520
737
 
521
738
  ## Retrieving data from the vault
522
739
 
@@ -526,7 +743,7 @@ For non-PCI use-cases, retrieving data from the vault and revealing it in the br
526
743
  For retrieving using tokens, use the `detokenize(records)` method. The records parameter takes a JSON object that contains `records` to be fetched as shown below.
527
744
 
528
745
  ```javascript
529
- var records = {
746
+ const records = {
530
747
  "records": [
531
748
  {
532
749
  token: "string", // token for the record to be fetched
@@ -645,17 +862,17 @@ const container = skyflowClient.container(Skyflow.ContainerType.REVEAL)
645
862
  Then define a Skyflow Element to reveal data as shown below.
646
863
 
647
864
  ```javascript
648
- var revealElement = {
865
+ const revealElement = {
649
866
  token: "string", //optional, token of the data being revealed
650
867
  inputStyles: {}, //optional styles to be applied to the element
651
868
  labelStyles: {}, //optional, styles to be applied to the label of the reveal element
652
869
  errorTextStyles: {}, //optional styles that will be applied to the errorText of the reveal element
653
- label: "string", //label for the form element
870
+ label: "string", //optional, label for the form element
654
871
  altText: "string" //optional, string that is shown before reveal, will show token if altText is not provided
655
872
  }
656
873
  ```
657
874
  `Note`:
658
- - `token` is optional only if it is being used in invokeGateway()
875
+ - `token` is optional only if it is being used in invokeConnection()
659
876
 
660
877
  The `inputStyles`, `labelStyles` and `errorTextStyles` parameters accepts a styles object as described in the [previous section](#step-2-create-a-collect-element) for collecting data but only a single variant is available i.e. base.
661
878
 
@@ -693,7 +910,7 @@ errorTextStyles: {
693
910
  Once you've defined a Skyflow Element, you can use the `create(element)` method of the container to create the Element as shown below:
694
911
 
695
912
  ```javascript
696
- const element = container.create(revealElement, options={})
913
+ const element = container.create(revealElement)
697
914
  ```
698
915
 
699
916
  ### Step 3: Mount Elements to the DOM
@@ -792,12 +1009,71 @@ The response below shows that some tokens assigned to the reveal elements get re
792
1009
  }
793
1010
  ```
794
1011
 
795
- # Securely invoking gateway client-side
796
- Using Skyflow gateway, end-user applications can integrate checkout/card issuance flow without any of their apps/systems touching the PCI compliant fields like cvv, card number. To invoke gateway, use the `invokeGateway(gatewayConfig)` method of the Skyflow client.
1012
+ ### UI Error for Reveal Elements
1013
+ Helps to display custom error messages on the Skyflow Elements through the methods `setError` and `resetError` on the elements.
1014
+
1015
+ `setError(error: string)` method is used to set the error text for the element, when this method is trigerred, all the current errors present on the element will be overridden with the custom error message passed. This error will be displayed on the element until `resetError()` is trigerred on the same element.
1016
+
1017
+ `resetError()` method is used to clear the custom error message that is set using `setError`.
1018
+
1019
+ ##### Sample code snippet for setError and resetError
1020
+
1021
+ ```javascript
1022
+
1023
+ const container = skyflowClient.container(Skyflow.ContainerType.REVEAL)
1024
+
1025
+ const cardNumber = container.create({
1026
+ token: "89024714-6a26-4256-b9d4-55ad69aa4047",
1027
+ });
1028
+
1029
+ //Set custom error
1030
+ cardNumber.setError("custom error");
1031
+
1032
+ //reset custom error
1033
+ cardNumber.resetError();
1034
+
1035
+ ```
1036
+ ### Set token for Reveal Elements
1037
+
1038
+ The `setToken(value: string)` method can be used to set the token of the Reveal Element. If no altText is set, the set token will be displayed on the UI as well. If altText is set, then there will be no change in the UI but the token of the element will be internally updated.
1039
+
1040
+ ##### Sample code snippet for setToken
1041
+ ```javascript
1042
+ const container = skyflowClient.container(Skyflow.ContainerType.REVEAL)
1043
+
1044
+ const cardNumber = container.create({
1045
+ altText:"Card Number",
1046
+ });
1047
+
1048
+ // set token
1049
+ cardNumber.setToken("89024714-6a26-4256-b9d4-55ad69aa4047");
1050
+
1051
+ ```
1052
+ ### Set and Clear altText for Reveal Elements
1053
+ The `setAltText(value: string)` method can be used to set the altText of the Reveal Element. This will cause the altText to be displayed in the UI regardless of whether the token or value is currently being displayed.
1054
+
1055
+ `clearAltText()` method can be used to clear the altText, this will cause the element to display the token or actual value of the element. If the element has no token, the element will be empty.
1056
+ ##### Sample code snippet for setAltText and clearAltText
1057
+
1058
+ ```javascript
1059
+ const container = skyflowClient.container(Skyflow.ContainerType.REVEAL)
1060
+
1061
+ const cardNumber = container.create({
1062
+ token:"89024714-6a26-4256-b9d4-55ad69aa4047",
1063
+ });
1064
+
1065
+ // set altText
1066
+ cardNumber.setAltText("Card Number");
1067
+
1068
+ //clear altText
1069
+ cardNumber.clearAltText();
1070
+ ```
1071
+ # Securely invoking Connections client-side
1072
+ Using Skyflow Connections, end-user applications can integrate checkout/card issuance flow without any of their apps/systems touching the PCI compliant fields like cvv, card number. To invoke Connections, use the `invokeConnection(connectionConfig)` method of the Skyflow client.
797
1073
 
798
1074
  ```javascript
799
- const gatewayConfig = {
800
- gatewayURL: string, // gateway url recevied when creating a skyflow gateway integration
1075
+ const connectionConfig = {
1076
+ connectionURL: string, // connection url recevied when creating a skyflow Connection integration
801
1077
  methodName: Skyflow.RequestMethod,
802
1078
  pathParams: any, // optional
803
1079
  queryParams: any, // optional
@@ -806,7 +1082,7 @@ const gatewayConfig = {
806
1082
  responseBody: any // optional
807
1083
  }
808
1084
 
809
- const response = skyflowClient.invokeGateway(gatewayConfig);
1085
+ const response = skyflowClient.invokeConnection(connectionConfig);
810
1086
  ```
811
1087
  `methodName` supports the following methods:
812
1088
 
@@ -816,14 +1092,14 @@ const response = skyflowClient.invokeGateway(gatewayConfig);
816
1092
  - PATCH
817
1093
  - DELETE
818
1094
 
819
- **pathParams, queryParams, requestHeader, requestBody** are the JSON objects that will be sent through the gateway integration url.
1095
+ **pathParams, queryParams, requestHeader, requestBody** are the JSON objects that will be sent through the Connection integration url.
820
1096
 
821
1097
  The values in the above parameters can contain collect elements, reveal elements or actual values. When elements are provided inplace of values, they get replaced with the value entered in the collect elements or value present in the reveal elements
822
1098
 
823
1099
  **responseBody**:
824
1100
  It is a JSON object that specifies where to render the response in the UI. The values in the responseBody can contain collect elements or reveal elements.
825
1101
 
826
- Sample use-cases on using invokeGateway():
1102
+ Sample use-cases on using invokeConnection():
827
1103
 
828
1104
  ### Sample use-case 1:
829
1105
 
@@ -832,8 +1108,6 @@ Merchant acceptance - customers should be able to complete payment checkout with
832
1108
  ```javascript
833
1109
  // step 1
834
1110
  const skyflowClient = skyflow.init({
835
- vaultID: <vault_Id>,
836
- vaultURL: <vault_url>,
837
1111
  getBearerToken: <helperFunc>
838
1112
  });
839
1113
 
@@ -852,8 +1126,8 @@ const cvvElement = collectContainer.create({
852
1126
  cvvElement.mount("#cvv")
853
1127
 
854
1128
  // step 4
855
- const gatewayConfig = {
856
- gatewayURL: "https://area51.gateway.skyflow.com/v1/gateway/inboundRoutes/abc-1213/v2/pay”,
1129
+ const connectionConfig = {
1130
+ connectionURL: <connection_url>,
857
1131
  methodName: Skyflow.RequestMethod.POST,
858
1132
  requestBody: {
859
1133
  card_number: cardNumberElement, //it can be skyflow element(collect or reveal) or actual value
@@ -861,7 +1135,7 @@ const gatewayConfig = {
861
1135
  }
862
1136
  }
863
1137
 
864
- const response = skyflowClient.invokeGateway(gatewayConfig);
1138
+ const response = skyflowClient.invokeConnection(connectionConfig);
865
1139
  ```
866
1140
 
867
1141
  Sample Response:
@@ -875,7 +1149,7 @@ In the above example, CVV is being collected from the user input at the time of
875
1149
 
876
1150
  `Note:`
877
1151
  - card_number can be either container element or plain text value (tokens or actual value)
878
- - `table` and `column` names are not required for creating collect element, if it is used for invokeGateway method, since they will not be stored in the vault
1152
+ - `table` and `column` names are not required for creating collect element, if it is used for invokeConnection method, since they will not be stored in the vault
879
1153
 
880
1154
  ### Sample use-case 2:
881
1155
 
@@ -883,8 +1157,6 @@ In the above example, CVV is being collected from the user input at the time of
883
1157
  ```javascript
884
1158
  // step 1
885
1159
  const skyflowClient = skyflow.init({
886
- vaultID: <vault_Id>,
887
- vaultURL: <vault_url>,
888
1160
  getBearerToken: <helperFunc>
889
1161
  });
890
1162
 
@@ -904,8 +1176,8 @@ const expiryDateElement = collectContainer.create({
904
1176
  expiryDateElement.mount("#expirationDate")
905
1177
 
906
1178
  //step 4
907
- const gatewayConfig = {
908
- gatewayURL: "https://area51.gateway.skyflow.com/v1/gateway/inboundRoutes/abc-1213/cards/{card_number}/cvv2generation",
1179
+ const connectionConfig = {
1180
+ connectionURL: <connection_url>,
909
1181
  methodName: Skyflow.RequestMethod.POST,
910
1182
  pathParams: {
911
1183
  card_number: "0905-8672-0773-0628" //it can be skyflow element(collect/reveal) or token or actual value
@@ -915,13 +1187,13 @@ const gatewayConfig = {
915
1187
  },
916
1188
  responseBody: {
917
1189
  resource: {
918
- cvv2: cvvElement // pass the element where the cvv response from the gateway will be mounted
1190
+ cvv2: cvvElement // pass the element where the cvv response from the Connection will be mounted
919
1191
  }
920
1192
  }
921
1193
  }
922
1194
  }
923
1195
 
924
- const response = skyflowClient.invokeGateway(gatewayConfig);
1196
+ const response = skyflowClient.invokeConnection(connectionConfig);
925
1197
  ```
926
1198
 
927
1199
  Sample Response:
@@ -933,5 +1205,5 @@ Sample Response:
933
1205
  ```
934
1206
 
935
1207
  `Note`:
936
- - `token` is optional for creating reveal element, if it is used for invokeGateway
937
- - responseBody contains collect or reveal elements to render the response from the gateway on UI
1208
+ - `token` is optional for creating reveal element, if it is used for invokeConnection
1209
+ - responseBody contains collect or reveal elements to render the response from the Connection on UI