Connect client-to-cash
into any application.
Build real-time provisioning pipelines. When a proposal is signed or invoice paid, dispatch authenticated webhooks to unlock access, create repositories, and alert your team.
// Verify Payeny-Signature: t=<unix>,v1=<hmac>
const crypto = require('crypto');
app.post('/payeny-webhook', (req, res) => {
const sigHeader = req.headers['payeny-signature'] || '';
const entries = sigHeader
.split(',')
.map(p => p.trim().split('='));
const parts = Object.fromEntries(entries);
const expected = crypto
.createHmac('sha256', process.env.PAYENY_WEBHOOK_SECRET)
.update(`${parts.t}.${req.rawBody}`)
.digest('hex');
if (parts.v1 !== expected) {
return res.status(400).send('Bad Signature');
}
const { type, data } = JSON.parse(req.rawBody);
if (type === 'checkout.completed' || type === 'invoice.paid') {
provisionClientWorkspace(data.object.customer_id);
}
res.json({ received: true });
});