https://github.com/mikbolshakov/payment-bot
A Telegram bot for processing cryptocurrency payments using Node.js, TypeScript, Telegraf, Prisma ORM, Cron, and the Cryptomus API. It automates payment creation and status updates.
https://github.com/mikbolshakov/payment-bot
cryptocurrency cryptomus telegram-bot
Last synced: 7 months ago
JSON representation
A Telegram bot for processing cryptocurrency payments using Node.js, TypeScript, Telegraf, Prisma ORM, Cron, and the Cryptomus API. It automates payment creation and status updates.
- Host: GitHub
- URL: https://github.com/mikbolshakov/payment-bot
- Owner: mikbolshakov
- Created: 2023-02-09T11:58:07.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-17T10:13:23.000Z (over 1 year ago)
- Last Synced: 2025-01-17T11:23:54.008Z (over 1 year ago)
- Topics: cryptocurrency, cryptomus, telegram-bot
- Language: TypeScript
- Homepage:
- Size: 64.5 KB
- Stars: 8
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Crypto Payment Bot
A Telegram bot for processing cryptocurrency payments using the Cryptomus API. This bot handles payment creation, status checking, and database management with a seamless integration of scheduled tasks and user interactions.
## Features
- **Payment Creation**: Generate payment links with unique identifiers.
- **Payment Status Check**: Automatically checks and updates the status of payments.
- **Database Integration**: Stores payment details in a database.
- **Cron Jobs**: Periodically checks payment statuses.
## How It Works
### Payment Creation
When a user sends the `/start` command:
1. A payment is created using the Cryptomus API.
2. The payment details are stored in the database.
3. The bot replies with a payment link.
### Scheduled Payment Updates
- A cron job runs every 5 seconds to:
1. Fetch incomplete payments from the database.
2. Check their status via the Cryptomus API.
3. Update the database and notify the user if the payment is complete.