简体   繁体   中英

How to make handler for messages from Stripe using Aiogram(Python)?

Is this possible to make handler for receiving messages by Telegram Bot from Stripe, when I create new product in Stripe store(account). I use Aiogram. I want to do something similar to this:

@dp.message_handler()
@dp.async_task
async def get_stripe_messages(request: types.StripeEvent):
    if request["type"] == "product.created":
         print("New product was added in Stripe store!")

Can aiogram Dispatcher handle message with type something like StripeEvent type. Or I can do this only using web-framework, for example, Flask app - as the Stripe documentation says: https://stripe.com/docs/webhooks

Aiogram is the library only for telegram bots, to work with Stripe webhook, it's better to use frameworks such as Aiohttp, Flask, or Django. Aiogram can't work with Stripe webhook.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM