PHPackages                             paytez/paytez-php-sdk - 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. [API Development](/categories/api)
4. /
5. paytez/paytez-php-sdk

ActiveLibrary[API Development](/categories/api)

paytez/paytez-php-sdk
=====================

PAYTez PHP SDK for interacting with the PAYTez API

00PHP

Since Aug 18Pushed 2y ago1 watchersCompare

[ Source](https://github.com/unpyn/paytez-php-sdk)[ Packagist](https://packagist.org/packages/paytez/paytez-php-sdk)[ RSS](/packages/paytez-paytez-php-sdk/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

```
# PAYTez PHP SDK

The PAYTez PHP SDK provides a convenient way to interact with the PAYTez API for handling web payments. This SDK allows you to create and verify web payments using PHP and cURL.

## Installation

You can install the PAYTez PHP SDK via Composer. Run the following command in your project's root directory:

```bash
composer require paytez/paytez-php-sdk
```

Usage
-----

[](#usage)

### Using Composer:

[](#using-composer)

To use the PAYTez PHP SDK with Composer, follow the steps below:

1. Include the Composer autoloader in your PHP script:

```
require_once 'vendor/autoload.php';
```

2. Create an instance of the PaytezApiClient class with your PAYTez API key:

```
use Paytez\PaytezApi\PaytezApiClient;

$apiKey = 'your-api-key';
$paytezClient = new PaytezApiClient($apiKey, true); // Set to true for sandbox, false for live environment
```

3. Create a Web Payment:

```
$invoiceAmount = "10";
$currencySymbol = "USD";
$successUrl = "http://example.com/success";
$failureUrl = "http://example.com/failure";

try {
    $redirectLink = $paytezClient->createWebPayment($invoiceAmount, $currencySymbol, $successUrl, $failureUrl);
    // Redirect the user to the payment page
    header("Location: " . $redirectLink);
    //FOR LARAVEL INTEGRATION USE THIS REDIRECT
    // return redirect()->away($redirectLink);
    exit();
} catch (\Exception $e) {
    // Handle any exceptions that may occur during the API call
    echo "Error: " . $e->getMessage();
}
```

4. Verify a Web Payment:

```
$invoiceNo = "123456";

try {
    $verificationResult = $paytezClient->verifyWebPayment($invoiceNo);
    // Process the verification result as needed
    var_dump($verificationResult);
} catch (\Exception $e) {
    // Handle any exceptions that may occur during the API call
    echo "Error: " . $e->getMessage();
}
```

### Without Using Composer:

[](#without-using-composer)

To use the PAYTez PHP SDK without Composer, follow these steps:

1. Download the SDK Files: Download the PAYTez PHP SDK files, including all the PHP files and the `src` folder containing the classes.
2. Include the SDK Files: Include the necessary SDK files in your PHP script using the `require_once` or `include_once` statements. Make sure to adjust the paths according to your project's file structure.

    For example:

    ```
    // Replace 'path/to/paytez-php-sdk/src/' with the actual path to the SDK files
    require_once 'path/to/paytez-php-sdk/src/PaytezApi/PaytezApiClient.php';
    ```
3. Create an Instance of PaytezApiClient: Create an instance of the `PaytezApiClient` class with your PAYTez API key. Also, specify whether you want to use the sandbox or live environment.

    For example:

    ```
    $apiKey = 'your-api-key';
    $paytezClient = new Paytez\PaytezApi\PaytezApiClient($apiKey, true); // Set to true for sandbox, false for live environment
    ```
4. Use the Package's Methods: Now, you can use the methods provided by the PAYTez PHP SDK, such as `createWebPayment` and `verifyWebPayment`, in your PHP code.

    For example:

    ```
    // Create a Web Payment
    $invoiceAmount = "10";
    $currencySymbol = "USD";
    $successUrl = "http://example.com/success";
    $failureUrl = "http://example.com/failure";

    try {
        $redirectLink = $paytezClient->createWebPayment($invoiceAmount, $currencySymbol, $successUrl, $failureUrl);
        // Redirect the user to the payment page
        header("Location: " . $redirectLink);
        exit();
    } catch (\Exception $e) {
        // Handle any exceptions that may occur during the API call
        echo "Error: " . $e->getMessage();
    }

    // Verify a Web Payment
    $invoiceNo = "123456";

    try {
        $verificationResult = $paytezClient->verifyWebPayment($invoiceNo);
        // Process the verification result as needed
        var_dump($verificationResult);
    } catch (\Exception $e) {
        // Handle any exceptions that may occur during the API call
        echo "Error: " . $e->getMessage();
    }
    ```

Requirements
------------

[](#requirements)

- PHP 7.0 or higher
- cURL extension enabled

License
-------

[](#license)

The PAYTez PHP SDK is open-source software licensed under the [MIT License](LICENSE).

###  Health Score

13

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity22

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/82494964?v=4)[UnPyn](/maintainers/unpyn)[@unpyn](https://github.com/unpyn)

---

Top Contributors

[![jurjees23](https://avatars.githubusercontent.com/u/43169791?v=4)](https://github.com/jurjees23 "jurjees23 (7 commits)")

### Embed Badge

![Health badge](/badges/paytez-paytez-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/paytez-paytez-php-sdk/health.svg)](https://phpackages.com/packages/paytez-paytez-php-sdk)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k15](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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