-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Pre-Checkout Timeout Error while making a Payment #1187
Comments
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
<#1187 (comment)>,
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. |
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 😃 |
in python my handler looks like this
|
how can i achieve this using api calls, im not using any sdk, i generated a payment link using /createInvoiceLink, but when i try to pay it times out |
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 herehttps://core.telegram.org/bots/api#answershippingquery
So 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.
The text was updated successfully, but these errors were encountered: