Skip to content

aiopayme/example

Repository files navigation

aiopayme example

A production-ready example project demonstrating aiopayme integration with FastAPI, aiogram, SQLAlchemy, and Payme payment system.

Stack

Getting Started

1. Clone the repository

git clone https://github.com/aiopayme/example
cd example

2. Configure environment

cp .env.example .env

Fill in your credentials in .env:

BOT_TOKEN=your_bot_token
MERCHANT_ID=your_merchant_id
SECRET_KEY=your_secret_key
SANDBOX=True
DATABASE_URL=sqlite+aiosqlite:///./db.sqlite3
ONE_TIME_PAYMENT=True

3. Run with Docker

docker-compose up --build

4. Run without Docker

pip install -r requirements.txt
alembic upgrade head
python main.py       # FastAPI + admin panel
python bot/main.py   # Telegram bot

Project Structure

├── admin/
│   └── admin.py         # sqladmin views
├── bot/
│   └── main.py          # Telegram bot
├── handlers/
│   └── payme.py         # Payme webhook handlers
├── migrations/          # Alembic migrations
├── models/
│   ├── order.py         # Order model
│   └── payme.py         # PaymeTransaction model
├── routers/
│   ├── order.py         # Order creation endpoint
│   └── webhook.py       # Payme webhook endpoint
├── services/
│   └── payme.py         # Payme business logic
├── deps.py              # Dependencies
├── main.py              # FastAPI entrypoint
└── settings.py          # Configuration

Admin Panel

Available at http://localhost:8000/admin

Documentation

Full aiopayme documentation at aiopayme.github.io

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages