diff --git a/.paul/PROJECT.md b/.paul/PROJECT.md index 50b468a..ef9df2b 100644 --- a/.paul/PROJECT.md +++ b/.paul/PROJECT.md @@ -15,6 +15,8 @@ Uzytkownicy moga szybko i bezpiecznie kupic bilety online oraz otrzymac natychmi - [x] Event purchase capturuje 100% zamowien - fires przy skladaniu, nie przy powrocie z P24 (Phase 2) - [x] Zgodnosc z RODO - baner zgody na cookies z Google Consent Mode v2 (Phase 3) - [x] Baner cookies dziala bez bledu `injectScripts is not defined` (Phase 4) +- [x] Event purchase ma zabezpieczenie przed duplikatem przy odswiezeniu strony Przelewy24 (Phase 5) +- [x] Przekierowanie do Przelewy24 dziala automatycznie po 5 sekundach z czytelnym komunikatem (Phase 5) ### Should Have - [x] Spojny tracking analityczny dla zdarzen ecommerce @@ -38,6 +40,8 @@ Uzytkownicy moga szybko i bezpiecznie kupic bilety online oraz otrzymac natychmi | cookieNoticePro.init() zamiast $.fn.cookieNoticePro() | Phase 3 | Zgodnie z dokumentacja biblioteki | | Consent Mode v2 default-denied przed GTM snippetem | Phase 3 | Wymog Google od marca 2024 | | Usuniecie niezdefiniowanego injectScripts() | Phase 4 | Naprawia blad konsoli przy cookies bez zmiany GTM/Consent Mode | +| Purchase guard w sessionStorage per transaction_id | Phase 5 | Chroni przed duplikatem eventu przy odswiezeniu strony | +| Restore zapisanych zgod przed GTM | Phase 5 | Purchase uruchamia sie z poprawnym stanem Consent Mode | ## Success Criteria - Event purchase trafia do data layer po zlozeniu zamowienia (osiagniete - Phase 2) @@ -45,7 +49,9 @@ Uzytkownicy moga szybko i bezpiecznie kupic bilety online oraz otrzymac natychmi - Integracja nie wplywa negatywnie na istniejacy checkout - Baner cookies zgodny z RODO + Google Consent Mode v2 (osiagniete - Phase 3) - Baner cookies nie generuje bledu `injectScripts is not defined` (osiagniete - Phase 4) +- Purchase nie duplikuje sie po odswiezeniu strony Przelewy24 w tej samej sesji przegladarki (osiagniete - Phase 5) +- Przelewy24 redirect jest automatyczny i poprzedzony czytelnym alertem z odliczaniem (osiagniete - Phase 5) --- *Created: 2026-04-19 20:20* -*Last updated: 2026-05-08 after Phase 4 (v0.3 hotfix complete)* +*Last updated: 2026-05-08 after Phase 5 (v0.4 complete)* diff --git a/.paul/ROADMAP.md b/.paul/ROADMAP.md index da053c1..adcfa40 100644 --- a/.paul/ROADMAP.md +++ b/.paul/ROADMAP.md @@ -1,15 +1,19 @@ # Roadmap: bilety.brzezovka.pl ## Overview -Projekt obejmuje sprzedaz biletow online, tracking ecommerce oraz zgodnosc cookies/RODO. Ostatnia iteracja to hotfix banera cookies po wykryciu bledu JavaScript w CookieNoticePro. +Projekt obejmuje sprzedaz biletow online, tracking ecommerce oraz zgodnosc cookies/RODO. Aktualna iteracja domyka tracking purchase na stronie Przelewy24: jednorazowe odpalenie eventu, poprawne zgody i automatyczne przekierowanie do platnosci. ## Current Milestone -**v0.3 Cookie Notice Hotfix** (v0.3.0) +**v0.4 Purchase Redirect Hardening** (v0.4.0) Status: Complete (2026-05-08) Phases: 1 of 1 complete ## Previous Milestones +### v0.3 Cookie Notice Hotfix +Status: Complete (2026-05-08) +Phases: 1 of 1 complete + ### v0.2 Analytics & Privacy Status: Complete (2026-04-26) Phases: 3 of 3 complete @@ -26,6 +30,7 @@ Phases: 1 of 1 complete | 2 | Purchase Event Pre-Payment | 1 | Complete | 2026-04-26 | | 3 | Cookie Consent Banner | 1 | Complete | 2026-04-26 | | 4 | Cookie Notice Bugfix | 1 | Complete | 2026-05-08 | +| 5 | Purchase Redirect Hardening | 1 | Complete | 2026-05-08 | ## Phase Details @@ -42,18 +47,7 @@ Phases: 1 of 1 complete ### Phase 2: Purchase Event Pre-Payment (Complete) **Goal:** Przeniesc event purchase do momentu przekierowania na bramke platnicza po zlozeniu zamowienia, przed platnoscia Przelewy24. -**Depends on:** Phase 1 (purchase payload builder already implemented) -**Research:** Not needed - -**Context:** -- GTM (GTM-TW9WCD9J) jest wdrozony w `templates/site/layout-logged.php`. -- Event purchase zostal przeniesiony na strone `przelewy24`. -- Strona `przelewy24.php` auto-submits formularz, wiec tracking korzysta z beacon transport. - -**Scope:** -- Wywolanie `buildPurchaseDataLayer()` w metodzie `przelewy24()` kontrolera. -- Dodanie dataLayer push do `templates/tickets/przelewy24.php`. -- Usuniecie purchase push z `templates/tickets/order-confirm.php`. +**Depends on:** Phase 1 **Plans:** - [x] 02-01: Przeniesienie eventu purchase na strone przelewy24 (UNIFY complete) @@ -64,18 +58,6 @@ Phases: 1 of 1 complete **Goal:** Wdrozyc baner zgody na cookies (CookieNoticePro) z Google Consent Mode v2 i naprawic blad analityki w bibliotece. **Depends on:** Phase 2 -**Research:** Not needed - -**Context:** -- Biblioteka: `libraries/CookieNoticePro/`. -- Consent Mode v2 musi byc przed snippetem GTM w `
`. -- Tylko `templates/site/layout-logged.php` jest uzywany przez glowne widoki. - -**Scope:** -- Pliki CookieNoticePro w `libraries/CookieNoticePro/`. -- Naprawa `analytics_storage: denied` przy braku zgody analytics. -- Consent Mode v2 default przed GTM w `layout-logged.php`. -- Integracja CSS/JS banera + inicjalizacja `cookieNoticePro.init()`. **Plans:** - [x] 03-01: Integracja CookieNoticePro + Consent Mode v2 (UNIFY complete) @@ -85,22 +67,33 @@ Phases: 1 of 1 complete ### Phase 4: Cookie Notice Bugfix (Complete) **Goal:** Naprawic blad JavaScript `Uncaught ReferenceError: injectScripts is not defined` w CookieNoticePro. -**Depends on:** Phase 3 (CookieNoticePro already integrated) -**Research:** Not needed (root cause is visible in local source) - -**Context:** -- `libraries/CookieNoticePro/cookienoticepro.script.js` wywolywal `injectScripts()` w dwoch miejscach. -- Funkcja `injectScripts` nie istnieje w tej kopii biblioteki. -- Blad wystepowal po kliknieciu akceptacji cookies oraz mogl wystapic przy inicjalizacji z zapisanymi zgodami. - -**Scope:** -- Usuniecie wywolan `injectScripts()`. -- Zachowanie `cookieNoticePro.init()` w `templates/site/layout-logged.php`. -- Zachowanie Google Consent Mode v2 i GTM bez zmian. +**Depends on:** Phase 3 **Plans:** - [x] 04-01: Naprawa undefined `injectScripts` w CookieNoticePro (UNIFY complete) +--- + +### Phase 5: Purchase Redirect Hardening + +**Goal:** Zabezpieczyc `purchase` przed ponownym wywolaniem po odswiezeniu strony Przelewy24 i przywrocic automatyczne przekierowanie do Przelewy24 po 5 sekundach z widocznym odliczaniem. +**Depends on:** Phase 2 (purchase pre-payment), Phase 3/4 (CookieNoticePro + Consent Mode) +**Research:** Not needed + +**Context:** +- `purchase` jest wypychany w `templates/tickets/przelewy24.php`. +- Manualny test potwierdzil, ze event uruchamia sie poprawnie po zatrzymaniu auto-submit. +- Zapisane zgody cookies musza byc przywrocone przed GTM i przed `purchase`. +- Obecny przycisk byl tylko tymczasowy do testu. + +**Scope:** +- Client-side guard w `templates/tickets/przelewy24.php` na bazie `sessionStorage` i `transaction_id`. +- Komunikat + countdown 5s + automatyczny submit formularza Przelewy24. +- Zachowanie restore zgody w `templates/site/layout-logged.php`. + +**Plans:** +- [x] 05-01: Jednorazowy purchase + redirect countdown do Przelewy24 (UNIFY complete) + --- *Roadmap created: 2026-04-19* -*Last updated: 2026-05-08 - v0.3 Cookie Notice Hotfix complete* +*Last updated: 2026-05-08 - v0.4 Purchase Redirect Hardening complete* diff --git a/.paul/STATE.md b/.paul/STATE.md index a89d4be..ca87a40 100644 --- a/.paul/STATE.md +++ b/.paul/STATE.md @@ -5,19 +5,19 @@ See: .paul/PROJECT.md (updated 2026-05-08) **Core value:** Uzytkownicy moga szybko i bezpiecznie kupic bilety online oraz otrzymac natychmiastowe potwierdzenie zakupu. -**Current focus:** v0.3 Cookie Notice Hotfix - COMPLETE +**Current focus:** v0.4 Purchase Redirect Hardening - COMPLETE ## Current Position -Milestone: v0.3 Cookie Notice Hotfix - COMPLETE -Phase: 1 of 1 (Cookie Notice Bugfix) - Complete -Plan: 04-01 complete +Milestone: v0.4 Purchase Redirect Hardening - COMPLETE +Phase: 1 of 1 (Purchase Redirect Hardening) - Complete +Plan: 05-01 complete Status: Milestone complete - ready for next milestone -Last activity: 2026-05-08 - Phase 4 complete, v0.3 hotfix shipped +Last activity: 2026-05-08 - Phase 5 complete, v0.4 shipped Progress: - Milestone: [##########] 100% -- Phase 4: [##########] 100% +- Phase 5: [##########] 100% ## Loop Position @@ -44,19 +44,16 @@ Documents: `.paul/codebase/` (8 files - stack, architecture, structure, conventi - 2026-04-26: `cookieNoticePro.init()` used instead of `$.fn.cookieNoticePro()`. - 2026-04-26: Consent Mode v2 default-denied initialized before the GTM snippet. - 2026-05-08: Undefined `injectScripts()` calls removed from CookieNoticePro instead of adding a no-op stub. +- 2026-05-08: Manual redirect pause confirmed purchase fires; saved consent must be restored before GTM/purchase. -### Cookie Consent (Phase 3 - COMPLETE) -- Library: `libraries/CookieNoticePro/`. -- Analytics denied bug fixed around line 351. -- Additional fixes: CSS initial hide for `acceptBtnSettingsLabel`, Bootstrap 5 compatibility reset. -- Consent Mode v2 init is before the GTM snippet in `templates/site/layout-logged.php`. - -### Cookie Notice Hotfix (Phase 4 - COMPLETE) -- Reported browser error: `Uncaught ReferenceError: injectScripts is not defined`. -- Root cause: `libraries/CookieNoticePro/cookienoticepro.script.js` called `injectScripts()` but this function was absent in the local library copy. -- Applied fix: removed both `injectScripts()` calls from `libraries/CookieNoticePro/cookienoticepro.script.js`. -- Verification passed: no `injectScripts` references remain, `node --check` passes, and layout still contains Consent Mode v2, GTM, and `cookieNoticePro.init()`. -- Summary: `.paul/phases/04-cookie-notice-bugfix/04-01-SUMMARY.md`. +### Current Plan Context +- Plan path: `.paul/phases/05-purchase-redirect-hardening/05-01-PLAN.md`. +- Current uncommitted source changes include `templates/site/layout-logged.php` consent restore and `templates/tickets/przelewy24.php` temporary manual redirect button. +- Applied changes: `templates/tickets/przelewy24.php` now guards purchase with `sessionStorage` per transaction and auto-submits to Przelewy24 after a 5-second countdown; `templates/site/layout-logged.php` preserves saved consent restore before GTM. +- Final UI adjustment: visible fallback button removed; redirect message is a centered Bootstrap alert with countdown. +- Verification passed: PHP lint for both modified templates, grep checks for purchase guard/countdown/consent restore, and user browser approval. +- Summary: `.paul/phases/05-purchase-redirect-hardening/05-01-SUMMARY.md`. +- Existing unrelated uncommitted change: `.vscode/ftp-kr.sync.cache.json` must remain untouched. ### Deferred Issues None. @@ -65,16 +62,16 @@ None. None. ### Git State -Last commit: current phase commit (`feat(04-cookie-notice-bugfix): fix CookieNoticePro injectScripts error`) +Last commit: current phase commit (`feat(05-purchase-redirect-hardening): harden purchase redirect tracking`) Branch: main Feature branches merged: none ## Session Continuity Last session: 2026-05-08 -Stopped at: v0.3 hotfix milestone complete +Stopped at: v0.4 milestone complete Next action: Start next milestone when needed -Resume file: .paul/phases/04-cookie-notice-bugfix/04-01-SUMMARY.md +Resume file: .paul/phases/05-purchase-redirect-hardening/05-01-SUMMARY.md --- *STATE.md - Updated after every significant action* diff --git a/.paul/changelog/2026-05-08.md b/.paul/changelog/2026-05-08.md index 6be8668..2eb0f2f 100644 --- a/.paul/changelog/2026-05-08.md +++ b/.paul/changelog/2026-05-08.md @@ -5,6 +5,9 @@ - [Phase 4, Plan 01] Naprawiono blad `Uncaught ReferenceError: injectScripts is not defined` w CookieNoticePro. - Usunieto dwa wywolania niezdefiniowanego `injectScripts()` z obslugi akceptacji cookies i inicjalizacji przy zapisanej zgodzie. - Zweryfikowano skladnie pliku JS oraz obecnosc `cookieNoticePro.init()`, Consent Mode v2 i GTM w layoucie. +- [Phase 5, Plan 01] Zabezpieczono `purchase` przed ponownym wywolaniem po odswiezeniu strony Przelewy24. +- Dodano restore zapisanych zgod cookies przed GTM, aby `purchase` korzystalo z poprawnego Consent Mode. +- Przywrocono automatyczne przekierowanie do Przelewy24 po 5 sekundach z wycentrowanym alertem i odliczaniem. ## Zmienione pliki @@ -13,3 +16,8 @@ - `.paul/phases/04-cookie-notice-bugfix/04-01-SUMMARY.md` - `.paul/STATE.md` - `.paul/ROADMAP.md` +- `templates/tickets/przelewy24.php` +- `templates/site/layout-logged.php` +- `.paul/phases/05-purchase-redirect-hardening/05-01-PLAN.md` +- `.paul/phases/05-purchase-redirect-hardening/05-01-SUMMARY.md` +- `.paul/PROJECT.md` diff --git a/.paul/phases/05-purchase-redirect-hardening/05-01-PLAN.md b/.paul/phases/05-purchase-redirect-hardening/05-01-PLAN.md new file mode 100644 index 0000000..494a9bb --- /dev/null +++ b/.paul/phases/05-purchase-redirect-hardening/05-01-PLAN.md @@ -0,0 +1,165 @@ +--- +phase: 05-purchase-redirect-hardening +plan: 01 +type: execute +wave: 1 +depends_on: [] +files_modified: + - templates/tickets/przelewy24.php + - templates/site/layout-logged.php +autonomous: true +delegation: off +--- + +Za chwile nastapi automatyczne przejscie do Przelewy24.
++ Pozostalo + 5 s +
+