Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bienpx224 opened this issue Jul 9, 2024 · 1 comment

Comments

@bienpx224
Copy link

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.

@toriqahmads
Copy link

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`);
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants