# cybersource/cybersource-unified-checkout-sample-java architecture

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

- Interactive diagram: https://gitdiagram.com/cybersource/cybersource-unified-checkout-sample-java
- Repository: https://github.com/cybersource/cybersource-unified-checkout-sample-java

## Overview

This is a Spring Boot/Thymeleaf sample for Cybersource Unified Checkout, with an additional Click to Pay Drop-in UI and payer-authentication/payment-related screens and services. The documented user journey is to open the local checkout page, use the hosted checkout widget, and let the sample invoke Cybersource’s REST client. The README also documents the widget’s handling of payment data and Flex API calls. No source excerpts were provided, so links between local controllers, services, and screens are omitted rather than inferred from filenames.

Main entry points: [`src/main/resources/templates/checkout.html`](https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/resources/templates/checkout.html) (Checkout page), [`src/main/java/com/cybersource/example/UnifiedCheckoutApplication.java`](https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/java/com/cybersource/example/UnifiedCheckoutApplication.java) (Sample application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_app["Sample application"]
  node_checkout_page["Checkout page<br/>[checkout.html]"]
  node_uc_controller["Unified Checkout controller"]
  node_ctp_controller["Click to Pay controller"]
  node_ctp_page["Click to Pay overview"]
  node_uc_page["Unified Checkout overview<br/>[uc-overview.html]"]
  node_auth_setup_page["Authentication setup"]
  node_auth_enrollment_page["Authentication enrollment"]
  node_auth_validation_page["Authentication validation"]
  node_credentials_page["Credentials page"]
  node_receipt_page["Receipt page<br/>[receipt.html]"]
end

subgraph group_checkout["Checkout services"]
  node_capture_service["Capture context"]
  node_jwt_service["JWT processing"]
end

subgraph group_payment["Payment services"]
  node_payment_service["Payments"]
  node_credentials_service["Payment credentials"]
  node_auth_service["Payer authentication"]
end

subgraph group_models["Request and response models"]
  node_capture_response["Capture context response"]
  node_jwk["JWK model<br/>[JWK.java]"]
end

node_user(("Customer"))
node_hosted_widget["Hosted checkout widget"]
node_cybersource["Cybersource services"]

node_user -->|"opens"| node_checkout_page
node_checkout_page -->|"embeds"| node_hosted_widget
node_hosted_widget -->|"calls Flex API"| node_cybersource
node_app -->|"invokes REST client"| node_cybersource

click node_app "https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/java/com/cybersource/example/UnifiedCheckoutApplication.java"
click node_checkout_page "https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/resources/templates/checkout.html"
click node_uc_controller "https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/java/com/cybersource/example/web/UnifiedCheckoutController.java"
click node_ctp_controller "https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/java/com/cybersource/example/web/ClickToPayDropInUIController.java"
click node_capture_service "https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/java/com/cybersource/example/service/CaptureContextService.java"
click node_jwt_service "https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/java/com/cybersource/example/service/JwtProcessorService.java"
click node_payment_service "https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/java/com/cybersource/example/service/PaymentsService.java"
click node_credentials_service "https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/java/com/cybersource/example/service/PaymentCredentialsService.java"
click node_auth_service "https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/java/com/cybersource/example/service/PayerAuthenticationService.java"
click node_capture_response "https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/java/com/cybersource/example/domain/CaptureContextResponseBody.java"
click node_jwk "https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/java/com/cybersource/example/domain/JWK.java"
click node_ctp_page "https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/resources/templates/ctp-drop-in-ui-overview.html"
click node_uc_page "https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/resources/templates/uc-overview.html"
click node_auth_setup_page "https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/resources/templates/payer-authentication-setup.html"
click node_auth_enrollment_page "https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/resources/templates/payer-authentication-enrollment.html"
click node_auth_validation_page "https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/resources/templates/payer-authentication-validation.html"
click node_credentials_page "https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/resources/templates/payment-credentials.html"
click node_receipt_page "https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/resources/templates/receipt.html"

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_app,node_checkout_page,node_uc_controller,node_ctp_controller,node_ctp_page,node_uc_page,node_auth_setup_page,node_auth_enrollment_page,node_auth_validation_page,node_credentials_page,node_receipt_page toneBlue
class node_capture_service,node_jwt_service toneAmber
class node_payment_service,node_credentials_service,node_auth_service toneMint
class node_capture_response,node_jwk toneRose
class node_user,node_hosted_widget,node_cybersource toneIndigo
```

## Components

### Web experience

- [Sample application](https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/java/com/cybersource/example/UnifiedCheckoutApplication.java): `src/main/java/com/cybersource/example/UnifiedCheckoutApplication.java`
- [Checkout page](https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/resources/templates/checkout.html): `src/main/resources/templates/checkout.html`
- [Unified Checkout controller](https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/java/com/cybersource/example/web/UnifiedCheckoutController.java): `src/main/java/com/cybersource/example/web/UnifiedCheckoutController.java`
- [Click to Pay controller](https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/java/com/cybersource/example/web/ClickToPayDropInUIController.java): `src/main/java/com/cybersource/example/web/ClickToPayDropInUIController.java`
- [Click to Pay overview](https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/resources/templates/ctp-drop-in-ui-overview.html): `src/main/resources/templates/ctp-drop-in-ui-overview.html`
- [Unified Checkout overview](https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/resources/templates/uc-overview.html): `src/main/resources/templates/uc-overview.html`
- [Authentication setup](https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/resources/templates/payer-authentication-setup.html): `src/main/resources/templates/payer-authentication-setup.html`
- [Authentication enrollment](https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/resources/templates/payer-authentication-enrollment.html): `src/main/resources/templates/payer-authentication-enrollment.html`
- [Authentication validation](https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/resources/templates/payer-authentication-validation.html): `src/main/resources/templates/payer-authentication-validation.html`
- [Credentials page](https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/resources/templates/payment-credentials.html): `src/main/resources/templates/payment-credentials.html`
- [Receipt page](https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/resources/templates/receipt.html): `src/main/resources/templates/receipt.html`

### Checkout services

- [Capture context](https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/java/com/cybersource/example/service/CaptureContextService.java): `src/main/java/com/cybersource/example/service/CaptureContextService.java`
- [JWT processing](https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/java/com/cybersource/example/service/JwtProcessorService.java): `src/main/java/com/cybersource/example/service/JwtProcessorService.java`

### Payment services

- [Payments](https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/java/com/cybersource/example/service/PaymentsService.java): `src/main/java/com/cybersource/example/service/PaymentsService.java`
- [Payment credentials](https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/java/com/cybersource/example/service/PaymentCredentialsService.java): `src/main/java/com/cybersource/example/service/PaymentCredentialsService.java`
- [Payer authentication](https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/java/com/cybersource/example/service/PayerAuthenticationService.java): `src/main/java/com/cybersource/example/service/PayerAuthenticationService.java`

### Request and response models

- [Capture context response](https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/java/com/cybersource/example/domain/CaptureContextResponseBody.java): `src/main/java/com/cybersource/example/domain/CaptureContextResponseBody.java`
- [JWK model](https://github.com/cybersource/cybersource-unified-checkout-sample-java/blob/main/src/main/java/com/cybersource/example/domain/JWK.java): `src/main/java/com/cybersource/example/domain/JWK.java`

### Other components

- **Customer**
- **Hosted checkout widget**
- **Cybersource services**

## Connections

- Customer → Checkout page: opens (evidence: `README.md`)
- Checkout page → Hosted checkout widget: embeds (evidence: `README.md`)
- Hosted checkout widget → Cybersource services: calls Flex API (evidence: `README.md`)
- Sample application → Cybersource services: invokes REST client (evidence: `README.md`)
