From 6fcb5bd9291e98f9324599ba468f090673265c2a Mon Sep 17 00:00:00 2001 From: Codex Agent Date: Tue, 23 Dec 2025 15:22:46 +0100 Subject: [PATCH] fixed paddle request form --- app/Services/Paddle/PaddleCustomerPortalService.php | 4 ++++ tests/Feature/Api/Tenant/BillingPortalTest.php | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Services/Paddle/PaddleCustomerPortalService.php b/app/Services/Paddle/PaddleCustomerPortalService.php index 934592f..fdb3edc 100644 --- a/app/Services/Paddle/PaddleCustomerPortalService.php +++ b/app/Services/Paddle/PaddleCustomerPortalService.php @@ -20,6 +20,10 @@ class PaddleCustomerPortalService ); } + if ($payload === []) { + $payload = (object) []; + } + return $this->client->post("/customers/{$customerId}/portal-sessions", $payload); } } diff --git a/tests/Feature/Api/Tenant/BillingPortalTest.php b/tests/Feature/Api/Tenant/BillingPortalTest.php index d082aa6..c289758 100644 --- a/tests/Feature/Api/Tenant/BillingPortalTest.php +++ b/tests/Feature/Api/Tenant/BillingPortalTest.php @@ -36,7 +36,8 @@ class BillingPortalTest extends TenantTestCase $path = parse_url($request->url(), PHP_URL_PATH); return $request->hasHeader('Paddle-Version', '1') - && $path === '/customers/cus_123/portal-sessions'; + && $path === '/customers/cus_123/portal-sessions' + && $request->body() === '{}'; }); $this->assertDatabaseHas('tenants', [