app.post('/webhook/user-kyc-finished-notification', async (req, res) => {
try {
const userKYCFinishedNotification = req.body;
// Process the user KYC finished notification data
await processUserKYCFinishedNotification(userKYCFinishedNotification);
// Respond with success
res.status(200).json({ status: 'success' });
} catch (error) {
console.error('Error processing user KYC finished notification:', error);
res.status(500).json({ status: 'error', message: error.message });
}
});
async function processUserKYCFinishedNotification(userKYCFinishedNotification) {
// Validate the user KYC finished notification
console.log(`Processing user KYC finished notification: ${userKYCFinishedNotification.id}`);
console.log(`Status: ${userKYCFinishedNotification.kycStatus}`);
// Process the user KYC finished notification
console.log(`User ID: ${userKYCFinishedNotification.userId}`);
console.log(`External ID: ${userKYCFinishedNotification.externalId}`);
}