Add event addon purchase success page with confetti
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-07 17:04:14 +01:00
parent 64b3bf3ed4
commit c0c082975e
15 changed files with 837 additions and 7 deletions

View File

@@ -67,6 +67,8 @@ class EventAddonCheckoutTest extends TenantTestCase
$response = $this->authenticatedRequest('POST', "/api/v1/tenant/events/{$event->slug}/addons/checkout", [
'addon_key' => 'extra_photos_small',
'quantity' => 2,
'success_url' => 'https://app.fotospiel.test/event-admin/mobile/events/test-event/addons/success?addon_key=extra_photos_small',
'cancel_url' => 'https://app.fotospiel.test/event-admin/mobile/events/test-event/addons',
'accepted_terms' => true,
'accepted_waiver' => true,
]);
@@ -87,6 +89,9 @@ class EventAddonCheckoutTest extends TenantTestCase
$this->assertSame('Extra photos (500)', $addon->metadata['label'] ?? null);
$this->assertSame(500, $addon->metadata['increments']['extra_photos'] ?? null);
$this->assertNull($addon->metadata['price_eur'] ?? null);
$this->assertNotEmpty($addon->metadata['addon_intent'] ?? null);
$this->assertStringContainsString('addon_intent=', (string) ($addon->metadata['success_url'] ?? ''));
$this->assertStringContainsString('addon_intent=', (string) ($addon->metadata['cancel_url'] ?? ''));
}
public function test_paypal_checkout_creates_pending_addon_record(): void
@@ -132,6 +137,8 @@ class EventAddonCheckoutTest extends TenantTestCase
$response = $this->authenticatedRequest('POST', "/api/v1/tenant/events/{$event->slug}/addons/checkout", [
'addon_key' => 'extra_photos_small',
'quantity' => 2,
'success_url' => 'https://app.fotospiel.test/event-admin/mobile/events/test-event/addons/success?addon_key=extra_photos_small',
'cancel_url' => 'https://app.fotospiel.test/event-admin/mobile/events/test-event/addons',
'accepted_terms' => true,
'accepted_waiver' => true,
]);
@@ -154,6 +161,9 @@ class EventAddonCheckoutTest extends TenantTestCase
$this->assertSame(1000, $addon->extra_photos);
$this->assertSame('Extra photos (500)', $addon->metadata['label'] ?? null);
$this->assertSame(12.5, $addon->metadata['price_eur'] ?? null);
$this->assertNotEmpty($addon->metadata['addon_intent'] ?? null);
$this->assertStringContainsString('addon_intent=', (string) ($addon->metadata['paypal_success_url'] ?? ''));
$this->assertStringContainsString('addon_intent=', (string) ($addon->metadata['paypal_cancel_url'] ?? ''));
}
public function test_ai_styling_checkout_persists_feature_entitlement_metadata(): void