Fix Paddle customer lookup for billing
This commit is contained in:
@@ -32,10 +32,19 @@ class TenantBillingController extends Controller
|
||||
}
|
||||
|
||||
if (! $tenant->paddle_customer_id) {
|
||||
return response()->json([
|
||||
'data' => [],
|
||||
'message' => 'Tenant has no Paddle customer identifier.',
|
||||
]);
|
||||
try {
|
||||
$this->paddleCustomers->ensureCustomerId($tenant);
|
||||
} catch (\Throwable $exception) {
|
||||
Log::warning('Failed to resolve Paddle customer for tenant', [
|
||||
'tenant_id' => $tenant->id,
|
||||
'error' => $exception->getMessage(),
|
||||
]);
|
||||
|
||||
return response()->json([
|
||||
'data' => [],
|
||||
'message' => 'Failed to resolve Paddle customer.',
|
||||
], 502);
|
||||
}
|
||||
}
|
||||
|
||||
$cursor = $request->query('cursor');
|
||||
|
||||
Reference in New Issue
Block a user