# schery19/moncash-easy-sdk architecture

> Architecture diagram of the GitHub repository schery19/moncash-easy-sdk, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/schery19/moncash-easy-sdk
- Repository: https://github.com/schery19/moncash-easy-sdk

## Overview

Moncash-Easy-SDK is a PHP client library for MonCash payments and transfers. An application constructs MoncashAPI with merchant credentials, creates a payment request, and sends the user to its redirect URL; after payment, it can retrieve details by order or transaction ID. The SDK also supports transfers, environment and credential changes, and localized payment-button URLs. Connections reflect README workflows and the supplied source/index references; Credentials.php was not excerpted, so its internal behavior is not detailed.

Main entry points: [`src/MoncashAPI.php`](https://github.com/schery19/moncash-easy-sdk/blob/main/src/MoncashAPI.php) (MoncashAPI), [`src/RequestHandler.php`](https://github.com/schery19/moncash-easy-sdk/blob/main/src/RequestHandler.php) (HTTP request handler), [`src/PaymentRequest.php`](https://github.com/schery19/moncash-easy-sdk/blob/main/src/PaymentRequest.php) (Payment request), [`src/PaymentDetails.php`](https://github.com/schery19/moncash-easy-sdk/blob/main/src/PaymentDetails.php) (Payment details)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_integration["SDK integration"]
  node_moncashapi["MoncashAPI<br/>[MoncashAPI.php]"]
  node_credentials["Merchant credentials<br/>[Credentials.php]"]
end

subgraph group_payment["Payment workflows"]
  node_paymentrequest["Payment request<br/>[PaymentRequest.php]"]
  node_paymentdetails["Payment details<br/>[PaymentDetails.php]"]
  node_payment["Payment record<br/>[Payment.php]"]
end

subgraph group_transfer["Transfers"]
  node_transferresult["Transfer result<br/>[Transfert.php]"]
end

subgraph group_support["Configuration and transport"]
  node_configuration["Environment configuration<br/>[Configuration.php]"]
  node_constants["API constants<br/>[Constants.php]"]
  node_requests["HTTP request handler<br/>[RequestHandler.php]"]
  node_exceptions["SDK exceptions"]
end

node_app(("Client application"))
node_moncash{{"MonCash service"}}

node_app -->|"creates and uses"| node_moncashapi
node_moncashapi -->|"loads settings"| node_configuration
node_configuration -->|"selects endpoints"| node_constants
node_moncashapi -->|"sets credentials"| node_credentials
node_moncashapi -->|"executes requests"| node_requests
node_requests -.->|"sends HTTP requests"| node_moncash
node_requests -->|"raises errors"| node_exceptions
node_moncashapi -->|"raises errors"| node_exceptions
node_moncashapi -->|"creates payment request"| node_paymentrequest
node_paymentrequest -->|"builds redirect"| node_credentials
node_app -->|"gets redirect URL"| node_paymentrequest
node_app -->|"redirects user"| node_moncash
node_moncashapi -->|"retrieves payment details"| node_paymentdetails
node_paymentdetails -->|"constructs payment"| node_payment
node_moncashapi -->|"returns transfer result"| node_transferresult
node_app -.->|"requests transfers"| node_moncashapi

click node_moncashapi "https://github.com/schery19/moncash-easy-sdk/blob/main/src/MoncashAPI.php"
click node_credentials "https://github.com/schery19/moncash-easy-sdk/blob/main/src/Credentials.php"
click node_configuration "https://github.com/schery19/moncash-easy-sdk/blob/main/src/Configuration.php"
click node_constants "https://github.com/schery19/moncash-easy-sdk/blob/main/src/Constants.php"
click node_requests "https://github.com/schery19/moncash-easy-sdk/blob/main/src/RequestHandler.php"
click node_exceptions "https://github.com/schery19/moncash-easy-sdk/blob/main/src/MoncashException.php"
click node_paymentrequest "https://github.com/schery19/moncash-easy-sdk/blob/main/src/PaymentRequest.php"
click node_paymentdetails "https://github.com/schery19/moncash-easy-sdk/blob/main/src/PaymentDetails.php"
click node_payment "https://github.com/schery19/moncash-easy-sdk/blob/main/src/Payment.php"
click node_transferresult "https://github.com/schery19/moncash-easy-sdk/blob/main/src/Transfert.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_moncashapi,node_credentials,node_app toneBlue
class node_paymentrequest,node_paymentdetails,node_payment toneAmber
class node_transferresult toneMint
class node_configuration,node_constants,node_requests,node_exceptions toneRose
class node_moncash toneIndigo
```

## Components

### SDK integration

- [MoncashAPI](https://github.com/schery19/moncash-easy-sdk/blob/main/src/MoncashAPI.php): `src/MoncashAPI.php`
- [Merchant credentials](https://github.com/schery19/moncash-easy-sdk/blob/main/src/Credentials.php): `src/Credentials.php`

### Payment workflows

- [Payment request](https://github.com/schery19/moncash-easy-sdk/blob/main/src/PaymentRequest.php): `src/PaymentRequest.php`
- [Payment details](https://github.com/schery19/moncash-easy-sdk/blob/main/src/PaymentDetails.php): `src/PaymentDetails.php`
- [Payment record](https://github.com/schery19/moncash-easy-sdk/blob/main/src/Payment.php): `src/Payment.php`

### Transfers

- [Transfer result](https://github.com/schery19/moncash-easy-sdk/blob/main/src/Transfert.php): `src/Transfert.php`

### Configuration and transport

- [Environment configuration](https://github.com/schery19/moncash-easy-sdk/blob/main/src/Configuration.php): `src/Configuration.php`
- [API constants](https://github.com/schery19/moncash-easy-sdk/blob/main/src/Constants.php): `src/Constants.php`
- [HTTP request handler](https://github.com/schery19/moncash-easy-sdk/blob/main/src/RequestHandler.php): `src/RequestHandler.php`
- [SDK exceptions](https://github.com/schery19/moncash-easy-sdk/blob/main/src/MoncashException.php): `src/MoncashException.php`

### Other components

- **Client application**
- **MonCash service**

## Connections

- Client application → MoncashAPI: creates and uses (evidence: `README.md`)
- MoncashAPI → Environment configuration: loads settings (evidence: `src/MoncashAPI.php`)
- Environment configuration → API constants: selects endpoints (evidence: `src/Configuration.php`)
- MoncashAPI → Merchant credentials: sets credentials (evidence: `src/MoncashAPI.php`)
- MoncashAPI → HTTP request handler: executes requests (evidence: `src/MoncashAPI.php`)
- HTTP request handler → MonCash service: sends HTTP requests
- HTTP request handler → SDK exceptions: raises errors (evidence: `src/RequestHandler.php`)
- MoncashAPI → SDK exceptions: raises errors (evidence: `src/MoncashAPI.php`)
- MoncashAPI → Payment request: creates payment request (evidence: `src/MoncashAPI.php`)
- Payment request → Merchant credentials: builds redirect (evidence: `src/PaymentRequest.php`)
- Client application → Payment request: gets redirect URL (evidence: `README.md`)
- Client application → MonCash service: redirects user (evidence: `README.md`)
- MoncashAPI → Payment details: retrieves payment details (evidence: `src/MoncashAPI.php`)
- Payment details → Payment record: constructs payment (evidence: `src/PaymentDetails.php`)
- MoncashAPI → Transfer result: returns transfer result (evidence: `src/MoncashAPI.php`)
- Client application → MoncashAPI: requests transfers
