# vr-payment/php-sdk architecture

> Architecture diagram of the GitHub repository vr-payment/php-sdk, 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/php-sdk
- Repository: https://github.com/vr-payment/php-sdk

## Overview

VRPayment PHP SDK is a client library for calling VRPayment’s REST API. A consumer configures credentials, creates a service, invokes an endpoint, and receives typed model data or an API exception. The tree and README show broad endpoint coverage across payments, customers, subscriptions, accounts, and webhooks; sampled services reference shared authentication, configuration, request-formatting, and serialization code. Some listed capabilities have no corresponding service file in this tree, so their internals are not represented here.

Main entry points: [`lib/Service/CustomersService.php`](https://github.com/vr-payment/php-sdk/blob/master/lib/Service/CustomersService.php) (Customers), [`lib/Auth/HttpBearerAuth.php`](https://github.com/vr-payment/php-sdk/blob/master/lib/Auth/HttpBearerAuth.php) (Bearer Authentication), [`lib/ObjectSerializer.php`](https://github.com/vr-payment/php-sdk/blob/master/lib/ObjectSerializer.php) (Object Serialization), [`lib/Configuration.php`](https://github.com/vr-payment/php-sdk/blob/master/lib/Configuration.php) (Configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_payment["Payment Operations"]
  node_payment_terminals["Payment Terminals"]
  node_payment_apps["Payment Web Apps"]
  node_refunds["Refunds<br/>[RefundsService.php]"]
  node_transactions["Transaction Invoices"]
end

subgraph group_commerce["Customer and Account"]
  node_customers["Customers"]
  node_accounts["Accounts"]
  node_users["Application Users"]
end

subgraph group_subscriptions["Subscriptions"]
  node_subscriptions["Subscriptions"]
  node_products["Subscription Products"]
end

subgraph group_hooks["Webhooks"]
  node_webhook_listeners["Webhook Listeners"]
  node_webhook_urls["Webhook URLs"]
end

subgraph group_runtime["SDK Runtime"]
  node_configuration["Configuration<br/>[Configuration.php]"]
  node_authentication["Bearer Authentication<br/>[HttpBearerAuth.php]"]
  node_headers["Header Selection<br/>[HeaderSelector.php]"]
  node_form_data["Form Processing"]
  node_serializer["Object Serialization"]
  node_models["API Models<br/>[ModelInterface.php]"]
  node_api_errors["API Exceptions<br/>[ApiException.php]"]
end

node_consumer(("SDK Consumer"))
node_vr_api{{"VRPayment REST API"}}

node_consumer -->|"configures"| node_configuration
node_consumer -->|"invokes"| node_transactions
node_transactions -->|"sends requests"| node_vr_api
node_payment_terminals -->|"calls endpoints"| node_vr_api
node_payment_apps -->|"calls endpoints"| node_vr_api
node_refunds -->|"calls endpoints"| node_vr_api
node_customers -->|"calls endpoints"| node_vr_api
node_accounts -->|"calls endpoints"| node_vr_api
node_users -->|"calls endpoints"| node_vr_api
node_subscriptions -->|"calls endpoints"| node_vr_api
node_products -->|"calls endpoints"| node_vr_api
node_webhook_listeners -->|"calls endpoints"| node_vr_api
node_webhook_urls -->|"calls endpoints"| node_vr_api
node_customers -->|"uses"| node_authentication
node_customers -->|"uses"| node_configuration
node_customers -->|"uses"| node_form_data
node_customers -->|"uses"| node_headers
node_customers -->|"uses"| node_serializer
node_customers -->|"raises"| node_api_errors
node_payment_terminals -->|"uses"| node_authentication
node_payment_terminals -->|"uses"| node_configuration
node_payment_terminals -->|"uses"| node_serializer
node_payment_terminals -->|"raises"| node_api_errors
node_payment_apps -->|"uses"| node_authentication
node_payment_apps -->|"uses"| node_configuration
node_payment_apps -->|"uses"| node_serializer
node_subscriptions -->|"uses"| node_authentication
node_subscriptions -->|"uses"| node_configuration
node_subscriptions -->|"uses"| node_serializer
node_transactions -->|"uses"| node_authentication
node_transactions -->|"uses"| node_configuration
node_transactions -->|"uses"| node_serializer
node_webhook_listeners -->|"uses"| node_authentication
node_webhook_listeners -->|"uses"| node_configuration
node_webhook_listeners -->|"uses"| node_serializer
node_webhook_urls -->|"uses"| node_authentication
node_webhook_urls -->|"uses"| node_configuration
node_webhook_urls -->|"uses"| node_serializer
node_serializer -->|"serializes"| node_models
node_authentication -.->|"signs requests"| node_vr_api

click node_payment_terminals "https://github.com/vr-payment/php-sdk/blob/master/lib/Service/PaymentTerminalsService.php"
click node_payment_apps "https://github.com/vr-payment/php-sdk/blob/master/lib/Service/PaymentWebAppsService.php"
click node_refunds "https://github.com/vr-payment/php-sdk/blob/master/lib/Service/RefundsService.php"
click node_transactions "https://github.com/vr-payment/php-sdk/blob/master/lib/Service/TransactionInvoicesService.php"
click node_customers "https://github.com/vr-payment/php-sdk/blob/master/lib/Service/CustomersService.php"
click node_accounts "https://github.com/vr-payment/php-sdk/blob/master/lib/Service/AccountsService.php"
click node_users "https://github.com/vr-payment/php-sdk/blob/master/lib/Service/ApplicationUsersService.php"
click node_subscriptions "https://github.com/vr-payment/php-sdk/blob/master/lib/Service/SubscriptionsService.php"
click node_products "https://github.com/vr-payment/php-sdk/blob/master/lib/Service/SubscriptionProductsService.php"
click node_webhook_listeners "https://github.com/vr-payment/php-sdk/blob/master/lib/Service/WebhookListenersService.php"
click node_webhook_urls "https://github.com/vr-payment/php-sdk/blob/master/lib/Service/WebhookURLsService.php"
click node_configuration "https://github.com/vr-payment/php-sdk/blob/master/lib/Configuration.php"
click node_authentication "https://github.com/vr-payment/php-sdk/blob/master/lib/Auth/HttpBearerAuth.php"
click node_headers "https://github.com/vr-payment/php-sdk/blob/master/lib/HeaderSelector.php"
click node_form_data "https://github.com/vr-payment/php-sdk/blob/master/lib/FormDataProcessor.php"
click node_serializer "https://github.com/vr-payment/php-sdk/blob/master/lib/ObjectSerializer.php"
click node_models "https://github.com/vr-payment/php-sdk/blob/master/lib/Model/ModelInterface.php"
click node_api_errors "https://github.com/vr-payment/php-sdk/blob/master/lib/ApiException.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_payment_terminals,node_payment_apps,node_refunds,node_transactions toneBlue
class node_customers,node_accounts,node_users toneAmber
class node_subscriptions,node_products,node_vr_api toneMint
class node_webhook_listeners,node_webhook_urls toneRose
class node_configuration,node_authentication,node_headers,node_form_data,node_serializer,node_models,node_api_errors,node_consumer toneIndigo
```

## Components

### Payment Operations

- [Payment Terminals](https://github.com/vr-payment/php-sdk/blob/master/lib/Service/PaymentTerminalsService.php): `lib/Service/PaymentTerminalsService.php`
- [Payment Web Apps](https://github.com/vr-payment/php-sdk/blob/master/lib/Service/PaymentWebAppsService.php): `lib/Service/PaymentWebAppsService.php`
- [Refunds](https://github.com/vr-payment/php-sdk/blob/master/lib/Service/RefundsService.php): `lib/Service/RefundsService.php`
- [Transaction Invoices](https://github.com/vr-payment/php-sdk/blob/master/lib/Service/TransactionInvoicesService.php): `lib/Service/TransactionInvoicesService.php`

### Customer and Account

- [Customers](https://github.com/vr-payment/php-sdk/blob/master/lib/Service/CustomersService.php): `lib/Service/CustomersService.php`
- [Accounts](https://github.com/vr-payment/php-sdk/blob/master/lib/Service/AccountsService.php): `lib/Service/AccountsService.php`
- [Application Users](https://github.com/vr-payment/php-sdk/blob/master/lib/Service/ApplicationUsersService.php): `lib/Service/ApplicationUsersService.php`

### Subscriptions

- [Subscriptions](https://github.com/vr-payment/php-sdk/blob/master/lib/Service/SubscriptionsService.php): `lib/Service/SubscriptionsService.php`
- [Subscription Products](https://github.com/vr-payment/php-sdk/blob/master/lib/Service/SubscriptionProductsService.php): `lib/Service/SubscriptionProductsService.php`

### Webhooks

- [Webhook Listeners](https://github.com/vr-payment/php-sdk/blob/master/lib/Service/WebhookListenersService.php): `lib/Service/WebhookListenersService.php`
- [Webhook URLs](https://github.com/vr-payment/php-sdk/blob/master/lib/Service/WebhookURLsService.php): `lib/Service/WebhookURLsService.php`

### SDK Runtime

- [Configuration](https://github.com/vr-payment/php-sdk/blob/master/lib/Configuration.php): `lib/Configuration.php`
- [Bearer Authentication](https://github.com/vr-payment/php-sdk/blob/master/lib/Auth/HttpBearerAuth.php): `lib/Auth/HttpBearerAuth.php`
- [Header Selection](https://github.com/vr-payment/php-sdk/blob/master/lib/HeaderSelector.php): `lib/HeaderSelector.php`
- [Form Processing](https://github.com/vr-payment/php-sdk/blob/master/lib/FormDataProcessor.php): `lib/FormDataProcessor.php`
- [Object Serialization](https://github.com/vr-payment/php-sdk/blob/master/lib/ObjectSerializer.php): `lib/ObjectSerializer.php`
- [API Models](https://github.com/vr-payment/php-sdk/blob/master/lib/Model/ModelInterface.php): `lib/Model/ModelInterface.php`
- [API Exceptions](https://github.com/vr-payment/php-sdk/blob/master/lib/ApiException.php): `lib/ApiException.php`

### Other components

- **SDK Consumer**
- **VRPayment REST API**

## Connections

- SDK Consumer → Configuration: configures (evidence: `README.md`)
- SDK Consumer → Transaction Invoices: invokes (evidence: `README.md`)
- Transaction Invoices → VRPayment REST API: sends requests (evidence: `README.md`)
- Payment Terminals → VRPayment REST API: calls endpoints (evidence: `README.md`)
- Payment Web Apps → VRPayment REST API: calls endpoints (evidence: `README.md`)
- Refunds → VRPayment REST API: calls endpoints (evidence: `README.md`)
- Customers → VRPayment REST API: calls endpoints (evidence: `README.md`)
- Accounts → VRPayment REST API: calls endpoints (evidence: `README.md`)
- Application Users → VRPayment REST API: calls endpoints (evidence: `README.md`)
- Subscriptions → VRPayment REST API: calls endpoints (evidence: `README.md`)
- Subscription Products → VRPayment REST API: calls endpoints (evidence: `README.md`)
- Webhook Listeners → VRPayment REST API: calls endpoints (evidence: `README.md`)
- Webhook URLs → VRPayment REST API: calls endpoints (evidence: `README.md`)
- Customers → Bearer Authentication: uses (evidence: `lib/Service/CustomersService.php`)
- Customers → Configuration: uses (evidence: `lib/Service/CustomersService.php`)
- Customers → Form Processing: uses (evidence: `lib/Service/CustomersService.php`)
- Customers → Header Selection: uses (evidence: `lib/Service/CustomersService.php`)
- Customers → Object Serialization: uses (evidence: `lib/Service/CustomersService.php`)
- Customers → API Exceptions: raises (evidence: `lib/Service/CustomersService.php`)
- Payment Terminals → Bearer Authentication: uses (evidence: `lib/Service/PaymentTerminalsService.php`)
- Payment Terminals → Configuration: uses (evidence: `lib/Service/PaymentTerminalsService.php`)
- Payment Terminals → Object Serialization: uses (evidence: `lib/Service/PaymentTerminalsService.php`)
- Payment Terminals → API Exceptions: raises (evidence: `lib/Service/PaymentTerminalsService.php`)
- Payment Web Apps → Bearer Authentication: uses (evidence: `lib/Service/PaymentWebAppsService.php`)
- Payment Web Apps → Configuration: uses (evidence: `lib/Service/PaymentWebAppsService.php`)
- Payment Web Apps → Object Serialization: uses (evidence: `lib/Service/PaymentWebAppsService.php`)
- Subscriptions → Bearer Authentication: uses (evidence: `lib/Service/SubscriptionsService.php`)
- Subscriptions → Configuration: uses (evidence: `lib/Service/SubscriptionsService.php`)
- Subscriptions → Object Serialization: uses (evidence: `lib/Service/SubscriptionsService.php`)
- Transaction Invoices → Bearer Authentication: uses (evidence: `lib/Service/TransactionInvoicesService.php`)
- Transaction Invoices → Configuration: uses (evidence: `lib/Service/TransactionInvoicesService.php`)
- Transaction Invoices → Object Serialization: uses (evidence: `lib/Service/TransactionInvoicesService.php`)
- Webhook Listeners → Bearer Authentication: uses (evidence: `lib/Service/WebhookListenersService.php`)
- Webhook Listeners → Configuration: uses (evidence: `lib/Service/WebhookListenersService.php`)
- Webhook Listeners → Object Serialization: uses (evidence: `lib/Service/WebhookListenersService.php`)
- Webhook URLs → Bearer Authentication: uses (evidence: `lib/Service/WebhookURLsService.php`)
- Webhook URLs → Configuration: uses (evidence: `lib/Service/WebhookURLsService.php`)
- Webhook URLs → Object Serialization: uses (evidence: `lib/Service/WebhookURLsService.php`)
- Object Serialization → API Models: serializes (evidence: `lib/ObjectSerializer.php`)
- Bearer Authentication → VRPayment REST API: signs requests
