Änderungen (relevant):
- Add‑on Checkout auf Transactions + Transaction‑ID speichern: app/Services/Addons/EventAddonCheckoutService.php
- Paket/Marketing Checkout auf Transactions: app/Services/Paddle/PaddleCheckoutService.php
- Gift‑Voucher Checkout: Customer anlegen/finden + Transactions: app/Services/GiftVouchers/
GiftVoucherCheckoutService.php
- Tests aktualisiert: tests/Feature/Tenant/EventAddonCheckoutTest.php, tests/Unit/PaddleCheckoutServiceTest.php,
tests/Unit/GiftVoucherCheckoutServiceTest.php
This commit is contained in:
@@ -27,11 +27,17 @@ class EventAddonCheckoutTest extends TenantTestCase
|
||||
|
||||
// Fake Paddle response
|
||||
Http::fake([
|
||||
'*/checkout/links' => Http::response([
|
||||
'*/customers' => Http::response([
|
||||
'data' => [
|
||||
'url' => 'https://checkout.paddle.test/abcd',
|
||||
'id' => 'chk_addon_123',
|
||||
'expires_at' => now()->addHour()->toIso8601String(),
|
||||
'id' => 'ctm_addon_123',
|
||||
],
|
||||
], 200),
|
||||
'*/transactions' => Http::response([
|
||||
'data' => [
|
||||
'id' => 'txn_addon_123',
|
||||
'checkout' => [
|
||||
'url' => 'https://checkout.paddle.test/abcd',
|
||||
],
|
||||
],
|
||||
], 200),
|
||||
]);
|
||||
@@ -67,14 +73,14 @@ class EventAddonCheckoutTest extends TenantTestCase
|
||||
]);
|
||||
|
||||
$response->assertOk();
|
||||
$response->assertJsonPath('checkout_id', 'chk_addon_123');
|
||||
$response->assertJsonPath('checkout_id', 'txn_addon_123');
|
||||
|
||||
$this->assertDatabaseHas('event_package_addons', [
|
||||
'event_package_id' => $eventPackage->id,
|
||||
'addon_key' => 'extra_photos_small',
|
||||
'status' => 'pending',
|
||||
'quantity' => 2,
|
||||
'checkout_id' => 'chk_addon_123',
|
||||
'transaction_id' => 'txn_addon_123',
|
||||
]);
|
||||
|
||||
$addon = EventPackageAddon::where('event_package_id', $eventPackage->id)->latest()->first();
|
||||
|
||||
Reference in New Issue
Block a user