Open sojinsamuel opened 3 months ago
Hi. Have you solved it?
no, I havent worked on it for a while and stripe doesnt work on india anymore. will you lmk if you find a solution
On Tue, Jun 4, 2024 at 5:55 PM qniwerss @.***> wrote:
Hi. Have you solved it?
— Reply to this email directly, view it on GitHub https://github.com/yagop/node-telegram-bot-api/issues/1187#issuecomment-2147406969, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASM4GGBZPSY5YPLROQVBKNLZFWW37AVCNFSM6AAAAABFR32QZ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBXGQYDMOJWHE . You are receiving this because you authored the thread.Message ID: @.***>
Yes, it is related to pre_checkout_query. So after client clicks Pay button, some pre checkout query is sent to your bot. You need to handle responding to this query, and everything will be ok.
Yes, it is related to pre_checkout_query. So after client clicks Pay button, some pre checkout query is sent to your bot. You need to handle responding to this query, and everything will be ok.
bot.on("pre_checkout_query", async (query) => {
console.log("Received pre-checkout query:", query);
// Answer the pre-checkout query within 10 seconds more info: https://core.telegram.org/bots/api#answerprecheckoutquery
const preCheckoutQueryAnswer = await bot.answerPreCheckoutQuery(
query.id,
true
);
console.log("Pre-checkout query answer:", preCheckoutQueryAnswer);
});
But i didnt get any payload after clicking on pay button, is it possible to share any code snippets for this issue or an update. anyways thanks a lot for contributing to the conversation :smiley:
in python my handler looks like this
@dp.pre_checkout_query()
async def pre_checkout_query_handler(pre_checkout_query: types.pre_checkout_query):
await bot.answer_pre_checkout_query(pre_checkout_query.id, ok=True)
i've built a telegram bot using nodejs that downloads videos from tweet urls. Completed that part. now, Iim struggling to implement a paywall using the
sendInvoice
method in the Telegram API.https://core.telegram.org/bots/api#sendinvoice
i'm using Stripe for payments in test mode. however, after sending the invoice, when users try to pay, it buffers and times out as in the image.
Question i asked on stackoverflow (my version 1 code without using any external libs for the bot): https://stackoverflow.com/questions/78251916/stripe-pre-checkout-timeout-error-while-making-a-test-payment-from-telegram-bot
Not sure what was wrong there at the first time; i did find this similar problem on stackoverflow: https://stackoverflow.com/questions/73341054/telegram-sendinvoice-method-is-failing
Which i almost thought i solved it, but i am not even receiving the
update
object as explained here https://core.telegram.org/bots/api#answershippingquerySo finally to implement what's being said and to make things simple i started to use this library
node-telegram-bot-api
(previously used rest api from telegram)Even after making the changes suggested from the docs and on the similar stackoverflow solution above.
I have come to this (an abstracted version 2 of my source code):
Still the same problem. Tried other payment provider too no luck.
Can anyone help me out please.