import { Composer } from "https://dotland.deno.dev/x/grammy@v1.31.0/composer.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( ... )
})