# yaya12085/fusionpay architecture

> Architecture diagram of the GitHub repository yaya12085/fusionpay, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yaya12085/fusionpay
- Repository: https://github.com/yaya12085/fusionpay

## Overview

FusionPay is a small TypeScript client library for MoneyFusion payments. The primary workflow is an application configuring payment details through the fluent client, submitting them to the gateway, then using a returned token to verify status; users can redirect payers to the gateway URL and handle return or webhook callbacks in their own application. The sampled implementation places configuration, HTTP requests, and response handling in one class. Callback handling and webhook delivery are documented integration capabilities, but are not implemented as library modules in the available source.

Main entry points: [`src/FusionPay.ts`](https://github.com/yaya12085/fusionpay/blob/main/src/FusionPay.ts) (FusionPay client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client library"]
  node_client["FusionPay client<br/>[FusionPay.ts]"]
end

subgraph group_gateway["MoneyFusion gateway"]
  node_gateway["Payment gateway"]
end

subgraph group_application["Integrating application"]
  node_app["Merchant application"]
  node_return["Return callback"]
  node_webhook["Webhook handler"]
end

node_payer(("Payer"))

node_app -->|"configures payment"| node_client
node_client -->|"POSTs payment data"| node_gateway
node_gateway -->|"returns token and URL"| node_client
node_app -->|"redirects to gateway"| node_payer
node_payer -->|"returns with token"| node_return
node_return -->|"checks status"| node_client
node_client -->|"fetches status"| node_gateway
node_gateway -->|"returns verification"| node_client
node_gateway -.->|"sends payment data"| node_webhook

click node_client "https://github.com/yaya12085/fusionpay/blob/main/src/FusionPay.ts"

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_client toneBlue
class node_gateway toneAmber
class node_app,node_return,node_webhook toneMint
class node_payer toneIndigo
```

## Components

### Client library

- [FusionPay client](https://github.com/yaya12085/fusionpay/blob/main/src/FusionPay.ts): `src/FusionPay.ts`

### MoneyFusion gateway

- **Payment gateway**

### Integrating application

- **Merchant application**
- **Return callback**
- **Webhook handler**

### Other components

- **Payer**

## Connections

- Merchant application → FusionPay client: configures payment
- FusionPay client → Payment gateway: POSTs payment data
- Payment gateway → FusionPay client: returns token and URL
- Merchant application → Payer: redirects to gateway
- Payer → Return callback: returns with token
- Return callback → FusionPay client: checks status
- FusionPay client → Payment gateway: fetches status
- Payment gateway → FusionPay client: returns verification
- Payment gateway → Webhook handler: sends payment data
