diff --git a/app/Services/Paddle/PaddleClient.php b/app/Services/Paddle/PaddleClient.php index 637c33a..e217d1a 100644 --- a/app/Services/Paddle/PaddleClient.php +++ b/app/Services/Paddle/PaddleClient.php @@ -70,6 +70,7 @@ class PaddleClient $headers = [ 'User-Agent' => sprintf('FotospielApp/%s PaddleClient', app()->version()), 'Paddle-Environment' => Str::lower($environment) === 'sandbox' ? 'sandbox' : 'production', + 'Paddle-Version' => '1', ]; return $this->http diff --git a/tests/Feature/Api/Tenant/BillingPortalTest.php b/tests/Feature/Api/Tenant/BillingPortalTest.php index c3b2c23..dc36146 100644 --- a/tests/Feature/Api/Tenant/BillingPortalTest.php +++ b/tests/Feature/Api/Tenant/BillingPortalTest.php @@ -32,6 +32,8 @@ class BillingPortalTest extends TenantTestCase $response->assertOk(); $response->assertJsonPath('url', 'https://portal.example/overview'); + Http::assertSent(fn (Request $request) => $request->hasHeader('Paddle-Version', '1')); + $this->assertDatabaseHas('tenants', [ 'id' => $this->tenant->id, 'paddle_customer_id' => 'cus_123',