# hasinhayder/sslcommerz-laravel architecture

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

- Interactive diagram: https://gitdiagram.com/hasinhayder/sslcommerz-laravel
- Repository: https://github.com/hasinhayder/sslcommerz-laravel

## Overview

This Laravel package exposes SSLCommerz payment operations through a facade backed by a configured client. The principal flow is an application building payment details, submitting them to SSLCommerz, then using the response to continue checkout. The client also validates transactions, verifies response hashes, and initiates or checks refunds; typed response objects expose gateway results. The README documents callback URLs and sandbox/live modes. Source excerpts support the client’s API calls and wiring; callback handling itself belongs to the integrating application.

Main entry points: [`src/SslcommerzClient.php`](https://github.com/hasinhayder/sslcommerz-laravel/blob/main/src/SslcommerzClient.php) (Gateway Client), [`src/SslcommerzServiceProvider.php`](https://github.com/hasinhayder/sslcommerz-laravel/blob/main/src/SslcommerzServiceProvider.php) (Service Provider), [`src/Facades/Sslcommerz.php`](https://github.com/hasinhayder/sslcommerz-laravel/blob/main/src/Facades/Sslcommerz.php) (SSLCommerz Facade), [`config/sslcommerz.php`](https://github.com/hasinhayder/sslcommerz-laravel/blob/main/config/sslcommerz.php) (Package Config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_integration["Laravel Integration"]
  node_facade["SSLCommerz Facade<br/>[Sslcommerz.php]"]
  node_provider["Service Provider"]
  node_config["Package Config<br/>[sslcommerz.php]"]
end

subgraph group_operations["Payment Operations"]
  node_client["Gateway Client"]
  node_payment["Payment Initiation"]
  node_validation["Payment Validation"]
  node_hash["Hash Verification"]
  node_refund["Refund Operations"]
end

subgraph group_results["Gateway Results"]
  node_payment_response["Payment Response"]
  node_refund_response["Refund Response<br/>[RefundResponse.php]"]
  node_refund_status["Refund Status<br/>[RefundStatus.php]"]
  node_exception["Credential Exception"]
end

node_app(("Laravel Application"))
node_gateway(("SSLCommerz Gateway"))

node_app -->|"calls operations"| node_facade
node_facade -->|"forwards calls"| node_client
node_provider -->|"reads settings"| node_config
node_provider -->|"registers client"| node_client
node_provider -->|"throws on missing credentials"| node_exception
node_client -->|"performs"| node_payment
node_client -->|"performs"| node_validation
node_client -->|"performs"| node_hash
node_client -->|"performs"| node_refund
node_payment -->|"submits payment"| node_gateway
node_validation -->|"requests validation"| node_gateway
node_refund -->|"requests refund data"| node_gateway
node_payment -->|"builds response"| node_payment_response
node_refund -->|"builds response"| node_refund_response
node_refund -->|"builds status"| node_refund_status
node_app -.->|"receives callbacks"| node_gateway

click node_facade "https://github.com/hasinhayder/sslcommerz-laravel/blob/main/src/Facades/Sslcommerz.php"
click node_provider "https://github.com/hasinhayder/sslcommerz-laravel/blob/main/src/SslcommerzServiceProvider.php"
click node_config "https://github.com/hasinhayder/sslcommerz-laravel/blob/main/config/sslcommerz.php"
click node_client "https://github.com/hasinhayder/sslcommerz-laravel/blob/main/src/SslcommerzClient.php"
click node_payment "https://github.com/hasinhayder/sslcommerz-laravel/blob/main/src/SslcommerzClient.php"
click node_validation "https://github.com/hasinhayder/sslcommerz-laravel/blob/main/src/SslcommerzClient.php"
click node_hash "https://github.com/hasinhayder/sslcommerz-laravel/blob/main/src/SslcommerzClient.php"
click node_refund "https://github.com/hasinhayder/sslcommerz-laravel/blob/main/src/SslcommerzClient.php"
click node_payment_response "https://github.com/hasinhayder/sslcommerz-laravel/blob/main/src/Data/PaymentResponse.php"
click node_refund_response "https://github.com/hasinhayder/sslcommerz-laravel/blob/main/src/Data/RefundResponse.php"
click node_refund_status "https://github.com/hasinhayder/sslcommerz-laravel/blob/main/src/Data/RefundStatus.php"
click node_exception "https://github.com/hasinhayder/sslcommerz-laravel/blob/main/src/Exceptions/SslcommerzException.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_facade,node_provider,node_config toneBlue
class node_client,node_payment,node_validation,node_hash,node_refund toneAmber
class node_payment_response,node_refund_response,node_refund_status,node_exception toneMint
class node_app,node_gateway toneIndigo
```

## Components

### Laravel Integration

- [SSLCommerz Facade](https://github.com/hasinhayder/sslcommerz-laravel/blob/main/src/Facades/Sslcommerz.php): `src/Facades/Sslcommerz.php`
- [Service Provider](https://github.com/hasinhayder/sslcommerz-laravel/blob/main/src/SslcommerzServiceProvider.php): `src/SslcommerzServiceProvider.php`
- [Package Config](https://github.com/hasinhayder/sslcommerz-laravel/blob/main/config/sslcommerz.php): `config/sslcommerz.php`

### Payment Operations

- [Gateway Client](https://github.com/hasinhayder/sslcommerz-laravel/blob/main/src/SslcommerzClient.php): `src/SslcommerzClient.php`
- [Payment Initiation](https://github.com/hasinhayder/sslcommerz-laravel/blob/main/src/SslcommerzClient.php): `src/SslcommerzClient.php`
- [Payment Validation](https://github.com/hasinhayder/sslcommerz-laravel/blob/main/src/SslcommerzClient.php): `src/SslcommerzClient.php`
- [Hash Verification](https://github.com/hasinhayder/sslcommerz-laravel/blob/main/src/SslcommerzClient.php): `src/SslcommerzClient.php`
- [Refund Operations](https://github.com/hasinhayder/sslcommerz-laravel/blob/main/src/SslcommerzClient.php): `src/SslcommerzClient.php`

### Gateway Results

- [Payment Response](https://github.com/hasinhayder/sslcommerz-laravel/blob/main/src/Data/PaymentResponse.php): `src/Data/PaymentResponse.php`
- [Refund Response](https://github.com/hasinhayder/sslcommerz-laravel/blob/main/src/Data/RefundResponse.php): `src/Data/RefundResponse.php`
- [Refund Status](https://github.com/hasinhayder/sslcommerz-laravel/blob/main/src/Data/RefundStatus.php): `src/Data/RefundStatus.php`
- [Credential Exception](https://github.com/hasinhayder/sslcommerz-laravel/blob/main/src/Exceptions/SslcommerzException.php): `src/Exceptions/SslcommerzException.php`

### Other components

- **Laravel Application**
- **SSLCommerz Gateway**

## Connections

- Laravel Application → SSLCommerz Facade: calls operations (evidence: `README.md`)
- SSLCommerz Facade → Gateway Client: forwards calls (evidence: `src/Facades/Sslcommerz.php`)
- Service Provider → Package Config: reads settings (evidence: `src/SslcommerzServiceProvider.php`)
- Service Provider → Gateway Client: registers client (evidence: `src/SslcommerzServiceProvider.php`)
- Service Provider → Credential Exception: throws on missing credentials (evidence: `src/SslcommerzServiceProvider.php`)
- Gateway Client → Payment Initiation: performs (evidence: `src/SslcommerzClient.php`)
- Gateway Client → Payment Validation: performs (evidence: `src/SslcommerzClient.php`)
- Gateway Client → Hash Verification: performs (evidence: `src/SslcommerzClient.php`)
- Gateway Client → Refund Operations: performs (evidence: `src/SslcommerzClient.php`)
- Payment Initiation → SSLCommerz Gateway: submits payment (evidence: `src/SslcommerzClient.php`)
- Payment Validation → SSLCommerz Gateway: requests validation (evidence: `src/SslcommerzClient.php`)
- Refund Operations → SSLCommerz Gateway: requests refund data (evidence: `src/SslcommerzClient.php`)
- Payment Initiation → Payment Response: builds response (evidence: `src/SslcommerzClient.php`)
- Refund Operations → Refund Response: builds response (evidence: `src/SslcommerzClient.php`)
- Refund Operations → Refund Status: builds status (evidence: `src/SslcommerzClient.php`)
- Laravel Application → SSLCommerz Gateway: receives callbacks (evidence: `README.md`)
