VGS Collect
Description
VGS Collect is a way to securely collect sensitive data without going through your systems. If you want to know more about VGS, you can access this link: https://www.verygoodsecurity.com/docs/vgs-collect/js/

How to use it?
How to use it?
Import the VgsCollectForm
into your file:
import {VgsCollectForm} from 'LinkerStudio/modules/VgsCollect/components/organisms';
Import useVgsCollect
into your file:
import {useVgsCollect} from 'LinkerStudio/modules/Vault/vgs/hooks';
Import VGS_COLLECT_CONFIG
into your file:
import { VGS_COLLECT_CONFIG } from 'LinkerStudio/modules/Vault/vgs/constants';
Import FieldsTypes
and ValidationsTypes
into your file:
import {
FieldsTypes,
ValidationsTypes,
} from 'LinkerStudio/modules/Vault/vgs/utils';
Use the VgsCollectForm component and useVgsCollect custom hook in your file:
const vgsCollect = useVgsCollect();
const {webviewRef,handleEmptyValues,handleOnError,vgsResponse } = vgsCollect;
Use the VgsCollectForm component and useVgsCollect custom hook in your file:
const vgsCollect = useVgsCollect();
const {webviewRef,handleEmptyValues,handleOnError,vgsResponse } = vgsCollect;
<VgsCollectForm
webviewRef={webviewRef}
vgsResponse={res => vgsResponse({ ...res})}
formFields={[
{
name: <field name>,
type: FieldsTypes.<field type>,
validations: [ValidationsTypes.<validation type>],
label: <field label>,
disabled: '',
hideValue: false,
}
] as Fields[]
}
vgsCollectConfig={
{
...VGS_COLLECT_CONFIG,
path: <your path>, // example: /vault/save
options: {
...VGS_COLLECT_CONFIG.options,
data: <object>,
},
} as VgsCollectConfig
}
onError={res =>handleOnError({...res})}
setEmptyValues={handleEmptyValues}
clearInputs={true}
/>
Props Description
webviewRef: ref of type webView.
vgsResponse: event executed when a request is made to VGS, and returns status and tokenized data in response.
formFields: array to define the form fields within the webview.
vgsCollectConfig: inbound HTTP Routes configuration of VGS. For more information https://www.verygoodsecurity.com/docs/api/collect/#api-formsubmit.
onError: runs when an error occurs in VGS.
setEmptyValues: event to handle empty values.
clearInputs: boolean value to clear all form inputs after submit.
Last updated
Was this helpful?