@bot.message_handler(commands=['buy'])
def category(message):
msg = bot.send_message(message.chat.id, text='Выберите категорию!', reply_markup=markup)
bot.register_next_step_handler(msg, choose)
def choose(message):
purchase.name = message.text
print(purchase.name)
cursor.execute(f"SELECT price FROM adminTG_category WHERE name =?", (purchase.name,))
purchase.price = cursor.fetchone()
msg = bot.send_message(message.chat.id, text='Введите количество аккаунтов, сколько хотите купить')
bot.register_next_step_handler(msg, buy)
def buy(message):
purchase.count = message.text
try:
merchant_key = "888"
merchant_account = "888"
merchant_domain_name = "888"
currency = "UAH"
count = purchase.count
productName = purchase.name
productPrice = purchase.price
amount = count * productPrice
ordernew = str(random.randrange(0, 99999))
order_date = int(datetime.now().replace(tzinfo=timezone.utc).timestamp())
order = ordernew + "5"
signature_data = f"***;{order};{order_date};{amount};{currency};{productName};{count};{productPrice}"
signature = generate_signature(merchant_key, signature_data)
params = {
'transactionType': "CREATE_INVOICE",
'merchantAccount': merchant_account,
'merchantDomainName': merchant_domain_name,
'merchantSignature': signature,
'apiVersion': 1,
'orderReference': order,
'orderDate': order_date,
'amount': amount,
'currency': currency,
'productName': [productName],
'productPrice': [productPrice],
'productCount': [count]
}
при выполнении sql, ничего не происходит, выводит purchase.name
и останавливается, проблема я так понимаю в sql запросе