- 16 Apr, 2026 40 commits
-
-
Your Name authored
- Created admin_payment_settings.html template with system status dashboard - Added route /dashboard/admin/payment-settings in main.py - Implemented GET /api/admin/payment-system/status endpoint (master keys, balances, pending/failed payments) - Implemented GET /api/admin/payment-system/config endpoint (all payment config) - Implemented PUT /api/admin/payment-system/config/* endpoints: - /price-sources - Configure crypto price sources - /blockchain - Configure blockchain monitoring - /email - Configure email notifications - /consolidation - Configure wallet consolidation - Added Payment Settings link to admin navigation menu in base.html - Maintained backward compatibility with legacy POST endpoints
-
Your Name authored
-
Your Name authored
- Moved crypto dependencies back to requirements.txt - Updated aisbf.sh to exit with helpful error message if pip install fails - Fixed StripeHandler -> StripePaymentHandler import - Fixed PayPalHandler -> PayPalPaymentHandler import - Removed requirements-crypto.txt (no longer needed)
-
Your Name authored
-
Your Name authored
-
Your Name authored
-
Your Name authored
-
Your Name authored
-
Your Name authored
-
Your Name authored
-
Your Name authored
-
Your Name authored
-
Your Name authored
-
Your Name authored
- Add subscription methods to PaymentService (create, upgrade, downgrade, cancel, get_status) - Initialize SubscriptionManager and SubscriptionRenewalProcessor in PaymentService - Add REST API endpoints for subscription management: - POST /api/subscriptions - Create subscription - POST /api/subscriptions/upgrade - Upgrade tier - POST /api/subscriptions/downgrade - Downgrade tier - POST /api/subscriptions/cancel - Cancel subscription - GET /api/subscriptions/status - Get subscription status - Add process_renewals() and process_retries() methods for scheduler integration Completes Phase 3 Task 6: Subscription API Endpoints
-
Your Name authored
-
Your Name authored
Implements automatic subscription renewal processing with: - RenewalProcessor class that finds and processes due subscriptions - Extends billing periods by 30 days (monthly) or 365 days (yearly) - Applies pending tier changes (downgrades) at renewal - Handles subscription cancellations (cancel_at_period_end flag) - Supports both fiat (card/PayPal) and crypto wallet payments - Graceful handling of payment failures - Comprehensive test coverage (8 tests, all passing) Files: - aisbf/payments/subscription/renewal.py: Core renewal processor - tests/payments/test_renewal.py: Complete test suite - aisbf/payments/subscription/__init__.py: Export RenewalProcessor
-
Your Name authored
- Add downgrade_subscription() method to SubscriptionManager - Sets pending_tier_id for scheduled downgrade at period end - No immediate charge or refund - User keeps current tier until period end - Returns scheduled downgrade date - Add cancel_subscription() method to SubscriptionManager - Sets cancel_at_period_end flag - User retains access until period end - No refund issued - Returns cancellation date - Add comprehensive tests for both operations - Test downgrade scheduling and no-charge behavior - Test cancellation scheduling and no-refund behavior - Test error cases (no subscription, invalid tier) All 12 subscription tests passing.
-
Your Name authored
- Add upgrade_subscription() method to SubscriptionManager - Calculate prorated charge based on unused time in billing period - Formula: new_price - (old_price × unused_fraction) - Update subscription tier immediately while keeping same period end date - Charge prorated amount via existing payment method - Add comprehensive tests for proration calculations - Test edge cases: no subscription, invalid tier, accurate proration math
-
Your Name authored
- Create SubscriptionManager class with create_subscription method - Validate tier and payment method before creating subscription - Calculate amount based on billing cycle (monthly/yearly) - Check for existing active subscription - Calculate period dates with immediate start - Charge payment via fiat (card/PayPal) or crypto - Create subscription record and update user tier - Add comprehensive test coverage
-
Your Name authored
-
Your Name authored
- Add fiat handler initialization (StripeHandler, PayPalHandler) - Add add_stripe_payment_method() method - Add initiate_paypal_billing_agreement() method - Add complete_paypal_billing_agreement() method - Add get_payment_methods() method to retrieve all user payment methods - Add delete_payment_method() with validation to prevent deletion of methods used by active subscriptions
-
Your Name authored
-
Your Name authored
- Create StripePaymentHandler class with async operations - Implement add_payment_method() with .00 authorization hold verification - Authorization hold is immediately cancelled to release funds - Get or create Stripe customer with metadata - Store payment method in database - Handle webhooks with signature verification - Add stripe_customer_id column to users table - Add comprehensive tests for Stripe integration
-
Your Name authored
-
Your Name authored
-
Your Name authored
-
Your Name authored
-
Your Name authored
-
Your Name authored
-
Your Name authored
-
Your Name authored
-
Your Name authored
-
Your Name authored
-
Your Name authored
-
Your Name authored
-
Your Name authored
-
Your Name authored
-
Your Name authored
-
Your Name authored
-
Your Name authored
-