Skip to main content

Customer Data Verification

Introduction

The Customer Data Verification module provides features for managing customer data verification operations for specific customer attributes such as email addresses and mobile numbers.

Customer Data Verification Service

The CustomerDataVerificationService can be used for managing customer data verification related operations.

Initiate data verification process

Initiates a verification process for a specific customer attribute, such as email or phone. Returns CustomerDataVerificationResponse details.

import { Wallet } from '@paysafe/paysafe-wallet-saas-web/wallet';
import {
CustomerDataVerificationRequest,
CustomerDataVerificationAttributeType,
CustomerDataVerificationFlow
} from '@paysafe/paysafe-wallet-saas-web/customer-data-verification';

const verificationRequest: CustomerDataVerificationRequest = {
attribute: {
type: CustomerDataVerificationAttributeType.EMAIL,
value: 'customer@example.com'
},
flow: CustomerDataVerificationFlow.WALLET_SETUP
};

Wallet.getInstance().getCustomerDataVerificationService().initiateDataVerificationProcess(verificationRequest)
.then(response => console.log('Verification process initiated', response))
.catch(error => console.error('Error initiating verification', error));

Submit data verification attempt

Submits a verification attempt for a specific customer attribute tied to an already initiated verification process. Returns CustomerDataVerificationAttemptResponse details.

import { Wallet } from '@paysafe/paysafe-wallet-saas-web/wallet';
import {
CustomerDataVerificationAttemptRequest,
CustomerDataVerificationAttributeType,
CustomerDataVerificationNotificationMethod,
CustomerDataVerificationNotificationChannel
} from '@paysafe/paysafe-wallet-saas-web/customer-data-verification';

// The verification ID comes from the CustomerDataVerificationResponse
// when initiating the verification process
const verificationId = customerDataVerificationResponse.verificationId;

const attemptRequest: CustomerDataVerificationAttemptRequest = {
attribute: {
type: CustomerDataVerificationAttributeType.EMAIL,
value: 'customer@example.com'
},
notificationType: {
method: CustomerDataVerificationNotificationMethod.OTP,
channel: CustomerDataVerificationNotificationChannel.EMAIL
},
value: '123456'
};

Wallet.getInstance().getCustomerDataVerificationService().submitDataVerificationAttempt(verificationId, attemptRequest)
.then(response => console.log('Verification attempt submitted', response))
.catch(error => console.error('Error submitting verification attempt', error));