chore: add payment routes for our UPS

This commit is contained in:
idevakk
2025-11-28 06:03:43 -08:00
parent d4de074161
commit cc34c9aca3
4 changed files with 229 additions and 2 deletions

View File

@@ -15,13 +15,19 @@ Route::prefix('payment')->name('payment.')->group(function () {
Route::get('/success', [PaymentController::class, 'success'])->name('success');
Route::get('/cancel', [PaymentController::class, 'cancel'])->name('cancel');
// Payment processing endpoints
// UNIFIED: Payment processing endpoints (new unified payment system)
Route::post('/checkout', [PaymentController::class, 'createCheckout'])->name('checkout');
Route::post('/subscribe', [PaymentController::class, 'createSubscription'])->name('subscribe');
Route::get('/methods', [PaymentController::class, 'getPaymentMethods'])->name('methods');
Route::get('/history', [PaymentController::class, 'getHistory'])->name('history');
});
// UNIFIED: Enhanced checkout routes with provider selection
Route::middleware(['auth', 'verified'])->prefix('checkout')->name('checkout.')->group(function () {
Route::get('/enhanced/{plan}/{provider}', [PaymentController::class, 'enhancedCheckout'])->name('enhanced');
Route::get('/trial/{plan}/{provider}', [PaymentController::class, 'trialCheckout'])->name('trial');
});
Route::prefix('webhook')->name('webhook.')->group(function () {
// Unified webhook handler
Route::post('/{provider}', [WebhookController::class, 'handle'])->name('unified');

View File

@@ -69,7 +69,7 @@ Route::middleware(['auth', 'verified', CheckUserBanned::class])->group(function
Route::get('dashboard/compose-email', Dashboard::class)->name('dashboard.compose');
Route::get('dashboard/support', Support::class)->name('dashboard.support');
// Checkout Routes
// LEGACY: Old Stripe Cashier checkout route (deprecated - use unified payment system)
Route::get('checkout/{plan}', function ($pricing_id) {
$plans = config('app.plans');
$pricingData = [];
@@ -91,6 +91,7 @@ Route::middleware(['auth', 'verified', CheckUserBanned::class])->group(function
abort(404);
})->name('checkout');
// LEGACY: Payment status routes (used by both legacy and unified systems)
Route::get('dashboard/success', [Dashboard::class, 'paymentStatus'])->name('checkout.success')->defaults('status', 'success');
Route::get('dashboard/cancel', [Dashboard::class, 'paymentStatus'])->name('checkout.cancel')->defaults('status', 'cancel');