Framework Agnostic Referral Program Package with Stripe Connect Integration
CertGames.com | ©AngelaMos | 2025
stripe-referral is a production-ready, framework-agnostic Python package for building
referral programs with automated payout processing.
- Framework Agnostic: Works with Flask, FastAPI, Django, or standalone
- Multiple Payout Methods: Stripe Connect, Wise API, Manual bank transfers
- Type Safe: Full TypedDict returns and modern type hints
- Database Agnostic: SQLAlchemy-based (PostgreSQL, MySQL, SQLite)
- Production Ready: Alembic migrations, error handling, validation
- Clean Architecture: Repository pattern, service layer, adapter pattern
pip install stripe-referral
from stripe_referral import ReferralService, get_db
# Generate referral code
with get_db() as db:
result = ReferralService.create_code(
db=db,
user_id="user_123",
program_key="certgames"
)
print(f"Your code: {result['code']}")
# Track referral conversion
with get_db() as db:
tracking = ReferralService.track_referral(
db=db,
code="REF_ABC123",
referred_user_id="user_456"
)
print(f"Earned: ${tracking['amount_earned']}")
Coming soon...
See CONTRIBUTING.rst for development setup and guidelines.
MIT License - see LICENSE for details.
See SECURITY.rst for our security policy and how to report vulnerabilities.