You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C:\Users\Admin\PycharmProjects\paying\main.py:57: DeprecationWarning: The SafeConfigParser class has been renamed to ConfigParser in Python 3.2. This alias will be removed in future versions. Use ConfigParser di
rectly instead.
parser = SafeConfigParser()
No 'buyer_email' set! If you cannot obtain the buyer's email and want to handle refunds on your own you can use your own email instead.
Traceback (most recent call last):
File "C:\Users\Admin\PycharmProjects\paying\main.py", line 97, in <module>
bot.polling()
File "C:\Python310\lib\site-packages\telebot\__init__.py", line 658, in polling
self.__threaded_polling(non_stop, interval, timeout, long_polling_timeout, allowed_updates)
File "C:\Python310\lib\site-packages\telebot\__init__.py", line 720, in __threaded_polling
raise e
File "C:\Python310\lib\site-packages\telebot\__init__.py", line 680, in __threaded_polling
self.worker_pool.raise_exceptions()
File "C:\Python310\lib\site-packages\telebot\util.py", line 135, in raise_exceptions
raise self.exception_info
File "C:\Python310\lib\site-packages\telebot\util.py", line 87, in run
task(*args, **kwargs)
File "C:\Users\Admin\PycharmProjects\paying\main.py", line 84, in r1day
'txid': getrday['txn_id'],
KeyError: 'txn_id'
Below is my code
@bot.message_handler(content_types=["text"], func=lambda message: message.text == "🚀 1 Day")
def r1day(message):
buyrday = {
'amount': 50,
'currency1': 'USD',
'currency2': 'BTC'
}
client = CryptoPayments(API_KEY, API_SECRET, IPN_URL)
getrday = client.createTransaction(buyrday)
if getrday['error'] == 'ok': # check error status 'ok' means the API returned with desired result
print(getrday['amount']) # print some values from the result
print(getrday['address'])
bot.send_message(message.chat.id, (getrday['amount']), (getrday['address']))
else:
print(getrday['error'])
bot.send_message(message.chat.id, (getrday['error']))
post_params1 = {
'txid': getrday['txn_id'],
}
getrdayInfo = client.getTransactionInfo(post_params1) # call coinpayments API using instance
if getrdayInfo['error'] == 'ok': # check error status 'ok' means the API returned with desired result
print(getrdayInfo['amountf'])
print(getrdayInfo['payment_address'])
bot.send_message(message.chat.id, (getrdayInfo['amountf']), (getrdayInfo['payment_address']))
else:
print(getrdayInfo['error'])
bot.send_message(message.chat.id, (getrdayInfo['error']))
The text was updated successfully, but these errors were encountered:
I would use Postman to send the request and verify that the request is handled properly and that the response is the same as previous CoinPayments API versions.
Also it appears you're reciving an error: No 'buyer_email' set! If you cannot obtain the buyer's email and want to handle refunds on your own you can use your own email instead.
I am getting the following error
Below is my code
The text was updated successfully, but these errors were encountered: