PHPackages                             tzsmm/tzsmmpay - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. tzsmm/tzsmmpay

ActiveLibrary

tzsmm/tzsmmpay
==============

PHP library for TZSMM PAY Gateway

v1.0.0(1y ago)128MITPHP

Since Jan 21Pushed 1y ago1 watchersCompare

[ Source](https://github.com/tzsmm/tzsmmpay)[ Packagist](https://packagist.org/packages/tzsmm/tzsmmpay)[ RSS](/packages/tzsmm-tzsmmpay/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

TZSMM Pay PHP Library
=====================

[](#tzsmm-pay-php-library)

[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![Version](https://camo.githubusercontent.com/a6b5f297d1260cbbe878c5ac99612cfddeb5a0ab74e5bdf220b988fb608f286c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f747a736d6d2f747a736d6d7061792e737667)](https://packagist.org/packages/tzsmm/tzsmmpay)

### PHP Library for TZSMM PAY Gateway

[](#php-library-for-tzsmm-pay-gateway)

The **TZSMM Pay** PHP library allows you to integrate the TZSMM Pay payment gateway into your PHP-based applications. It provides easy-to-use methods for creating and verifying payments with the TZSMM Pay API.

---

Features
--------

[](#features)

- **Create Payments**: Create payments directly via the TZSMM Pay API.
- **Verify Payments**: Check payment status in real-time.
- **Supports PHP 7.2 and above**.
- **Secure and Easy Integration**.

---

Installation
------------

[](#installation)

You can install the TZSMM Pay library via Composer.

### Step 1: Install the Package

[](#step-1-install-the-package)

Run the following command in your terminal:

```
composer require tzsmm/tzsmmpay
```

### Step 2: Autoload the Package

[](#step-2-autoload-the-package)

Once installed, Composer will automatically load the library. If you're using a custom autoloader, ensure that the `Tzsmmpay` class is included properly.

---

API Documentation
-----------------

[](#api-documentation)

This section explains how to use the API to create a payment via the TZSMM Pay gateway.

### API Endpoint: `/api/payment/create`

[](#api-endpoint-apipaymentcreate)

**URL**: `https://tzsmmpay.com/api/payment/create`

**Method**: `GET`

### Required Parameters

[](#required-parameters)

To create a payment, send the following parameters in the API request:

- `api_key`: Your TZSMM Pay API key.
- `cus_name`: The name of the customer (e.g., "Demo User").
- `cus_email`: The email of the customer (e.g., "").
- `cus_number`: The phone number of the customer (e.g., "01700000000").
- `amount`: The payment amount (e.g., "1" for 1 unit of currency).
- `success_url`: The URL to redirect the user to after a successful payment (e.g., `https://domain.com/success-url`).
- `cancel_url`: The URL to redirect the user to if they cancel the payment (e.g., `https://domain.com/cancel-url/dashboard`).
- `callback_url`: The URL where payment status will be sent (e.g., `https://domain.com/callback-url`).

### Example Request

[](#example-request)

```
use Tzsmmpay\TzsmmpayClient;
use Tzsmmpay\TzsmmpayResponse;

$apiKey = 'xOevYGbzFmJCm1rkzDrf';  // Your API key

$tzsmm = new TzsmmpayClient($apiKey);

$paymentData = [
    'cus_name' => 'Demo User',
    'cus_email' => 'demo@demo.com',
    'cus_number' => '01700000000',
    'amount' => 1,
    'success_url' => 'https://domain.com/success-url',
    'cancel_url' => 'https://domain.com/cancel-url/dashboard',
    'callback_url' => 'https://domain.com/callback-url',
];

$response = $tzsmm->createPayment($paymentData);

if ($response->isSuccess()) {
    echo "Payment created successfully!";
    echo "Transaction ID: " . $response->getData()['transaction_id'];
    echo "Payment URL: " . $response->getData()['payment_url'];
} else {
    echo "Error: " . $response->getMessage();
}
```

### Example Response

[](#example-response)

```
{
    "success": true,
    "data": {
        "transaction_id": "trx_123456",
        "payment_url": "https://tzsmmpay.com/payment/trx_123456"
    },
    "message": null
}
```

---

Verify Payment
--------------

[](#verify-payment)

After a customer has completed their payment, you can verify the payment using the `verifyPayment` method.

### API Endpoint: `/api/payment/verify`

[](#api-endpoint-apipaymentverify)

**URL**: `https://tzsmmpay.com/api/payment/verify`

**Method**: `GET`

### Example Verification Request

[](#example-verification-request)

```
$transactionId = 'trx_123456';  // Replace with actual transaction ID

$response = $tzsmm->verifyPayment($transactionId);

if ($response->isSuccess()) {
    if ($response->getData()['status'] == 'Completed') {
        echo "Payment verified successfully!";
    } else {
        echo 'Your Payment is ' . $response->getData()['status'];
    }
} else {
    echo "Verification failed: " . $response->getMessage();
}
```

### Example Verification Response

[](#example-verification-response)

```
{
    "success": true,
    "data": {
        "status": "Completed",
        "amount": 1,
        "cus_name": "Demo User",
        "cus_email": "demo@demo.com",
        "cus_number": "01700000000"
    },
    "message": null
}
```

---

Error Handling
--------------

[](#error-handling)

In case of an error, the API will return an error message in the `message` field of the response. Handle errors accordingly in your application:

```
if (!$response->isSuccess()) {
    echo "Error: " . $response->getMessage();
}
```

---

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

---

Contributing
------------

[](#contributing)

Contributions are welcome! Please fork the repository, create a branch, and submit a pull request.

### Steps to Contribute:

[](#steps-to-contribute)

1. Fork the repository.
2. Create a new branch (`git checkout -b feature-name`).
3. Commit your changes (`git commit -am 'Add new feature'`).
4. Push to the branch (`git push origin feature-name`).
5. Open a pull request.

---

Support
-------

[](#support)

For support or questions, please visit [TZSMM Pay Support](https://tzsmmpay.com).

---

Authors
-------

[](#authors)

- **TZSMM** - [Website](https://tzsmmpay.com)
    Email:

---

Changelog
---------

[](#changelog)

### v1.0.0

[](#v100)

- Initial release with core functionality to create and verify payments.

---

Acknowledgements
----------------

[](#acknowledgements)

- TZSMM Pay for providing the API and gateway.
- Composer for managing PHP dependencies.

---

**Happy coding!** 🚀

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance44

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

473d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a86dc7e0efeeff6fc96f9fee6a7e1891b5848af9682d59117e93cd7d7d1af972?d=identicon)[tzsmm](/maintainers/tzsmm)

---

Top Contributors

[![tzsmm](https://avatars.githubusercontent.com/u/195901787?v=4)](https://github.com/tzsmm "tzsmm (19 commits)")

### Embed Badge

![Health badge](/badges/tzsmm-tzsmmpay/health.svg)

```
[![Health](https://phpackages.com/badges/tzsmm-tzsmmpay/health.svg)](https://phpackages.com/packages/tzsmm-tzsmmpay)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
