- Add provider_checkout_id column to separate checkout ID from subscription ID
- Update Polar provider to store checkout ID separately and set subscription ID to null initially
- Implement smart sync logic that queries Polar API when subscription ID is missing
- Add fetchPolarSubscriptionId method to find active subscriptions via customer ID
- Update webhook handlers to use provider_checkout_id for subscription lookup
- Make makeAuthenticatedRequest public to enable Subscription model API access
- Support plan metadata matching for accurate subscription identification
- Add fallback to most recent active subscription when no exact match found
This resolves sync button issues by properly tracking checkout vs subscription IDs
and enables automatic subscription ID recovery when webhooks fail.
- Add comprehensive billing page with current subscription display and transaction history
- Integrate Polar.sh customer portal for subscription management
- Fix Polar API endpoint from /customer-portal to /customer-sessions
- Use Polar's direct customer_portal_url response for seamless redirect
- Add responsive button layout with cursor-pointer styling
- Implement human-readable timestamps using diffForHumans()
- Add subscription sync functionality with 30-minute recheck window
- Include subscription cancellation with modal confirmation
- Support activation key provider with pending activation display
- Add proper error handling and user feedback messages
- Add sanitizePolarErrorMessage() method to convert API errors to user-friendly messages
- Improve error logging with structured data instead of raw response bodies
- Add validation error handling with field-specific messages
- Remove sensitive information (emails, domains, UUIDs) from error messages
- Update checkout, subscription, customer, and product error handling
- Add status code-based error mapping for better user experience
- Add PaymentSuccessController with authentication and subscription selection logic
- Create PaymentConfirmation Livewire component with polling mechanism
- Implement real-time subscription status verification via Polar provider API
- Add confetti animation for successful payment confirmation
- Design responsive payment success page with dark mode support
- Fix Polar provider field mapping (updated_at -> modified_at)
- Add comprehensive error handling and logging
- Support multiple subscription status states (verifying, activated, pending, error)
- Implement automatic polling with 30-second intervals (max 5 attempts)
- Add fallback redirects and user-friendly status messages
- Build PolarProvider from scratch with proper HTTP API integration
- Add encrypted configuration loading from payment_providers table via model
- Implement sandbox/live environment switching with proper credential handling
- Fix product creation API structure for Polar.sh requirements
- Add comprehensive error handling and logging throughout checkout flow
- Fix PaymentController checkout URL handling to support Polar's checkout_url response
- Add debug logging for troubleshooting checkout session creation
- Support both regular and trial checkout flows for Polar payments
- Add comprehensive rate limiting (300 req/min) with automatic throttling
- Implement centralized API request method for consistent authentication
- Add support for Polar-specific webhook events (order.created, order.paid, subscription.active, customer.state_changed, benefit_grant.created)
- Update API endpoints to match Polar's official structure (remove /v1 prefix)
- Add external_id support for reliable customer-user mapping
- Implement sandbox mode with separate credentials configuration
- Add discount code support in checkout flow
- Add credential validation method for API connectivity testing
- Update webhook signature validation and event handling
- Enhance error handling and logging throughout provider
- Add proper metadata structure with user and plan information
- Update services configuration and environment variables for sandbox support
BREAKING CHANGE: Updated API endpoint structure and webhook event handling to comply with Polar.sh official API specification.
- Add unified payment provider architecture with contract-based design
- Implement 6 payment providers: Stripe, Lemon Squeezy, Polar, Oxapay, Crypto, Activation Keys
- Create subscription management with lifecycle handling (create, cancel, pause, resume, update)
- Add coupon system with usage tracking and trial extensions
- Build Filament admin resources for payment providers, subscriptions, coupons, and trials
- Implement payment orchestration service with provider registry and configuration management
- Add comprehensive payment logging and webhook handling for all providers
- Create customer analytics dashboard with revenue, churn, and lifetime value metrics
- Add subscription migration service for provider switching
- Include extensive test coverage for all payment functionality