Migrate billing from Paddle to Lemon Squeezy
This commit is contained in:
@@ -17,26 +17,21 @@ class EventAddonCheckoutTest extends TenantTestCase
|
||||
|
||||
Config::set('package-addons.extra_photos_small', [
|
||||
'label' => 'Extra photos (500)',
|
||||
'price_id' => 'pri_addon_photos',
|
||||
'variant_id' => 'var_addon_photos',
|
||||
'increments' => ['extra_photos' => 500],
|
||||
]);
|
||||
|
||||
Config::set('paddle.api_key', 'test_key');
|
||||
Config::set('paddle.base_url', 'https://paddle.test');
|
||||
Config::set('paddle.environment', 'sandbox');
|
||||
Config::set('lemonsqueezy.api_key', 'test_key');
|
||||
Config::set('lemonsqueezy.base_url', 'https://lemonsqueezy.test');
|
||||
Config::set('lemonsqueezy.store_id', 'store_123');
|
||||
|
||||
// Fake Paddle response
|
||||
// Fake Lemon Squeezy response
|
||||
Http::fake([
|
||||
'*/customers' => Http::response([
|
||||
'https://lemonsqueezy.test/checkouts' => Http::response([
|
||||
'data' => [
|
||||
'id' => 'ctm_addon_123',
|
||||
],
|
||||
], 200),
|
||||
'*/transactions' => Http::response([
|
||||
'data' => [
|
||||
'id' => 'txn_addon_123',
|
||||
'checkout' => [
|
||||
'url' => 'https://checkout.paddle.test/abcd',
|
||||
'id' => 'chk_addon_123',
|
||||
'attributes' => [
|
||||
'url' => 'https://checkout.lemonsqueezy.test/abcd',
|
||||
],
|
||||
],
|
||||
], 200),
|
||||
@@ -73,14 +68,14 @@ class EventAddonCheckoutTest extends TenantTestCase
|
||||
]);
|
||||
|
||||
$response->assertOk();
|
||||
$response->assertJsonPath('checkout_id', 'txn_addon_123');
|
||||
$response->assertJsonPath('checkout_id', 'chk_addon_123');
|
||||
|
||||
$this->assertDatabaseHas('event_package_addons', [
|
||||
'event_package_id' => $eventPackage->id,
|
||||
'addon_key' => 'extra_photos_small',
|
||||
'status' => 'pending',
|
||||
'quantity' => 2,
|
||||
'transaction_id' => 'txn_addon_123',
|
||||
'checkout_id' => 'chk_addon_123',
|
||||
]);
|
||||
|
||||
$addon = EventPackageAddon::where('event_package_id', $eventPackage->id)->latest()->first();
|
||||
|
||||
Reference in New Issue
Block a user