# audit:allow test-scenario-coverage reason: 본 시나리오는 결제 진입 provider-agnostic 동적 dispatch 인프라(엔진 동적 핸들러 해석 + 이커머스 응답 통로 + checkout 분기 + 편집기 recipe) 회귀 가드. effects 는 계층별(엔진/백엔드/템플릿/편집기)로 enumerate 하며, 개별 axis cross-product 는 test_files 의 단위/렌더/E2E 테스트가 cover (kginicis 플러그인은 본 작업 범위 제외 — 응답이 핸들러명을 미선언하면 분기 미발화로 무영향). feature: 결제(PG) provider-agnostic 동적 dispatch — 응답이 결제 핸들러명 지정 description: | checkout 이 특정 PG(sirsoft-tosspayments)에 하드코딩되던 결제 진입을, 백엔드 응답이 호출할 프론트 결제 핸들러 풀네임(pg_payment_handler)을 내려주고 템플릿이 그대로 dispatch 하는 방식으로 전환. 핸들러명 미선언 PG 는 분기 미발화 → non-PG fallback. 핵심 동작: - 엔진(A): 액션 handler 가 `{{...}}` 바인딩이면 ActionDispatcher.executeAction 이 컨텍스트로 해석한 뒤 라우팅(resolveActionRef 직후, 프리뷰 억제·switch 앞). - 백엔드(B): ecommerce 모듈이 provider 레지스트리(`registered_pg_providers`)의 payment_handler 를 읽어 주문 응답에 pg_payment_handler 통로를 연다. provider 미선언 시 키 부재 → checkout PG 분기 미발화. - 템플릿(C): _checkout_summary.json onSuccess 가 `handler:"{{response.data.pg_payment_handler}}"` 로 dispatch, non-PG fallback(비회원 verify→saveGuestOrderToken→navigate) 보존. - 편집기(E): "결제 진입" recipe(requestPgPayment) 친화 입력(핸들러·결제 데이터 칩, chipContext=response), matchAction placeholder-aware 역매칭(greedy 가드 포함). 비대상: kginicis 등 개별 PG 플러그인(인터셉터/등록명)은 본 작업 범위 밖. axes: requires_pg_payment: [true, false] handler_binding_form: [literal_builtin, literal_custom_dotted, dynamic_response_binding] dispatch_context: [top_level, nested_conditions, nested_sequence] preview_mode: [runtime, editor_preview] resolved_handler_registration: [registered, unregistered] editor_recipe_match: [placeholder_handler_recipe, literal_handler_recipe] exclusions: - { handler_binding_form: literal_builtin, resolved_handler_registration: unregistered, reason: "빌트인 핸들러는 항상 라우팅 가능 — 미등록 케이스 없음" } - { dispatch_context: nested_sequence, editor_recipe_match: placeholder_handler_recipe, reason: "편집기 역매칭은 단일 액션 단위 — sequence 내부 트리는 advanced 분류" } effects: - dynamic_handler_binding_resolved_before_routing - literal_builtin_handler_skips_binding_resolution - literal_custom_dotted_handler_skips_binding_resolution - resolved_handler_routed_to_registered_custom_handler - resolved_params_passed_to_dynamic_handler - nested_conditions_dynamic_handler_resolved - nested_sequence_dynamic_handler_resolved - preview_suppression_judged_on_resolved_handler_name - unregistered_resolved_handler_graceful_skip_in_preview - provider_registry_entry_carries_payment_handler_key - order_response_includes_pg_payment_handler_when_provider_declares_it - order_response_omits_pg_payment_handler_when_provider_undeclared - checkout_dispatches_response_payment_handler - checkout_pg_branch_skipped_when_no_payment_handler - checkout_non_pg_fallback_preserved_guest_verify_chain - editor_request_pg_payment_recipe_builds_dynamic_handler - editor_match_action_placeholder_handler_reverse_matches - editor_match_action_literal_handler_unaffected_regression - editor_placeholder_recipe_not_greedy_for_unrelated_actions - editor_response_chip_candidates_expose_pg_payment_handler_and_data test_files: - resources/js/core/template-engine/__tests__/ActionDispatcher.dynamicHandler.test.ts - resources/js/core/template-engine/layout-editor/__tests__/spec/actionRecipeEngine.test.ts - resources/js/core/template-engine/layout-editor/__tests__/spec/coreActionRecipes.test.ts - templates/_bundled/sirsoft-basic/__tests__/layouts/checkout-pg-dynamic-dispatch.test.tsx - modules/_bundled/sirsoft-ecommerce/tests/Unit/Services/OrderResponsePaymentHandlerTest.php e2e_files: - tests/Playwright/specs/checkout-pg-dynamic-dispatch.spec.ts notes: | 엔진 동적 핸들러 해석은 Pure Logic(ActionDispatcher 단위). provider→응답 매핑은 PHPUnit(트레이트 stub + 필터 훅). checkout 분기는 레이아웃 구조 + ConditionEvaluator 라운드트립. 편집기 recipe/matchAction 은 actionRecipeEngine 단위(라운드트립 + greedy 가드 회귀). 브라우저 실측은 결제 진입이 응답 pg_payment_handler dispatch 로 결제창 도달(개별 PG 플러그인 동작은 그 플러그인 소관).