# elisei/pagbank-flag-recurring-magento architecture

> Architecture diagram of the GitHub repository elisei/pagbank-flag-recurring-magento, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/elisei/pagbank-flag-recurring-magento
- Repository: https://github.com/elisei/pagbank-flag-recurring-magento

## Overview

This Magento extension adds a recurring-type flag to PagBank credit-card checkout; it does not implement recurring billing or payment scheduling. The workflow is: an administrator selects a recurring type, checkout exposes it in configuration, the payment renderer submits it as additional data, an observer plugin saves it on the payment, and a request builder adds it to the PagBank charges payload. The README also describes later vault-based payments as guidance, not functionality implemented here. Some Magento wiring is defined in configuration files whose contents were not excerpted, so those links are omitted or marked unverified.

Main entry points: [`view/frontend/web/js/view/payment/method-renderer/recurring-data-mixin.js`](https://github.com/elisei/pagbank-flag-recurring-magento/blob/main/view/frontend/web/js/view/payment/method-renderer/recurring-data-mixin.js) (Payment data mixin), [`Model/FlagRecurringConfigProvider.php`](https://github.com/elisei/pagbank-flag-recurring-magento/blob/main/Model/FlagRecurringConfigProvider.php) (Checkout config provider), [`Observer/DataAssignCcObserverPlugin.php`](https://github.com/elisei/pagbank-flag-recurring-magento/blob/main/Observer/DataAssignCcObserverPlugin.php) (Payment data assignment), [`Gateway/Request/CreditCard/RecurringDataRequest.php`](https://github.com/elisei/pagbank-flag-recurring-magento/blob/main/Gateway/Request/CreditCard/RecurringDataRequest.php) (Recurring request builder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_admin["Admin configuration"]
  node_admin_settings["Recurring settings<br/>[system.xml]"]
  node_recurring_options["Type options<br/>[TypeRecurring.php]"]
end

subgraph group_checkout["Checkout data"]
  node_config_provider["Checkout config provider"]
  node_js_mixin["Payment data mixin"]
  node_mixin_registration["Renderer mixin registration"]
end

subgraph group_payment["Payment request"]
  node_payment_assignment["Payment data assignment"]
  node_recurring_builder["Recurring request builder"]
end

node_admin_user(("Store administrator"))
node_checkout_customer(("Checkout customer"))
node_pagbank_module["PagBank payment module"]
node_payment_payload["Charges payload"]

node_admin_user -->|"configures"| node_admin_settings
node_admin_settings -.->|"offers options"| node_recurring_options
node_config_provider -->|"reads store setting"| node_admin_settings
node_checkout_customer -.->|"opens checkout"| node_config_provider
node_config_provider -.->|"supplies checkout config"| node_js_mixin
node_mixin_registration -->|"registers mixin"| node_js_mixin
node_js_mixin -->|"extends renderer"| node_pagbank_module
node_js_mixin -.->|"submits recurring type"| node_payment_assignment
node_payment_assignment -->|"wraps observer"| node_pagbank_module
node_payment_assignment -.->|"stores payment type"| node_recurring_builder
node_recurring_builder -->|"adds recurring charge data"| node_payment_payload
node_recurring_builder -->|"uses charge request contract"| node_pagbank_module

click node_admin_settings "https://github.com/elisei/pagbank-flag-recurring-magento/blob/main/etc/adminhtml/system.xml"
click node_recurring_options "https://github.com/elisei/pagbank-flag-recurring-magento/blob/main/Model/Adminhtml/Source/TypeRecurring.php"
click node_config_provider "https://github.com/elisei/pagbank-flag-recurring-magento/blob/main/Model/FlagRecurringConfigProvider.php"
click node_js_mixin "https://github.com/elisei/pagbank-flag-recurring-magento/blob/main/view/frontend/web/js/view/payment/method-renderer/recurring-data-mixin.js"
click node_mixin_registration "https://github.com/elisei/pagbank-flag-recurring-magento/blob/main/view/frontend/requirejs-config.js"
click node_payment_assignment "https://github.com/elisei/pagbank-flag-recurring-magento/blob/main/Observer/DataAssignCcObserverPlugin.php"
click node_recurring_builder "https://github.com/elisei/pagbank-flag-recurring-magento/blob/main/Gateway/Request/CreditCard/RecurringDataRequest.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_settings,node_recurring_options toneBlue
class node_config_provider,node_js_mixin,node_mixin_registration toneAmber
class node_payment_assignment,node_recurring_builder toneMint
class node_admin_user,node_checkout_customer,node_pagbank_module,node_payment_payload toneIndigo
```

## Components

### Admin configuration

- [Recurring settings](https://github.com/elisei/pagbank-flag-recurring-magento/blob/main/etc/adminhtml/system.xml): `etc/adminhtml/system.xml`
- [Type options](https://github.com/elisei/pagbank-flag-recurring-magento/blob/main/Model/Adminhtml/Source/TypeRecurring.php): `Model/Adminhtml/Source/TypeRecurring.php`

### Checkout data

- [Checkout config provider](https://github.com/elisei/pagbank-flag-recurring-magento/blob/main/Model/FlagRecurringConfigProvider.php): `Model/FlagRecurringConfigProvider.php`
- [Payment data mixin](https://github.com/elisei/pagbank-flag-recurring-magento/blob/main/view/frontend/web/js/view/payment/method-renderer/recurring-data-mixin.js): `view/frontend/web/js/view/payment/method-renderer/recurring-data-mixin.js`
- [Renderer mixin registration](https://github.com/elisei/pagbank-flag-recurring-magento/blob/main/view/frontend/requirejs-config.js): `view/frontend/requirejs-config.js`

### Payment request

- [Payment data assignment](https://github.com/elisei/pagbank-flag-recurring-magento/blob/main/Observer/DataAssignCcObserverPlugin.php): `Observer/DataAssignCcObserverPlugin.php`
- [Recurring request builder](https://github.com/elisei/pagbank-flag-recurring-magento/blob/main/Gateway/Request/CreditCard/RecurringDataRequest.php): `Gateway/Request/CreditCard/RecurringDataRequest.php`

### Other components

- **Store administrator**
- **Checkout customer**
- **PagBank payment module**
- **Charges payload**

## Connections

- Store administrator → Recurring settings: configures (evidence: `README.md`)
- Recurring settings → Type options: offers options
- Checkout config provider → Recurring settings: reads store setting (evidence: `Model/FlagRecurringConfigProvider.php`)
- Checkout customer → Checkout config provider: opens checkout
- Checkout config provider → Payment data mixin: supplies checkout config
- Renderer mixin registration → Payment data mixin: registers mixin (evidence: `view/frontend/requirejs-config.js`)
- Payment data mixin → PagBank payment module: extends renderer
- Payment data mixin → Payment data assignment: submits recurring type
- Payment data assignment → PagBank payment module: wraps observer (evidence: `Observer/DataAssignCcObserverPlugin.php`)
- Payment data assignment → Recurring request builder: stores payment type
- Recurring request builder → Charges payload: adds recurring charge data (evidence: `Gateway/Request/CreditCard/RecurringDataRequest.php`)
- Recurring request builder → PagBank payment module: uses charge request contract (evidence: `Gateway/Request/CreditCard/RecurringDataRequest.php`)
