Migrate billing from Paddle to Lemon Squeezy

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

View File

@@ -2,6 +2,7 @@
namespace Tests\Feature;
use App\Models\CheckoutSession;
use App\Models\Package;
use App\Models\Tenant;
use App\Models\User;
@@ -24,8 +25,8 @@ class CheckoutSessionLocalConfirmationTest extends TestCase
$tenant = Tenant::factory()->create();
$user = User::factory()->for($tenant)->create();
$package = Package::factory()->create([
'paddle_price_id' => 'pri_123',
'paddle_product_id' => 'pro_123',
'lemonsqueezy_variant_id' => 'pri_123',
'lemonsqueezy_product_id' => 'pro_123',
'price' => 120,
]);
@@ -33,7 +34,7 @@ class CheckoutSessionLocalConfirmationTest extends TestCase
$session = $sessions->createOrResume($user, $package, [
'tenant' => $tenant,
]);
$sessions->selectProvider($session, 'paddle');
$sessions->selectProvider($session, CheckoutSession::PROVIDER_LEMONSQUEEZY);
$this->actingAs($user);
$this->withSession(['_token' => 'test-token']);
@@ -41,7 +42,7 @@ class CheckoutSessionLocalConfirmationTest extends TestCase
$response = $this->postJson(
route('checkout.session.confirm', $session),
[
'transaction_id' => 'txn_123',
'order_id' => 'ord_123',
'checkout_id' => 'chk_123',
],
[
@@ -60,7 +61,7 @@ class CheckoutSessionLocalConfirmationTest extends TestCase
$this->assertDatabaseHas('package_purchases', [
'tenant_id' => $tenant->id,
'package_id' => $package->id,
'provider_id' => 'txn_123',
'provider_id' => 'ord_123',
]);
$this->assertDatabaseHas('tenant_packages', [