Question: Get Invoice Details or Verify Invoice Status
svscorp opened this issue · 4 comments
Hi @PaulSonOfLars,
I am using the CreateInvoiceLink, and I know that in case of using bot, when it's paid - bot receives an update from Telegram.
In case something happened and bot missed the update... How do I verify invoice (i.e. by invoice id, that is generated via CreateInvoiceLink)
So, I actually didn't know this one, so thanks for the question!
The answer is yes, there is; but it's not a very clear pathway; you can't directly get by invoice_id, you have to iterate through a list of transactions and get it from there.
- You can use
getStarsTransactions
to get a list of transactions. - Each incoming transaction will have a source
TransactionPartner
- If that source is a user, that comes with an invoice_payload, which (according to the docs) should be your payload
There's also some validation that can be done with precheckout queries to prepare for the incoming transaction but that doesn't handle the issue youre mentioning :)
@PaulSonOfLars I thought of stars. The question is what to do with fiat payments :D
For stars I believe they will improve to not iterate in future.
Aha - for fiat payments, you'll have to do something through the providers themselves.
To be honest, if you're using fiat providers, I wouldn't use telegrams integrations; they're half baked abstractions that were added and never improved (until stars came along). I would use a webapp and load the provider directly instead. But that's just my 2c :)
Ok, got you. So far TG implementation didn't let me down with fiat using bot :) I figured out, actually, if you do fiat via webapp TG integration, what it does (surprise) it sends the BOT webhook the payment success callback :)
So it was the right decision to do what I was asking about in another ticket, that is finding a way to launch both webapp and webhook implementation together.
Alright. Thanks again, @PaulSonOfLars .