Migrate billing from Paddle to Lemon Squeezy
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-02-03 10:59:54 +01:00
parent c96a73d884
commit 10c99de1e2
228 changed files with 4369 additions and 4067 deletions

View File

@@ -61,7 +61,7 @@ class TestCheckoutController extends Controller
]);
}
public function simulatePaddle(
public function simulateLemonSqueezy(
Request $request,
CheckoutWebhookService $webhooks,
CheckoutSession $session
@@ -70,13 +70,13 @@ class TestCheckoutController extends Controller
$validated = $request->validate([
'event_type' => ['nullable', 'string'],
'transaction_id' => ['nullable', 'string'],
'order_id' => ['nullable', 'string'],
'status' => ['nullable', 'string'],
'checkout_id' => ['nullable', 'string'],
'metadata' => ['nullable', 'array'],
]);
$eventType = $validated['event_type'] ?? 'transaction.completed';
$eventType = $validated['event_type'] ?? 'order_created';
$metadata = array_merge([
'tenant_id' => $session->tenant_id,
'package_id' => $session->package_id,
@@ -84,16 +84,21 @@ class TestCheckoutController extends Controller
], $validated['metadata'] ?? []);
$payload = [
'event_type' => $eventType,
'data' => array_filter([
'id' => $validated['transaction_id'] ?? ('txn_'.Str::uuid()),
'status' => $validated['status'] ?? 'completed',
'meta' => [
'event_name' => $eventType,
'custom_data' => $metadata,
'checkout_id' => $validated['checkout_id'] ?? $session->provider_metadata['paddle_checkout_id'] ?? 'chk_'.Str::uuid(),
],
'data' => array_filter([
'id' => $validated['order_id'] ?? ('order_'.Str::uuid()),
'attributes' => array_filter([
'status' => $validated['status'] ?? 'paid',
'checkout_id' => $validated['checkout_id'] ?? $session->provider_metadata['lemonsqueezy_checkout_id'] ?? 'chk_'.Str::uuid(),
'custom_data' => $metadata,
]),
]),
];
$handled = $webhooks->handlePaddleEvent($payload);
$handled = $webhooks->handleLemonSqueezyEvent($payload);
return response()->json([
'data' => [