# gcatanese/afpwebhooks architecture

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

- Interactive diagram: https://gitdiagram.com/gcatanese/afpwebhooks
- Repository: https://github.com/gcatanese/afpwebhooks

## Overview

This is a Java/Spring sample for receiving Adyen platform webhooks. Its documented workflow is to receive a POST, validate its HMAC signature, acknowledge valid notifications, and process their payloads. The README also describes configuration, transfer, and report events, and recommends asynchronous processing; the tree shows webhook models and utility classes but no queue or database implementation. No source excerpts were provided, so the relationships below reflect the README’s documented workflow rather than verified method calls.

Main entry points: [`src/main/java/com/adyen/examples/controller/WebhookController.java`](https://github.com/gcatanese/afpwebhooks/blob/main/src/main/java/com/adyen/examples/controller/WebhookController.java) (Webhook handler), [`src/main/java/com/adyen/examples/model/configuration`](https://github.com/gcatanese/afpwebhooks/tree/main/src/main/java/com/adyen/examples/model/configuration) (Webhook models), [`src/main/java/com/adyen/examples/util/EventHandler.java`](https://github.com/gcatanese/afpwebhooks/blob/main/src/main/java/com/adyen/examples/util/EventHandler.java) (Event deserialization), [`src/main/java/com/adyen/examples/Application.java`](https://github.com/gcatanese/afpwebhooks/blob/main/src/main/java/com/adyen/examples/Application.java) (Spring application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingress["Webhook ingress"]
  node_application["Spring application<br/>[Application.java]"]
  node_configuration["App properties"]
  node_controller["Webhook handler"]
end

subgraph group_processing["Validation and processing"]
  node_hmac["HMAC validation<br/>[HMACValidator.java]"]
  node_handler["Event deserialization<br/>[EventHandler.java]"]
  node_async["Queue or database"]
end

subgraph group_domain["Webhook domains"]
  node_models["Webhook models"]
  node_configuration_events["Configuration events"]
  node_transfer_events["Transfer events"]
  node_report_events["Report events"]
end

node_adyen(("Adyen"))

node_adyen -->|"POSTs events"| node_controller
node_application -.->|"hosts handler"| node_controller
node_controller -->|"validates signature"| node_hmac
node_controller -.->|"processes event"| node_handler
node_controller -.->|"may enqueue"| node_async
node_handler -.->|"deserializes payload"| node_models
node_models -->|"maps events"| node_configuration_events
node_models -->|"maps events"| node_transfer_events
node_models -->|"maps events"| node_report_events

click node_application "https://github.com/gcatanese/afpwebhooks/blob/main/src/main/java/com/adyen/examples/Application.java"
click node_configuration "https://github.com/gcatanese/afpwebhooks/blob/main/src/main/java/com/adyen/examples/ApplicationProperty.java"
click node_controller "https://github.com/gcatanese/afpwebhooks/blob/main/src/main/java/com/adyen/examples/controller/WebhookController.java"
click node_hmac "https://github.com/gcatanese/afpwebhooks/blob/main/src/main/java/com/adyen/examples/util/HMACValidator.java"
click node_handler "https://github.com/gcatanese/afpwebhooks/blob/main/src/main/java/com/adyen/examples/util/EventHandler.java"
click node_models "https://github.com/gcatanese/afpwebhooks/tree/main/src/main/java/com/adyen/examples/model/configuration"
click node_configuration_events "https://github.com/gcatanese/afpwebhooks/tree/main/src/main/java/com/adyen/examples/model/configuration"
click node_transfer_events "https://github.com/gcatanese/afpwebhooks/tree/main/src/main/java/com/adyen/examples/model"
click node_report_events "https://github.com/gcatanese/afpwebhooks/tree/main/src/main/java/com/adyen/examples/model"

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_application,node_configuration,node_controller toneBlue
class node_hmac,node_handler,node_async toneAmber
class node_models,node_configuration_events,node_transfer_events,node_report_events toneMint
class node_adyen toneIndigo
```

## Components

### Webhook ingress

- [Spring application](https://github.com/gcatanese/afpwebhooks/blob/main/src/main/java/com/adyen/examples/Application.java): `src/main/java/com/adyen/examples/Application.java`
- [App properties](https://github.com/gcatanese/afpwebhooks/blob/main/src/main/java/com/adyen/examples/ApplicationProperty.java): `src/main/java/com/adyen/examples/ApplicationProperty.java`
- [Webhook handler](https://github.com/gcatanese/afpwebhooks/blob/main/src/main/java/com/adyen/examples/controller/WebhookController.java): `src/main/java/com/adyen/examples/controller/WebhookController.java`

### Validation and processing

- [HMAC validation](https://github.com/gcatanese/afpwebhooks/blob/main/src/main/java/com/adyen/examples/util/HMACValidator.java): `src/main/java/com/adyen/examples/util/HMACValidator.java`
- [Event deserialization](https://github.com/gcatanese/afpwebhooks/blob/main/src/main/java/com/adyen/examples/util/EventHandler.java): `src/main/java/com/adyen/examples/util/EventHandler.java`
- **Queue or database**

### Webhook domains

- [Webhook models](https://github.com/gcatanese/afpwebhooks/tree/main/src/main/java/com/adyen/examples/model/configuration): `src/main/java/com/adyen/examples/model/configuration`
- [Configuration events](https://github.com/gcatanese/afpwebhooks/tree/main/src/main/java/com/adyen/examples/model/configuration): `src/main/java/com/adyen/examples/model/configuration`
- [Transfer events](https://github.com/gcatanese/afpwebhooks/tree/main/src/main/java/com/adyen/examples/model): `src/main/java/com/adyen/examples/model`
- [Report events](https://github.com/gcatanese/afpwebhooks/tree/main/src/main/java/com/adyen/examples/model): `src/main/java/com/adyen/examples/model`

### Other components

- **Adyen**

## Connections

- Adyen → Webhook handler: POSTs events (evidence: `README.md`)
- Spring application → Webhook handler: hosts handler
- Webhook handler → HMAC validation: validates signature (evidence: `README.md`)
- Webhook handler → Event deserialization: processes event (evidence: `README.md`)
- Webhook handler → Queue or database: may enqueue (evidence: `README.md`)
- Event deserialization → Webhook models: deserializes payload (evidence: `README.md`)
- Webhook models → Configuration events: maps events (evidence: `README.md`)
- Webhook models → Transfer events: maps events (evidence: `README.md`)
- Webhook models → Report events: maps events (evidence: `README.md`)
