LianFlow is designed to simplify crypto payment processing for businesses operating on the NEO X blockchain. The solution empowers businesses to accept cryptocurrency payments for their products and services while offering an easy-to-integrate system for existing codebases and platforms. By streamlining the integration process, the platform reduces the technical barriers that often deter businesses from adopting blockchain-based payments..
- Business Account Management: Streamlined processes for creating and managing business accounts.
- Wallet Operations: Easy wallet creation and import for secure and efficient transactions.
- Seamless Payment Processing: Efficient handling of payments with real-time transaction monitoring.
- Instant Payment Updates: Real-time status updates via WebSocket for immediate insights.
- Secure API Authentication: Protect your transactions with robust API key authentication.
- Proactive Webhook Notifications: Stay informed with instant notifications on payment status changes.
- FastAPI: A modern, high-performance web framework for building APIs with Python.
- SQLAlchemy: A powerful ORM for database management and operations.
- Web3.py: A comprehensive library for interacting with the blockchain.
- PostgreSQL/SQLite: Reliable databases for storing and managing data.
For a more Detailed Documentation for Integration check LianFlow Documentaion
All API routes require an API key to be passed in the header:
Authorization: Bearer YOUR_API_KEY
You can obtain your API key from Lianflow:
- Settings page -> API Keys tab
-
Create Payment
POST /api/v1/payment/create
Initiates a new payment request.
- Required fields:
amount
: floatdata
: string (metadata)sender_address
: stringbusiness_id
: stringwebhook
: string (URL for payment notifications)
- Returns: Payment ID and merchant address
- Required fields:
-
Get Payment Details
GET /api/v1/payment/{paymentId}
Retrieve details of a specific payment.
- Returns: Payment details including status and amounts
-
Check Payment Status
GET /api/v1/payment/status/{paymentId}
Get the current status of a payment.
- Returns: Payment status and transaction hash
-
Get Transaction Details
GET /api/v1/transaction/{transactionId}
Retrieve details of a specific transaction.
-
Get Wallet Transactions
GET /api/v1/transaction/to/{wallet_address}
Get all transactions for a specific wallet address.
The system sends webhook notifications to the URL specified during payment creation. The webhook payload includes:
- Payment details
- Transaction status
- Transaction hash
- Amount information
- Sender and receiver addresses
- API authentication using API keys
- JWT-based session management
- Password hashing using bcrypt
- CORS protection
- Rate limiting (if configured)
project/
├── app.py # Main FastAPI application
├── api.py # API routes and handlers
├── models.py # Database models
├── schema.py # Pydantic models for request/response
├── database.py # Database configuration
├── xenon.py # Blockchain interaction utilities
├── monitor.py # Transaction monitoring
└── README.md # Project documentation
Main application file containing:
- FastAPI app configuration
- CORS middleware setup
- Authentication routes
- Web interface routes
- WebSocket handling
API routes for external integrations:
- Payment creation and management
- Transaction monitoring
- Webhook notifications
- API key authentication
SQLAlchemy models for:
- Business accounts
- Wallets
- Payments
- Transactions
- Analytics
Pydantic models for:
- Request validation
- Response serialization
- Data transfer objects
Database configuration:
- SQLAlchemy engine setup
- Session management
- Base model configuration
Blockchain utilities:
- Wallet creation/import
- Balance checking
- Transaction handling
- Gas price conversion
Transaction monitoring:
- Real-time transaction tracking
- Payment verification
- Block confirmation monitoring
- The project uses SQLite by default. For production, configure PostgreSQL in
database.py
. - Update CORS settings in
app.py
for production. - Set up proper environment variables.
- Implement proper error handling and logging.
Required environment variables:
SECRET_KEY
: JWT secret keyDATABASE_URL
: Database connection string (optional, defaults to SQLite)RPC_URL
: NeoX blockchain RPC endpointWS_URL
: WebSocket endpoint for blockchain events