import { Composer } from "https://deno.land/x/grammy@v1.30.1/mod.ts";
Registers middleware for pre-checkout queries. Telegram sends a pre-checkout query to your bot whenever a user has confirmed their payment and shipping details. You bot will then receive all information about the order and has to respond within 10 seconds with a confirmation of whether everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Check out https://core.telegram.org/bots/api#precheckoutquery to read more about pre-checkout queries.
bot.preCheckoutQuery('invoice_payload', async ctx => {
// Answer the pre-checkout query, confer https://core.telegram.org/bots/api#answerprecheckoutquery
await ctx.answerPreCheckoutQuery( ... )
})