After sending sendInvoice to user(user get this pay form correctly) my bot is not receive preCheckoutQuery for payment confirmation.
Im trying to receiving Updates (specifically preCheckoutQuery) from Telegram Bot via webhook, but here :
dev.botframework.com -> My bots -> Telegram -> Health column -> Issue -> “There was an error sending this message to your bot: HTTP status code BadRequest”.
Also, when i trying to set webhook on dev.botframework.com for my own bot and checking getWebhookInfo i get specific url like this :
{"ok":true,"result":{"url":"https://telegram.botframework.com/api/telegram/XXX/XXX","has_custom_certificate":false,"pending_update_count":0,"max_connections":40}}
With this webhook my bot messaging with user correctly
Some info how to receive correctly preCheckoutQuery?
Additional info :
/getWebhookInfo return me sometimes pending_update_count”:1
Library : Telegram.Bot (https://github.com/TelegramBots/telegram.bot)
My bot support TLS 1.2 :
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
My controller receving nothing
[Route("api/[controller]")]
public class UpdateController : Controller
{
private readonly IBotFrameworkHttpAdapter Adapter;
private readonly IBot Bot;
public UpdateController(IBotFrameworkHttpAdapter adapter, IBot bot)
{
Adapter = adapter;
Bot = bot;
}
[HttpPost]
public async Task<IActionResult> Post([FromBody]Update _update)
{
...
await Consts.BotClient.SendTextMessageAsync(chatId, string.Format("Update receivednP: {0} M: {1} H: {2}", a.Path, a.Method, a.Host.Value));
...
}
}
2
Answers
From the linked GitHub issue:
This means your bot cannot use ABS endpoints if you want
preCheckoutQuery
to work.To get "preCheckoutQuery" I did the following:
It turns out something like "web hook proxy"