Sends payment events as readable messages to Slack, Discord, Telegram or your own channel (email, SMS...). Messages are sent in the background: a failing channel is reported to onError and never affects the payment.
onError
import { notifications } from 'better-payment/plugins';notifications({ locale: 'tr', channels: [ { type: 'slack', webhookUrl: process.env.SLACK_WEBHOOK!, events: ['payment.succeeded'] }, { type: 'telegram', botToken: process.env.TG_TOKEN!, chatId: '123' }, ],}); Copy
import { notifications } from 'better-payment/plugins';notifications({ locale: 'tr', channels: [ { type: 'slack', webhookUrl: process.env.SLACK_WEBHOOK!, events: ['payment.succeeded'] }, { type: 'telegram', botToken: process.env.TG_TOKEN!, chatId: '123' }, ],});
Sends payment events as readable messages to Slack, Discord, Telegram or your own channel (email, SMS...). Messages are sent in the background: a failing channel is reported to
onErrorand never affects the payment.