Skip to content

Instantly share code, notes, and snippets.

@trialan
Created May 21, 2022 13:04
Show Gist options
  • Save trialan/19a67d68c10ea9b879b97bfab4d07e4b to your computer and use it in GitHub Desktop.
Save trialan/19a67d68c10ea9b879b97bfab4d07e4b to your computer and use it in GitHub Desktop.
Updated successful payment callback
def successful_payment_callback(update: Update, context):
col = get_collection()
receipt = update.message.successful_payment
col.insert_one({"telegram_uid": update.message.chat.username,
"donated_amount": receipt.total_amount,
"currency": receipt.currency,
"datetime": str(datetime.datetime.now())})
print_col(col)
update.message.reply_text("Thank you for your purchase!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment