# globalpayments-samples/php-payments-and-reporting architecture

> Architecture diagram of the GitHub repository globalpayments-samples/php-payments-and-reporting, 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/globalpayments-samples/php-payments-and-reporting
- Repository: https://github.com/globalpayments-samples/php-payments-and-reporting

## Overview

This PHP application provides card verification, payment processing, and transaction reporting through browser interfaces and API endpoints. The principal workflow is a user submitting a verification or payment request, the server invoking Global Payments, and transaction records becoming available in the dashboard. The README documents the interfaces and capabilities; sampled endpoint and reporter code confirms key integrations and local storage. Frontend request wiring and some endpoint internals were not sampled, so those links are documented or marked unverified.

Main entry points: [`src/TransactionReporter.php`](https://github.com/globalpayments-samples/php-payments-and-reporting/blob/main/src/TransactionReporter.php) (Transaction reporter), [`api/process-payment.php`](https://github.com/globalpayments-samples/php-payments-and-reporting/blob/main/api/process-payment.php) (Payment processing), [`public/card-verification.html`](https://github.com/globalpayments-samples/php-payments-and-reporting/blob/main/public/card-verification.html) (Verification form), [`public/payment.html`](https://github.com/globalpayments-samples/php-payments-and-reporting/blob/main/public/payment.html) (Payment form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_home["Navigation<br/>[index.html]"]
  node_verify_ui["Verification form"]
  node_payment_ui["Payment form<br/>[payment.html]"]
  node_dashboard["Transaction dashboard<br/>[dashboard.html]"]
end

subgraph group_requests["API operations"]
  node_config_api["Public configuration<br/>[config.php]"]
  node_token_api["Access token"]
  node_verify_api["Card verification<br/>[verify-card.php]"]
  node_payment_api["Payment processing"]
  node_transactions_api["Transaction queries"]
  node_gp_sdk["Global Payments SDK"]
end

subgraph group_reporting["Transaction reporting"]
  node_reporter["Transaction reporter"]
  node_transaction_store[("Local transaction files")]
  node_gp_reporting["Gateway reporting"]
end

subgraph group_support["Shared services"]
  node_logger["Structured logging<br/>[Logger.php]"]
  node_error_handler["Error handling<br/>[ErrorHandler.php]"]
end

node_user(("User"))

node_user -->|"opens"| node_home
node_user -->|"submits verification"| node_verify_ui
node_user -->|"submits payment"| node_payment_ui
node_user -->|"views activity"| node_dashboard
node_verify_ui -.->|"loads settings"| node_config_api
node_payment_ui -.->|"requests token"| node_token_api
node_payment_ui -->|"submits payment"| node_payment_api
node_verify_ui -->|"submits card"| node_verify_api
node_dashboard -->|"requests records"| node_transactions_api
node_token_api -->|"generates token"| node_gp_sdk
node_verify_api -->|"verifies card"| node_gp_sdk
node_payment_api -->|"executes charge"| node_gp_sdk
node_verify_api -->|"records result"| node_reporter
node_payment_api -->|"records result"| node_reporter
node_transactions_api -->|"queries records"| node_reporter
node_reporter -->|"reads and writes"| node_transaction_store
node_reporter -->|"queries gateway"| node_gp_reporting
node_reporter -->|"logs events"| node_logger
node_error_handler -->|"logs errors"| node_logger
node_payment_api -->|"logs payment"| node_logger

click node_home "https://github.com/globalpayments-samples/php-payments-and-reporting/blob/main/public/index.html"
click node_verify_ui "https://github.com/globalpayments-samples/php-payments-and-reporting/blob/main/public/card-verification.html"
click node_payment_ui "https://github.com/globalpayments-samples/php-payments-and-reporting/blob/main/public/payment.html"
click node_dashboard "https://github.com/globalpayments-samples/php-payments-and-reporting/blob/main/public/dashboard.html"
click node_config_api "https://github.com/globalpayments-samples/php-payments-and-reporting/blob/main/api/config.php"
click node_token_api "https://github.com/globalpayments-samples/php-payments-and-reporting/blob/main/api/get-access-token.php"
click node_verify_api "https://github.com/globalpayments-samples/php-payments-and-reporting/blob/main/api/verify-card.php"
click node_payment_api "https://github.com/globalpayments-samples/php-payments-and-reporting/blob/main/api/process-payment.php"
click node_transactions_api "https://github.com/globalpayments-samples/php-payments-and-reporting/blob/main/api/transactions-api.php"
click node_reporter "https://github.com/globalpayments-samples/php-payments-and-reporting/blob/main/src/TransactionReporter.php"
click node_transaction_store "https://github.com/globalpayments-samples/php-payments-and-reporting/blob/main/src/TransactionReporter.php"
click node_logger "https://github.com/globalpayments-samples/php-payments-and-reporting/blob/main/src/Logger.php"
click node_error_handler "https://github.com/globalpayments-samples/php-payments-and-reporting/blob/main/src/ErrorHandler.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_home,node_verify_ui,node_payment_ui,node_dashboard,node_user toneBlue
class node_config_api,node_token_api,node_verify_api,node_payment_api,node_transactions_api,node_gp_sdk toneAmber
class node_reporter,node_transaction_store,node_gp_reporting toneMint
class node_logger,node_error_handler toneRose
```

## Components

### User interfaces

- [Navigation](https://github.com/globalpayments-samples/php-payments-and-reporting/blob/main/public/index.html): `public/index.html`
- [Verification form](https://github.com/globalpayments-samples/php-payments-and-reporting/blob/main/public/card-verification.html): `public/card-verification.html`
- [Payment form](https://github.com/globalpayments-samples/php-payments-and-reporting/blob/main/public/payment.html): `public/payment.html`
- [Transaction dashboard](https://github.com/globalpayments-samples/php-payments-and-reporting/blob/main/public/dashboard.html): `public/dashboard.html`

### API operations

- [Public configuration](https://github.com/globalpayments-samples/php-payments-and-reporting/blob/main/api/config.php): `api/config.php`
- [Access token](https://github.com/globalpayments-samples/php-payments-and-reporting/blob/main/api/get-access-token.php): `api/get-access-token.php`
- [Card verification](https://github.com/globalpayments-samples/php-payments-and-reporting/blob/main/api/verify-card.php): `api/verify-card.php`
- [Payment processing](https://github.com/globalpayments-samples/php-payments-and-reporting/blob/main/api/process-payment.php): `api/process-payment.php`
- [Transaction queries](https://github.com/globalpayments-samples/php-payments-and-reporting/blob/main/api/transactions-api.php): `api/transactions-api.php`
- **Global Payments SDK**

### Transaction reporting

- [Transaction reporter](https://github.com/globalpayments-samples/php-payments-and-reporting/blob/main/src/TransactionReporter.php): `src/TransactionReporter.php`
- [Local transaction files](https://github.com/globalpayments-samples/php-payments-and-reporting/blob/main/src/TransactionReporter.php): `src/TransactionReporter.php`
- **Gateway reporting**

### Shared services

- [Structured logging](https://github.com/globalpayments-samples/php-payments-and-reporting/blob/main/src/Logger.php): `src/Logger.php`
- [Error handling](https://github.com/globalpayments-samples/php-payments-and-reporting/blob/main/src/ErrorHandler.php): `src/ErrorHandler.php`

### Other components

- **User**

## Connections

- User → Navigation: opens (evidence: `README.md`)
- User → Verification form: submits verification (evidence: `README.md`)
- User → Payment form: submits payment (evidence: `README.md`)
- User → Transaction dashboard: views activity (evidence: `README.md`)
- Verification form → Public configuration: loads settings
- Payment form → Access token: requests token
- Payment form → Payment processing: submits payment (evidence: `README.md`)
- Verification form → Card verification: submits card (evidence: `README.md`)
- Transaction dashboard → Transaction queries: requests records (evidence: `README.md`)
- Access token → Global Payments SDK: generates token (evidence: `api/get-access-token.php`)
- Card verification → Global Payments SDK: verifies card (evidence: `api/verify-card.php`)
- Payment processing → Global Payments SDK: executes charge (evidence: `api/process-payment.php`)
- Card verification → Transaction reporter: records result (evidence: `api/verify-card.php`)
- Payment processing → Transaction reporter: records result (evidence: `api/process-payment.php`)
- Transaction queries → Transaction reporter: queries records (evidence: `api/transactions-api.php`)
- Transaction reporter → Local transaction files: reads and writes (evidence: `src/TransactionReporter.php`)
- Transaction reporter → Gateway reporting: queries gateway (evidence: `src/TransactionReporter.php`)
- Transaction reporter → Structured logging: logs events (evidence: `src/TransactionReporter.php`)
- Error handling → Structured logging: logs errors (evidence: `src/ErrorHandler.php`)
- Payment processing → Structured logging: logs payment (evidence: `api/process-payment.php`)
