# vr-payment/shopware-6 architecture

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

- Interactive diagram: https://gitdiagram.com/vr-payment/shopware-6
- Repository: https://github.com/vr-payment/shopware-6

## Overview

This Shopware 6 plugin integrates VR Payment into merchant administration and storefront checkout. The customer flow selects a payment method, creates or resumes a VR Payment transaction, and presents the payment experience; webhook callbacks update transaction/order state. Merchant capabilities include configuration, payment-method synchronization, captures and refunds, invoices, and recurring subscriptions. The graph preserves these documented branches, but several links rely on README statements or SOURCE INDEX references because their implementation excerpts were not provided; those limits are reflected in the evidence paths.

Main entry points: [`src/Resources/app/administration/src/init/api-service.init.js`](https://github.com/vr-payment/shopware-6/blob/master/src/Resources/app/administration/src/init/api-service.init.js) (Admin API clients), [`src/Core/Api/Transaction/Service/TransactionService.php`](https://github.com/vr-payment/shopware-6/blob/master/src/Core/Api/Transaction/Service/TransactionService.php) (Transactions), [`src/Core/Settings/Service/SettingsService.php`](https://github.com/vr-payment/shopware-6/blob/master/src/Core/Settings/Service/SettingsService.php) (Settings service), [`src/Core/Api/Refund/Service/RefundService.php`](https://github.com/vr-payment/shopware-6/blob/master/src/Core/Api/Refund/Service/RefundService.php) (Refund service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_admin["Merchant administration"]
  node_admin_ui["Admin UI<br/>[index.js]"]
  node_admin_settings["Settings UI<br/>[index.js]"]
  node_admin_services["Admin API clients"]
  node_admin_refund["Refund actions<br/>[index.js]"]
end

subgraph group_checkout["Checkout and payment"]
  node_checkout_ui["Checkout page"]
  node_payment_handler["Payment handler"]
  node_payment_filter["Payment method filter"]
  node_subscription["Subscription orders"]
  node_invoice["Invoice access<br/>[InvoiceService.php]"]
end

subgraph group_transactions["Transaction operations"]
  node_transaction_service["Transactions"]
  node_transaction_api["Transaction endpoints"]
  node_capture_api["Capture and void"]
  node_refund_api["Refund endpoints"]
  node_refund_service["Refund service<br/>[RefundService.php]"]
end

subgraph group_integration["Configuration and callbacks"]
  node_configuration["Configuration API"]
  node_payment_methods["Payment method sync"]
  node_settings["Settings service"]
  node_webhook_controller["Webhook receiver"]
  node_webhook_service["Webhook registration"]
end

node_merchant(("Merchant"))
node_customer(("Customer"))
node_shopware["Shopware"]
node_vr_api["VR Payment API"]

node_merchant -->|"configures"| node_admin_settings
node_merchant -->|"manages payments"| node_admin_ui
node_admin_ui -->|"uses clients"| node_admin_services
node_admin_settings -->|"uses clients"| node_admin_services
node_admin_services -.->|"calls"| node_configuration
node_admin_services -.->|"calls"| node_refund_api
node_admin_refund -.->|"requests refunds"| node_admin_services
node_configuration -->|"reads settings"| node_settings
node_configuration -->|"synchronizes methods"| node_payment_methods
node_customer -->|"starts checkout"| node_checkout_ui
node_checkout_ui -.->|"selects payment"| node_payment_handler
node_payment_handler -->|"creates transaction"| node_transaction_service
node_payment_filter -->|"filters methods"| node_payment_methods
node_transaction_service -->|"loads credentials"| node_settings
node_transaction_service -->|"creates transactions"| node_vr_api
node_transaction_api -->|"delegates"| node_transaction_service
node_capture_api -->|"loads credentials"| node_settings
node_capture_api -.->|"captures transactions"| node_vr_api
node_refund_api -->|"creates refunds"| node_refund_service
node_refund_service -->|"loads credentials"| node_settings
node_refund_service -->|"submits refunds"| node_vr_api
node_vr_api -.->|"sends callbacks"| node_webhook_controller
node_webhook_controller -->|"updates transactions"| node_transaction_service
node_webhook_controller -->|"updates refunds"| node_refund_service
node_webhook_service -->|"loads credentials"| node_settings
node_payment_handler -.->|"supports recurring"| node_subscription
node_customer -.->|"downloads invoice"| node_invoice

click node_admin_ui "https://github.com/vr-payment/shopware-6/blob/master/src/Resources/app/administration/src/module/vrpayment-order/index.js"
click node_admin_settings "https://github.com/vr-payment/shopware-6/blob/master/src/Resources/app/administration/src/module/vrpayment-settings/index.js"
click node_admin_services "https://github.com/vr-payment/shopware-6/blob/master/src/Resources/app/administration/src/init/api-service.init.js"
click node_admin_refund "https://github.com/vr-payment/shopware-6/blob/master/src/Resources/app/administration/src/module/vrpayment-order/component/vrpayment-order-action-refund/index.js"
click node_configuration "https://github.com/vr-payment/shopware-6/blob/master/src/Core/Api/Configuration/Controller/ConfigurationController.php"
click node_payment_methods "https://github.com/vr-payment/shopware-6/blob/master/src/Core/Api/PaymentMethodConfiguration/Service/PaymentMethodConfigurationService.php"
click node_settings "https://github.com/vr-payment/shopware-6/blob/master/src/Core/Settings/Service/SettingsService.php"
click node_checkout_ui "https://github.com/vr-payment/shopware-6/blob/master/src/Core/Storefront/Checkout/Controller/CheckoutController.php"
click node_payment_handler "https://github.com/vr-payment/shopware-6/blob/master/src/Core/Checkout/PaymentHandler/VRPaymentPaymentHandler.php"
click node_payment_filter "https://github.com/vr-payment/shopware-6/blob/master/src/Core/Checkout/Service/PaymentMethodFilterService.php"
click node_transaction_service "https://github.com/vr-payment/shopware-6/blob/master/src/Core/Api/Transaction/Service/TransactionService.php"
click node_transaction_api "https://github.com/vr-payment/shopware-6/blob/master/src/Core/Api/Transaction/Controller/TransactionController.php"
click node_capture_api "https://github.com/vr-payment/shopware-6/blob/master/src/Core/Api/Transaction/Controller/TransactionCompletionController.php"
click node_refund_api "https://github.com/vr-payment/shopware-6/blob/master/src/Core/Api/Refund/Controller/RefundController.php"
click node_refund_service "https://github.com/vr-payment/shopware-6/blob/master/src/Core/Api/Refund/Service/RefundService.php"
click node_webhook_controller "https://github.com/vr-payment/shopware-6/blob/master/src/Core/Api/WebHooks/Controller/WebHookController.php"
click node_webhook_service "https://github.com/vr-payment/shopware-6/blob/master/src/Core/Api/WebHooks/Service/WebHooksService.php"
click node_subscription "https://github.com/vr-payment/shopware-6/blob/master/src/Core/Checkout/Subscription/Command/GenerateSubscriptionOrderCommand.php"
click node_invoice "https://github.com/vr-payment/shopware-6/blob/master/src/Core/Checkout/Service/InvoiceService.php"

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_admin_ui,node_admin_settings,node_admin_services,node_admin_refund toneBlue
class node_checkout_ui,node_payment_handler,node_payment_filter,node_subscription,node_invoice toneAmber
class node_transaction_service,node_transaction_api,node_capture_api,node_refund_api,node_refund_service,node_vr_api toneMint
class node_configuration,node_payment_methods,node_settings,node_webhook_controller,node_webhook_service toneRose
class node_merchant,node_customer,node_shopware toneIndigo
```

## Components

### Merchant administration

- [Admin UI](https://github.com/vr-payment/shopware-6/blob/master/src/Resources/app/administration/src/module/vrpayment-order/index.js): `src/Resources/app/administration/src/module/vrpayment-order/index.js`
- [Settings UI](https://github.com/vr-payment/shopware-6/blob/master/src/Resources/app/administration/src/module/vrpayment-settings/index.js): `src/Resources/app/administration/src/module/vrpayment-settings/index.js`
- [Admin API clients](https://github.com/vr-payment/shopware-6/blob/master/src/Resources/app/administration/src/init/api-service.init.js): `src/Resources/app/administration/src/init/api-service.init.js`
- [Refund actions](https://github.com/vr-payment/shopware-6/blob/master/src/Resources/app/administration/src/module/vrpayment-order/component/vrpayment-order-action-refund/index.js): `src/Resources/app/administration/src/module/vrpayment-order/component/vrpayment-order-action-refund/index.js`

### Checkout and payment

- [Checkout page](https://github.com/vr-payment/shopware-6/blob/master/src/Core/Storefront/Checkout/Controller/CheckoutController.php): `src/Core/Storefront/Checkout/Controller/CheckoutController.php`
- [Payment handler](https://github.com/vr-payment/shopware-6/blob/master/src/Core/Checkout/PaymentHandler/VRPaymentPaymentHandler.php): `src/Core/Checkout/PaymentHandler/VRPaymentPaymentHandler.php`
- [Payment method filter](https://github.com/vr-payment/shopware-6/blob/master/src/Core/Checkout/Service/PaymentMethodFilterService.php): `src/Core/Checkout/Service/PaymentMethodFilterService.php`
- [Subscription orders](https://github.com/vr-payment/shopware-6/blob/master/src/Core/Checkout/Subscription/Command/GenerateSubscriptionOrderCommand.php): `src/Core/Checkout/Subscription/Command/GenerateSubscriptionOrderCommand.php`
- [Invoice access](https://github.com/vr-payment/shopware-6/blob/master/src/Core/Checkout/Service/InvoiceService.php): `src/Core/Checkout/Service/InvoiceService.php`

### Transaction operations

- [Transactions](https://github.com/vr-payment/shopware-6/blob/master/src/Core/Api/Transaction/Service/TransactionService.php): `src/Core/Api/Transaction/Service/TransactionService.php`
- [Transaction endpoints](https://github.com/vr-payment/shopware-6/blob/master/src/Core/Api/Transaction/Controller/TransactionController.php): `src/Core/Api/Transaction/Controller/TransactionController.php`
- [Capture and void](https://github.com/vr-payment/shopware-6/blob/master/src/Core/Api/Transaction/Controller/TransactionCompletionController.php): `src/Core/Api/Transaction/Controller/TransactionCompletionController.php`
- [Refund endpoints](https://github.com/vr-payment/shopware-6/blob/master/src/Core/Api/Refund/Controller/RefundController.php): `src/Core/Api/Refund/Controller/RefundController.php`
- [Refund service](https://github.com/vr-payment/shopware-6/blob/master/src/Core/Api/Refund/Service/RefundService.php): `src/Core/Api/Refund/Service/RefundService.php`

### Configuration and callbacks

- [Configuration API](https://github.com/vr-payment/shopware-6/blob/master/src/Core/Api/Configuration/Controller/ConfigurationController.php): `src/Core/Api/Configuration/Controller/ConfigurationController.php`
- [Payment method sync](https://github.com/vr-payment/shopware-6/blob/master/src/Core/Api/PaymentMethodConfiguration/Service/PaymentMethodConfigurationService.php): `src/Core/Api/PaymentMethodConfiguration/Service/PaymentMethodConfigurationService.php`
- [Settings service](https://github.com/vr-payment/shopware-6/blob/master/src/Core/Settings/Service/SettingsService.php): `src/Core/Settings/Service/SettingsService.php`
- [Webhook receiver](https://github.com/vr-payment/shopware-6/blob/master/src/Core/Api/WebHooks/Controller/WebHookController.php): `src/Core/Api/WebHooks/Controller/WebHookController.php`
- [Webhook registration](https://github.com/vr-payment/shopware-6/blob/master/src/Core/Api/WebHooks/Service/WebHooksService.php): `src/Core/Api/WebHooks/Service/WebHooksService.php`

### Other components

- **Merchant**
- **Customer**
- **Shopware**
- **VR Payment API**

## Connections

- Merchant → Settings UI: configures
- Merchant → Admin UI: manages payments
- Admin UI → Admin API clients: uses clients (evidence: `src/Resources/app/administration/src/main.js`)
- Settings UI → Admin API clients: uses clients (evidence: `src/Resources/app/administration/src/main.js`)
- Admin API clients → Configuration API: calls
- Admin API clients → Refund endpoints: calls
- Refund actions → Admin API clients: requests refunds
- Configuration API → Settings service: reads settings (evidence: `src/Core/Api/Configuration/Controller/ConfigurationController.php`)
- Configuration API → Payment method sync: synchronizes methods (evidence: `src/Core/Api/Configuration/Controller/ConfigurationController.php`)
- Customer → Checkout page: starts checkout
- Checkout page → Payment handler: selects payment
- Payment handler → Transactions: creates transaction (evidence: `src/Core/Checkout/PaymentHandler/VRPaymentPaymentHandler.php`)
- Payment method filter → Payment method sync: filters methods (evidence: `src/Core/Checkout/Service/PaymentMethodFilterService.php`)
- Transactions → Settings service: loads credentials (evidence: `src/Core/Api/Transaction/Service/TransactionService.php`)
- Transactions → VR Payment API: creates transactions
- Transaction endpoints → Transactions: delegates (evidence: `src/Core/Api/Transaction/Controller/TransactionController.php`)
- Capture and void → Settings service: loads credentials (evidence: `src/Core/Api/Transaction/Controller/TransactionCompletionController.php`)
- Capture and void → VR Payment API: captures transactions
- Refund endpoints → Refund service: creates refunds (evidence: `src/Core/Api/Refund/Controller/RefundController.php`)
- Refund service → Settings service: loads credentials (evidence: `src/Core/Api/Refund/Service/RefundService.php`)
- Refund service → VR Payment API: submits refunds (evidence: `src/Core/Api/Refund/Service/RefundService.php`)
- VR Payment API → Webhook receiver: sends callbacks
- Webhook receiver → Transactions: updates transactions (evidence: `src/Core/Api/WebHooks/Controller/WebHookController.php`)
- Webhook receiver → Refund service: updates refunds (evidence: `src/Core/Api/WebHooks/Controller/WebHookController.php`)
- Webhook registration → Settings service: loads credentials (evidence: `src/Core/Api/WebHooks/Service/WebHooksService.php`)
- Payment handler → Subscription orders: supports recurring
- Customer → Invoice access: downloads invoice
