yagop / node-telegram-bot-api

Telegram Bot API for NodeJS
MIT License
8.34k stars 1.52k forks source link

Add to sendInvoice start_parameter #1185

Closed TarasiukDima closed 5 months ago

TarasiukDima commented 6 months ago

Feature Request

In method sendInvoice not exist start_parameter. Because of this, after payment, the customer cannot see the receipt and can re-pay for the order. This is not suitable for stores with dynamically generated orders.

sojinsamuel commented 6 months ago

@TarasiukDima i dont how to resolve your issue, i am also having some issues with the payment part too, but some steps behind you. can you check this issue #1187 i raised may be you could help

danielperez9430 commented 5 months ago

The start_parameter is a optional value, so all optionals values need to be send as object in the last param "form"

This is the method signature:

 sendInvoice(chatId, title, description, payload, providerToken, currency, prices, form = {})

Example:

const title = 'Invoice link product';
const description = 'Our test invoice link product';
const payload = 'sku-p002';
const providerToken = 'XXXXXX';
const currency = 'EUR';
const prices = [{ label: 'NTBA API', amount: 12000 }, { label: 'tax', amount: 10000 }];

bot.sendInvoice(chatId, title, description, payload, providerToken, currency, prices, { start_parameter: 'XXXX' })