node-telegram-bot-api icon indicating copy to clipboard operation
node-telegram-bot-api copied to clipboard

Add to sendInvoice start_parameter

Open TarasiukDima opened this issue 1 year ago • 1 comments

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.

TarasiukDima avatar Mar 31 '24 07:03 TarasiukDima

@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

sojinsamuel avatar Apr 01 '24 16:04 sojinsamuel

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' })

danielperez9430 avatar May 04 '24 14:05 danielperez9430