feat(payment): implement OxaPay provider and non-recurring subscription sync

- Add comprehensive OxaPay payment provider with invoice creation, webhook processing, and subscription status sync
  - Implement conditional payload fields (to_currency, callback_url) based on configuration
  - Create universal sync command for all non-recurring payment providers
  - Add subscription model fields for payment tracking
  - Implement proper status mapping between OxaPay and Laravel subscription states
  - Add webhook signature validation using HMAC SHA512
This commit is contained in:
idevakk
2025-12-07 08:20:51 -08:00
parent 5fabec1f9d
commit 9a32511e97
5 changed files with 628 additions and 60 deletions

View File

@@ -2,27 +2,6 @@
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;
@@ -180,7 +159,7 @@ Route::middleware(['auth'])->group(function (): void {
Route::get('settings/appearance', Appearance::class)->name('settings.appearance');
});
Route::post('/webhook/oxapay', [WebhookController::class, 'oxapay'])->name('webhook.oxapay');
Route::post('/webhook/oxapayLegacy', [WebhookController::class, 'oxapay'])->name('webhook.oxapayLegacy');
// Unified Payment System Routes
require __DIR__.'/payment.php';