Subscription Flow
The subscription process is designed to be seamless and secure, following industry best practices for payment processing:- Plan Selection: Users choose from multiple subscription tiers
- Payment Processing: Secure credit card processing through Stripe
- Access Provisioning: Immediate activation of premium features
- Recurring Billing: Automated rebilling on the subscriber’s cycle
- Subscription Management: Self-service tools for upgrading, downgrading, or canceling
Subscription Tiers
OnlyAutomator offers multiple subscription tiers to accommodate different user needs:Free Tier
- Price: $0/month
- Features:
- Basic analytics dashboard
- Limited data collection (1 OnlyFans account)
- 7-day data retention
- Standard support
Pro Tier
- Price: $19.99/month
- Features:
- Advanced analytics dashboard
- Enhanced data collection (up to 3 OnlyFans accounts)
- 30-day data retention
- Priority support
- Basic automation tools
Business Tier
- Price: $49.99/month
- Features:
- Comprehensive analytics suite
- Full data collection (up to 10 OnlyFans accounts)
- 90-day data retention
- Priority support with dedicated contact
- Advanced automation tools
- Custom reporting
Technical Implementation
Database Schema
The subscription data is stored in the following database schema:API Endpoints
The subscription system exposes the following API endpoints:Endpoint | Method | Description |
---|---|---|
/api/create-checkout-session | POST | Creates a Stripe checkout session |
/api/create-portal-link | POST | Creates a link to the Stripe customer portal |
/api/webhooks | POST | Handles Stripe webhook events |
Stripe Integration
Integration with Stripe is handled through a dedicated service:Webhook Processing
Stripe webhooks are used to keep subscription status in sync:User Subscription Management
Users can manage their subscriptions through a dedicated portal:Subscription Status Checking
A custom hook provides easy access to subscription status:Trial Periods
The subscription system supports trial periods to allow users to experience premium features:- Trial Duration: 7 days for all paid plans
- Credit Card Required: Credit card is collected upfront but not charged until the trial ends
- Automatic Conversion: Trial automatically converts to a paid subscription unless canceled
- Full Access: Trial users receive full access to all plan features
Handling Subscription Changes
The system includes logic for handling various subscription events:- Upgrades: Immediate upgrade with prorated charges
- Downgrades: Applied at the end of the billing cycle
- Cancellations: Access continues until the end of the paid period
- Reactivation: Simple process to restore a canceled subscription
Configuration Settings
The subscription system is configured through environment variables:Troubleshooting
Common subscription issues and their resolutions:Issue | Possible Causes | Resolution |
---|---|---|
Failed payment | Expired card, insufficient funds | Prompt user to update payment method |
Webhook errors | Misconfigured webhook, server issues | Check Stripe dashboard, verify endpoint URL |
Access discrepancy | Database sync issues | Force sync subscription status from Stripe |
Unexpected cancellation | Failed payment, user action | Check Stripe logs for cancellation reason |