πͺWebhooks
Handling Webhook Notifications
{
"tkn": "unique_transaction_identifier",
"merchantid": "your_merchant_id",
"status": "OK" // or "FAIL"
}Receiving and Processing Webhook Data
app.post('/your-webhook-endpoint', async (req, res) => {
const { tkn, merchantid, status } = req.body;
if(status === 'OK') {
// Handle successful transaction
// Update your database, send confirmation emails, etc.
} else {
// Handle failed transaction
// Log the error, inform the customer, etc.
}
res.status(200).send('Webhook received');
});Conclusion
Last updated