# r-martins/pagbank-woocommerce architecture

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

- Interactive diagram: https://gitdiagram.com/r-martins/pagbank-woocommerce
- Repository: https://github.com/r-martins/pagbank-woocommerce

## Overview

PagBank Connect is a WooCommerce payment plugin for Pix, boleto, and credit-card checkout. The main path starts with a shopper choosing a method, proceeds through WooCommerce gateway and payment processing, calls PagBank, and updates the order. Separate branches cover recurring subscriptions, payment splits, and EnvioFácil shipping. The graph includes documented capabilities whose implementation was not sampled; those links are dashed where source-level wiring was not shown. Component relationships are limited to README statements and SOURCE INDEX references or excerpts.

Main entry points: [`src/Connect/Gateway.php`](https://github.com/r-martins/pagbank-woocommerce/blob/master/src/Connect/Gateway.php) (Payment gateway), [`src/Connect.php`](https://github.com/r-martins/pagbank-woocommerce/blob/master/src/Connect.php) (Plugin bootstrap), [`src/Traits/ProcessPayment.php`](https://github.com/r-martins/pagbank-woocommerce/blob/master/src/Traits/ProcessPayment.php) (Payment processing), [`src/Connect/Recurring.php`](https://github.com/r-martins/pagbank-woocommerce/blob/master/src/Connect/Recurring.php) (Subscription lifecycle)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_checkout["Checkout and payments"]
  node_gateway["Payment gateway<br/>[Gateway.php]"]
  node_payment_methods["Payment methods"]
  node_blocks["Block checkout"]
  node_standalone["Standalone checkout"]
  node_processing["Payment processing<br/>[ProcessPayment.php]"]
  node_orders["Order processing<br/>[OrderProcessor.php]"]
end

subgraph group_integration["PagBank integration"]
  node_api["API client<br/>[Api.php]"]
  node_payment_data["Payment data objects<br/>[Charge.php]"]
  node_params["Checkout parameters<br/>[Params.php]"]
  node_connect["Plugin bootstrap<br/>[Connect.php]"]
  node_cron["Order status jobs"]
end

subgraph group_recurring["Recurring commerce"]
  node_recurring["Subscription lifecycle<br/>[Recurring.php]"]
  node_recurring_orders["Recurring orders<br/>[RecurringOrder.php]"]
  node_recurring_ui["Subscription account"]
end

subgraph group_extensions["Store extensions"]
  node_split["Payment splits"]
  node_dokan["Dokan split"]
  node_envio["EnvioFácil shipping<br/>[EnvioFacil.php]"]
end

subgraph group_admin["Administration"]
  node_admin_settings["Gateway settings"]
  node_integration_settings["Integration settings"]
end

node_shopper(("Shopper"))
node_woo["WooCommerce"]
node_pagbank["PagBank API"]

node_shopper -->|"chooses method"| node_gateway
node_gateway -->|"registers gateway"| node_woo
node_connect -->|"registers"| node_gateway
node_gateway -->|"uses processing"| node_processing
node_gateway -.->|"dispatches payments"| node_payment_methods
node_connect -->|"registers checkout"| node_blocks
node_connect -->|"registers checkout"| node_standalone
node_payment_methods -.->|"calls API"| node_api
node_processing -->|"sends requests"| node_api
node_processing -->|"builds charge"| node_payment_data
node_processing -.->|"updates order"| node_orders
node_api -->|"sends requests"| node_pagbank
node_gateway -->|"reads settings"| node_params
node_connect -->|"initializes"| node_recurring
node_processing -->|"processes subscription"| node_recurring
node_recurring -->|"creates orders"| node_recurring_orders
node_recurring -->|"loads dashboard"| node_recurring_ui
node_gateway -.->|"configures splits"| node_split
node_gateway -.->|"configures vendor splits"| node_dokan
node_connect -->|"registers shipping"| node_envio
node_admin_settings -.->|"configures"| node_gateway
node_integration_settings -->|"configures"| node_split
node_cron -->|"checks status"| node_api
node_cron -->|"updates orders"| node_orders

click node_gateway "https://github.com/r-martins/pagbank-woocommerce/blob/master/src/Connect/Gateway.php"
click node_payment_methods "https://github.com/r-martins/pagbank-woocommerce/tree/master/src/Connect/Payments"
click node_blocks "https://github.com/r-martins/pagbank-woocommerce/tree/master/src/Connect/Blocks"
click node_standalone "https://github.com/r-martins/pagbank-woocommerce/tree/master/src/Connect/Standalone"
click node_processing "https://github.com/r-martins/pagbank-woocommerce/blob/master/src/Traits/ProcessPayment.php"
click node_orders "https://github.com/r-martins/pagbank-woocommerce/blob/master/src/Connect/OrderProcessor.php"
click node_api "https://github.com/r-martins/pagbank-woocommerce/blob/master/src/Helpers/Api.php"
click node_payment_data "https://github.com/r-martins/pagbank-woocommerce/blob/master/src/Object/Charge.php"
click node_params "https://github.com/r-martins/pagbank-woocommerce/blob/master/src/Helpers/Params.php"
click node_connect "https://github.com/r-martins/pagbank-woocommerce/blob/master/src/Connect.php"
click node_recurring "https://github.com/r-martins/pagbank-woocommerce/blob/master/src/Connect/Recurring.php"
click node_recurring_orders "https://github.com/r-martins/pagbank-woocommerce/blob/master/src/Connect/Recurring/RecurringOrder.php"
click node_recurring_ui "https://github.com/r-martins/pagbank-woocommerce/blob/master/src/Connect/Recurring/RecurringDashboard.php"
click node_split "https://github.com/r-martins/pagbank-woocommerce/blob/master/src/Integrations/GeneralSplitManager.php"
click node_dokan "https://github.com/r-martins/pagbank-woocommerce/blob/master/src/Integrations/Dokan/DokanSplitManager.php"
click node_envio "https://github.com/r-martins/pagbank-woocommerce/blob/master/src/EnvioFacil.php"
click node_admin_settings "https://github.com/r-martins/pagbank-woocommerce/blob/master/admin/views/html-settings-page.php"
click node_integration_settings "https://github.com/r-martins/pagbank-woocommerce/blob/master/admin/views/html-integrations-settings.php"
click node_cron "https://github.com/r-martins/pagbank-woocommerce/blob/master/src/Cron/ForceOrderUpdate.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_gateway,node_payment_methods,node_blocks,node_standalone,node_processing,node_orders toneBlue
class node_api,node_payment_data,node_params,node_connect,node_cron toneAmber
class node_recurring,node_recurring_orders,node_recurring_ui,node_pagbank toneMint
class node_split,node_dokan,node_envio toneRose
class node_admin_settings,node_integration_settings,node_shopper,node_woo toneIndigo
```

## Components

### Checkout and payments

- [Payment gateway](https://github.com/r-martins/pagbank-woocommerce/blob/master/src/Connect/Gateway.php): `src/Connect/Gateway.php`
- [Payment methods](https://github.com/r-martins/pagbank-woocommerce/tree/master/src/Connect/Payments): `src/Connect/Payments`
- [Block checkout](https://github.com/r-martins/pagbank-woocommerce/tree/master/src/Connect/Blocks): `src/Connect/Blocks`
- [Standalone checkout](https://github.com/r-martins/pagbank-woocommerce/tree/master/src/Connect/Standalone): `src/Connect/Standalone`
- [Payment processing](https://github.com/r-martins/pagbank-woocommerce/blob/master/src/Traits/ProcessPayment.php): `src/Traits/ProcessPayment.php`
- [Order processing](https://github.com/r-martins/pagbank-woocommerce/blob/master/src/Connect/OrderProcessor.php): `src/Connect/OrderProcessor.php`

### PagBank integration

- [API client](https://github.com/r-martins/pagbank-woocommerce/blob/master/src/Helpers/Api.php): `src/Helpers/Api.php`
- [Payment data objects](https://github.com/r-martins/pagbank-woocommerce/blob/master/src/Object/Charge.php): `src/Object/Charge.php`
- [Checkout parameters](https://github.com/r-martins/pagbank-woocommerce/blob/master/src/Helpers/Params.php): `src/Helpers/Params.php`
- [Plugin bootstrap](https://github.com/r-martins/pagbank-woocommerce/blob/master/src/Connect.php): `src/Connect.php`
- [Order status jobs](https://github.com/r-martins/pagbank-woocommerce/blob/master/src/Cron/ForceOrderUpdate.php): `src/Cron/ForceOrderUpdate.php`

### Recurring commerce

- [Subscription lifecycle](https://github.com/r-martins/pagbank-woocommerce/blob/master/src/Connect/Recurring.php): `src/Connect/Recurring.php`
- [Recurring orders](https://github.com/r-martins/pagbank-woocommerce/blob/master/src/Connect/Recurring/RecurringOrder.php): `src/Connect/Recurring/RecurringOrder.php`
- [Subscription account](https://github.com/r-martins/pagbank-woocommerce/blob/master/src/Connect/Recurring/RecurringDashboard.php): `src/Connect/Recurring/RecurringDashboard.php`

### Store extensions

- [Payment splits](https://github.com/r-martins/pagbank-woocommerce/blob/master/src/Integrations/GeneralSplitManager.php): `src/Integrations/GeneralSplitManager.php`
- [Dokan split](https://github.com/r-martins/pagbank-woocommerce/blob/master/src/Integrations/Dokan/DokanSplitManager.php): `src/Integrations/Dokan/DokanSplitManager.php`
- [EnvioFácil shipping](https://github.com/r-martins/pagbank-woocommerce/blob/master/src/EnvioFacil.php): `src/EnvioFacil.php`

### Administration

- [Gateway settings](https://github.com/r-martins/pagbank-woocommerce/blob/master/admin/views/html-settings-page.php): `admin/views/html-settings-page.php`
- [Integration settings](https://github.com/r-martins/pagbank-woocommerce/blob/master/admin/views/html-integrations-settings.php): `admin/views/html-integrations-settings.php`

### Other components

- **Shopper**
- **WooCommerce**
- **PagBank API**

## Connections

- Shopper → Payment gateway: chooses method
- Payment gateway → WooCommerce: registers gateway
- Plugin bootstrap → Payment gateway: registers (evidence: `src/Connect.php`)
- Payment gateway → Payment processing: uses processing (evidence: `src/Connect/Gateway.php`)
- Payment gateway → Payment methods: dispatches payments
- Plugin bootstrap → Block checkout: registers checkout (evidence: `src/Connect.php`)
- Plugin bootstrap → Standalone checkout: registers checkout (evidence: `src/Connect.php`)
- Payment methods → API client: calls API (evidence: `src/Connect/Payments/CreditCard.php`)
- Payment processing → API client: sends requests (evidence: `src/Traits/ProcessPayment.php`)
- Payment processing → Payment data objects: builds charge (evidence: `src/Traits/ProcessPayment.php`)
- Payment processing → Order processing: updates order (evidence: `src/Connect/OrderProcessor.php`)
- API client → PagBank API: sends requests (evidence: `src/Helpers/Api.php`)
- Payment gateway → Checkout parameters: reads settings (evidence: `src/Connect/Gateway.php`)
- Plugin bootstrap → Subscription lifecycle: initializes (evidence: `src/Connect.php`)
- Payment processing → Subscription lifecycle: processes subscription (evidence: `src/Traits/ProcessPayment.php`)
- Subscription lifecycle → Recurring orders: creates orders (evidence: `src/Connect/Recurring.php`)
- Subscription lifecycle → Subscription account: loads dashboard (evidence: `src/Connect/Recurring.php`)
- Payment gateway → Payment splits: configures splits (evidence: `src/Integrations/GeneralSplitManager.php`)
- Payment gateway → Dokan split: configures vendor splits (evidence: `src/Integrations/Dokan/DokanSplitManager.php`)
- Plugin bootstrap → EnvioFácil shipping: registers shipping (evidence: `src/EnvioFacil.php`)
- Gateway settings → Payment gateway: configures
- Integration settings → Payment splits: configures (evidence: `admin/views/html-integrations-settings.php`)
- Order status jobs → API client: checks status (evidence: `src/Cron/ForceOrderUpdate.php`)
- Order status jobs → Order processing: updates orders (evidence: `src/Cron/ForceOrderUpdate.php`)
