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
This commit is contained in:
@@ -1,6 +1,28 @@
|
||||
<?php
|
||||
|
||||
use App\Http\Controllers\AppController;
|
||||
|
||||
// DEBUG: Test route to check PolarProvider
|
||||
Route::get('/debug-polar', function () {
|
||||
try {
|
||||
$provider = new \App\Services\Payments\Providers\PolarProvider;
|
||||
|
||||
return response()->json([
|
||||
'status' => 'success',
|
||||
'provider_class' => get_class($provider),
|
||||
'is_active' => $provider->isActive(),
|
||||
'config' => $provider->getConfiguration(),
|
||||
'sandbox' => $provider->config['sandbox'] ?? 'unknown',
|
||||
'timestamp' => '2025-12-04-17-15-00',
|
||||
]);
|
||||
} catch (\Exception $e) {
|
||||
return response()->json([
|
||||
'status' => 'error',
|
||||
'message' => $e->getMessage(),
|
||||
'trace' => $e->getTraceAsString(),
|
||||
]);
|
||||
}
|
||||
});
|
||||
use App\Http\Controllers\ImpersonationController;
|
||||
use App\Http\Controllers\WebhookController;
|
||||
use App\Http\Middleware\CheckPageSlug;
|
||||
|
||||
Reference in New Issue
Block a user