From 55ed11dbd2d91cfea8f3ce574fea609e1541a4ba Mon Sep 17 00:00:00 2001 From: Suren Khorenyan Date: Sat, 17 Feb 2018 20:41:55 +0300 Subject: [PATCH] Slightly improved payments example --- examples/payments.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/payments.py b/examples/payments.py index 997d7057..74b78456 100644 --- a/examples/payments.py +++ b/examples/payments.py @@ -2,8 +2,10 @@ import asyncio from aiogram import Bot from aiogram import types -from aiogram.dispatcher import Dispatcher from aiogram.utils import executor +from aiogram.dispatcher import Dispatcher +from aiogram.types.message import ContentType + BOT_TOKEN = 'BOT TOKEN HERE' PAYMENTS_PROVIDER_TOKEN = '123456789:TEST:1234567890abcdef1234567890abcdef' @@ -84,7 +86,7 @@ async def checkout(pre_checkout_query: types.PreCheckoutQuery): " try to pay again in a few minutes, we need a small rest.") -@dp.message_handler(content_types=['successful_payment']) +@dp.message_handler(content_types=ContentType.SUCCESSFUL_PAYMENT) async def got_payment(message: types.Message): await bot.send_message(message.chat.id, 'Hoooooray! Thanks for payment! We will proceed your order for `{} {}`'