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
This commit is contained in:
idevakk
2025-12-04 11:59:09 -08:00
parent 75086ad83b
commit 8950988eac
7 changed files with 781 additions and 2 deletions

View File

@@ -2,6 +2,7 @@
use App\Http\Controllers\PaymentController;
use App\Http\Controllers\PaymentProviderController;
use App\Http\Controllers\PaymentSuccessController;
use App\Http\Controllers\WebhookController;
use Illuminate\Support\Facades\Route;
@@ -12,7 +13,9 @@ use Illuminate\Support\Facades\Route;
*/
Route::prefix('payment')->name('payment.')->group(function () {
Route::get('/success', [PaymentController::class, 'success'])->name('success');
Route::get('/success', [PaymentSuccessController::class, 'show'])
->middleware(['auth', 'verified'])
->name('success');
Route::get('/cancel', [PaymentController::class, 'cancel'])->name('cancel');
// UNIFIED: Payment processing endpoints (new unified payment system)