Files
rsync_licensing_server/app/Services/Payments/PaddleClient.php
T
2026-09-09 10:20:34 +01:00

24 lines
635 B
PHP

<?php
namespace App\Services\Payments;
use Illuminate\Support\Facades\Http;
final class PaddleClient
{
public function customer(?string $customerID): ?array
{
if (!$customerID || !config('rsync-studio.paddle.api_key')) return null;
$response = Http::baseUrl(config('rsync-studio.paddle.api_url'))
->withToken(config('rsync-studio.paddle.api_key'))
->acceptJson()
->timeout(10)
->get('/customers/'.$customerID);
if (!$response->successful()) return null;
$data = $response->json('data');
return is_array($data) ? $data : null;
}
}