import telebot
from telebot import types
@tb.message_handler(commands=['pay'])
def pay(message):
tb.send_invoice(message.chat.id, title='Test title', description='Test description', invoice_payload='test', provider_token='xxx:TEST:xxx', currency='RUB', prices=[types.LabeledPrice('RUB', PRICE)])
def preCheckoutHandler(preCheckoutQuery:types.PreCheckoutQuery):
tb.answer_pre_checkout_query(preCheckoutQuery.id, ok=True)
def successPayment(message):
tb.message_handler(content_types=['successful_payment'])
After sending a request to "pay" there is a long download, and then shows the window with the error "error occurred while processing the payment. The money from the card has not been written off".