Commit Graph

5 Commits

Author SHA1 Message Date
idevakk
1b438cbf89 feat(webhooks): enhance Polar webhook processing with proper event handling
- Add support for subscription.uncanceled webhook event
  - Fix spelling mismatch for subscription.canceled (Polar) vs subscription.cancelled (code)
  - Implement proper cancel_at_period_end handling in subscription.canceled events
  - Add cancelled_at field updates for subscription.updated events
  - Handle Polar's spelling variants (canceled_at vs cancelled_at) consistently
  - Remove non-existent pause_reason column from subscription uncanceled handler
  - Enhance webhook logging with detailed field update tracking
  - Add comprehensive cancellation metadata storage in provider_data
  - Gracefully handle null provider_subscription_id in payment confirmation polling

  All Polar webhook events now properly sync subscription state including
  cancellation timing, reasons, and billing period details.
2025-12-07 00:57:46 -08:00
idevakk
15e018eb88 feat(payment): implement comprehensive Polar subscription sync with proper date and cancellation handling
- Add Polar-specific date field mapping in PaymentOrchestrator (current_period_start, current_period_end, cancelled_at, trial_end)
  - Handle both cancellation scenarios: cancel_at_period_end=true and existing cancelled_at timestamp
  - Map customer_cancellation_reason and customer_cancellation_comment from Polar to database
  - Update billing page to show correct renewal vs expiry dates based on cancellation status
  - Restrict cancel button to activation_key provider only (Polar uses customer portal)
  - Fix button spacing between "Manage in Polar" and "Sync" buttons
  - Ensure both "Sync" and "Recheck Status" buttons use identical sync functionality
2025-12-06 10:42:25 -08:00
idevakk
8950988eac feat(payment): implement beautiful payment confirmation page with real-time status checking
- 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
2025-12-04 11:59:09 -08:00
idevakk
75086ad83b feat(payment): integrate Polar.sh payment provider with checkout flow
- 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
2025-12-04 10:29:25 -08:00
idevakk
27ac13948c feat: implement comprehensive multi-provider payment processing system
- 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
2025-11-19 09:37:00 -08:00