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

Telegrambot don't have refund function (not exist refundStarPayment method)

Open bienpx224 opened this issue 2 years ago • 2 comments

I'm using "node-telegram-bot-api": "^0.66.0"

The TelegramBot don't have refundStarPayment method. How could I implement refund function in Telegram Bot.

bienpx224 avatar Jul 09 '24 06:07 bienpx224

Hi, thanks for opening the issue

Looks like already implemented but not published yet. Currently you can use like this for processing the refund.

this.bot.onText(/^\/refund(\s)(.*)/, async (msg, match) => {
  console.log("refund", msg, match);

  const form = {
     user_id: msg.from.id,
     telegram_payment_charge_id: match[2]
  }
      
  // @ts-ignore
  const refund = await this.bot._request('refundStarPayment', { form });
  this.bot.sendMessage(msg.chat.id, `your payment has been refunded`);
});

toriqahmads avatar Sep 19 '24 04:09 toriqahmads

Actually release this bot api update.

danielperez9430 avatar Mar 15 '26 19:03 danielperez9430