# mollie/magento2-hyva-checkout architecture

> Architecture diagram of the GitHub repository mollie/magento2-hyva-checkout, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mollie/magento2-hyva-checkout
- Repository: https://github.com/mollie/magento2-hyva-checkout

## Overview

This is a Magento 2 module that brings Mollie payment methods into Hyvä Checkout. The shopper-facing workflow is choosing a supported Mollie method, supplying method-specific details, placing the order, then following any required redirect or wait flow. Additional module behavior includes selecting a default available method, displaying payment icons, and customizing checkout guest-email handling. The tree also shows express, terminal/POS, and fee-summary UI. Source excerpts and the index support only some connections; unverified links between checkout UI and order processing are omitted.

Main entry points: [`src/Magewire/Checkout/PointOfSaleWait.php`](https://github.com/mollie/magento2-hyva-checkout/blob/main/src/Magewire/Checkout/PointOfSaleWait.php) (POS Wait Flow), [`src/Service/PlaceOrderService.php`](https://github.com/mollie/magento2-hyva-checkout/blob/main/src/Service/PlaceOrderService.php) (Place Order), [`src/Observer/SalesQuoteCollectTotalsBefore/SetDefaultSelectedPaymentMethod.php`](https://github.com/mollie/magento2-hyva-checkout/blob/main/src/Observer/SalesQuoteCollectTotalsBefore/SetDefaultSelectedPaymentMethod.php) (Default Method Observer), [`src/Magewire/Checkout/Payment/Method/ApplePay.php`](https://github.com/mollie/magento2-hyva-checkout/blob/main/src/Magewire/Checkout/Payment/Method/ApplePay.php) (Apple Pay State)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_checkout_ui["Checkout UI"]
  node_method_templates["Payment Method Views"]
  node_payment_blocks["Payment Display Blocks"]
  node_fee_summary["Payment Fee Summary"]
end

subgraph group_payment_state["Payment State"]
  node_applepay_state["Apple Pay State<br/>[ApplePay.php]"]
  node_card_state["Card State<br/>[Creditcard.php]"]
  node_issuer_state["Issuer Selection<br/>[WithIssuer.php]"]
  node_terminal_state["Terminal Selection<br/>[WithTerminal.php]"]
  node_express_state["Express Components"]
end

subgraph group_order_flow["Order Flow"]
  node_place_order["Place Order"]
  node_pos_wait["POS Wait Flow"]
  node_express_wait["Express Wait Flow<br/>[WaitPage.php]"]
end

subgraph group_checkout_extensions["Checkout Extensions"]
  node_default_method["Default Method Observer"]
  node_available_methods["Available Methods"]
  node_icon_plugins["Payment Icon Plugins"]
  node_guest_email["Guest Email Modifier"]
end

node_shopper(("Shopper"))
node_checkout["Hyvä Checkout"]
node_mollie_redirect["Mollie Redirect"]
node_order_store[("Order Repository")]
node_mollie_order_api["Mollie Order Services"]
node_payment_method_list["Magento Method List"]

node_shopper -->|"uses"| node_checkout
node_applepay_state -->|"updates quote"| node_checkout
node_place_order -->|"loads order"| node_order_store
node_place_order -->|"requests redirect"| node_mollie_redirect
node_pos_wait -->|"checks status"| node_mollie_order_api
node_pos_wait -->|"resets cart"| node_mollie_order_api
node_pos_wait -->|"gets redirect"| node_mollie_order_api
node_pos_wait -->|"loads order"| node_order_store
node_default_method -->|"gets codes"| node_available_methods
node_default_method -->|"sets selection"| node_payment_method_list
node_available_methods -->|"lists methods"| node_payment_method_list
node_payment_blocks -->|"references"| node_applepay_state

click node_method_templates "https://github.com/mollie/magento2-hyva-checkout/tree/main/src/view/frontend/templates/component/payment/method"
click node_payment_blocks "https://github.com/mollie/magento2-hyva-checkout/tree/main/src/Block/Checkout/Payment"
click node_applepay_state "https://github.com/mollie/magento2-hyva-checkout/blob/main/src/Magewire/Checkout/Payment/Method/ApplePay.php"
click node_card_state "https://github.com/mollie/magento2-hyva-checkout/blob/main/src/Magewire/Checkout/Payment/Method/Creditcard.php"
click node_issuer_state "https://github.com/mollie/magento2-hyva-checkout/blob/main/src/Magewire/Checkout/Payment/Method/WithIssuer.php"
click node_terminal_state "https://github.com/mollie/magento2-hyva-checkout/blob/main/src/Magewire/Checkout/Payment/Method/WithTerminal.php"
click node_express_state "https://github.com/mollie/magento2-hyva-checkout/blob/main/src/Magewire/Checkout/ExpressComponents.php"
click node_place_order "https://github.com/mollie/magento2-hyva-checkout/blob/main/src/Service/PlaceOrderService.php"
click node_pos_wait "https://github.com/mollie/magento2-hyva-checkout/blob/main/src/Magewire/Checkout/PointOfSaleWait.php"
click node_express_wait "https://github.com/mollie/magento2-hyva-checkout/blob/main/src/Magewire/Express/WaitPage.php"
click node_default_method "https://github.com/mollie/magento2-hyva-checkout/blob/main/src/Observer/SalesQuoteCollectTotalsBefore/SetDefaultSelectedPaymentMethod.php"
click node_available_methods "https://github.com/mollie/magento2-hyva-checkout/blob/main/src/Service/Quote/AvailablePaymentMethods.php"
click node_icon_plugins "https://github.com/mollie/magento2-hyva-checkout/blob/main/src/Plugin/PopulateIconData.php"
click node_guest_email "https://github.com/mollie/magento2-hyva-checkout/blob/main/src/Model/Form/EntityFormModifier/GuestDetailsForm/WithEmailSavedEventModifier.php"
click node_fee_summary "https://github.com/mollie/magento2-hyva-checkout/blob/main/src/view/frontend/templates/checkout/price-summary/total-segments/mollie_payment_fee.phtml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_method_templates,node_payment_blocks,node_fee_summary toneBlue
class node_applepay_state,node_card_state,node_issuer_state,node_terminal_state,node_express_state,node_order_store toneAmber
class node_place_order,node_pos_wait,node_express_wait toneMint
class node_default_method,node_available_methods,node_icon_plugins,node_guest_email toneRose
class node_shopper,node_checkout,node_mollie_redirect,node_mollie_order_api,node_payment_method_list toneIndigo
```

## Components

### Checkout UI

- [Payment Method Views](https://github.com/mollie/magento2-hyva-checkout/tree/main/src/view/frontend/templates/component/payment/method): `src/view/frontend/templates/component/payment/method`
- [Payment Display Blocks](https://github.com/mollie/magento2-hyva-checkout/tree/main/src/Block/Checkout/Payment): `src/Block/Checkout/Payment`
- [Payment Fee Summary](https://github.com/mollie/magento2-hyva-checkout/blob/main/src/view/frontend/templates/checkout/price-summary/total-segments/mollie_payment_fee.phtml): `src/view/frontend/templates/checkout/price-summary/total-segments/mollie_payment_fee.phtml`

### Payment State

- [Apple Pay State](https://github.com/mollie/magento2-hyva-checkout/blob/main/src/Magewire/Checkout/Payment/Method/ApplePay.php): `src/Magewire/Checkout/Payment/Method/ApplePay.php`
- [Card State](https://github.com/mollie/magento2-hyva-checkout/blob/main/src/Magewire/Checkout/Payment/Method/Creditcard.php): `src/Magewire/Checkout/Payment/Method/Creditcard.php`
- [Issuer Selection](https://github.com/mollie/magento2-hyva-checkout/blob/main/src/Magewire/Checkout/Payment/Method/WithIssuer.php): `src/Magewire/Checkout/Payment/Method/WithIssuer.php`
- [Terminal Selection](https://github.com/mollie/magento2-hyva-checkout/blob/main/src/Magewire/Checkout/Payment/Method/WithTerminal.php): `src/Magewire/Checkout/Payment/Method/WithTerminal.php`
- [Express Components](https://github.com/mollie/magento2-hyva-checkout/blob/main/src/Magewire/Checkout/ExpressComponents.php): `src/Magewire/Checkout/ExpressComponents.php`

### Order Flow

- [Place Order](https://github.com/mollie/magento2-hyva-checkout/blob/main/src/Service/PlaceOrderService.php): `src/Service/PlaceOrderService.php`
- [POS Wait Flow](https://github.com/mollie/magento2-hyva-checkout/blob/main/src/Magewire/Checkout/PointOfSaleWait.php): `src/Magewire/Checkout/PointOfSaleWait.php`
- [Express Wait Flow](https://github.com/mollie/magento2-hyva-checkout/blob/main/src/Magewire/Express/WaitPage.php): `src/Magewire/Express/WaitPage.php`

### Checkout Extensions

- [Default Method Observer](https://github.com/mollie/magento2-hyva-checkout/blob/main/src/Observer/SalesQuoteCollectTotalsBefore/SetDefaultSelectedPaymentMethod.php): `src/Observer/SalesQuoteCollectTotalsBefore/SetDefaultSelectedPaymentMethod.php`
- [Available Methods](https://github.com/mollie/magento2-hyva-checkout/blob/main/src/Service/Quote/AvailablePaymentMethods.php): `src/Service/Quote/AvailablePaymentMethods.php`
- [Payment Icon Plugins](https://github.com/mollie/magento2-hyva-checkout/blob/main/src/Plugin/PopulateIconData.php): `src/Plugin/PopulateIconData.php`
- [Guest Email Modifier](https://github.com/mollie/magento2-hyva-checkout/blob/main/src/Model/Form/EntityFormModifier/GuestDetailsForm/WithEmailSavedEventModifier.php): `src/Model/Form/EntityFormModifier/GuestDetailsForm/WithEmailSavedEventModifier.php`

### Other components

- **Shopper**
- **Hyvä Checkout**
- **Mollie Redirect**
- **Order Repository**
- **Mollie Order Services**
- **Magento Method List**

## Connections

- Shopper → Hyvä Checkout: uses (evidence: `README.md`)
- Apple Pay State → Hyvä Checkout: updates quote (evidence: `src/Magewire/Checkout/Payment/Method/ApplePay.php`)
- Place Order → Order Repository: loads order (evidence: `src/Service/PlaceOrderService.php`)
- Place Order → Mollie Redirect: requests redirect (evidence: `src/Service/PlaceOrderService.php`)
- POS Wait Flow → Mollie Order Services: checks status (evidence: `src/Magewire/Checkout/PointOfSaleWait.php`)
- POS Wait Flow → Mollie Order Services: resets cart (evidence: `src/Magewire/Checkout/PointOfSaleWait.php`)
- POS Wait Flow → Mollie Order Services: gets redirect (evidence: `src/Magewire/Checkout/PointOfSaleWait.php`)
- POS Wait Flow → Order Repository: loads order (evidence: `src/Magewire/Checkout/PointOfSaleWait.php`)
- Default Method Observer → Available Methods: gets codes (evidence: `src/Observer/SalesQuoteCollectTotalsBefore/SetDefaultSelectedPaymentMethod.php`)
- Default Method Observer → Magento Method List: sets selection (evidence: `src/Observer/SalesQuoteCollectTotalsBefore/SetDefaultSelectedPaymentMethod.php`)
- Available Methods → Magento Method List: lists methods (evidence: `src/Service/Quote/AvailablePaymentMethods.php`)
- Payment Display Blocks → Apple Pay State: references (evidence: `src/Block/Checkout/Payment/ApplepayAfter.php`)
