PHPackages                             paysgator/paysgator-php - 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. paysgator/paysgator-php

ActiveLibrary[API Development](/categories/api)

paysgator/paysgator-php
=======================

Paysgator API Client for PHP

00[4 PRs](https://github.com/paysgator/php-client/pulls)PHP

Since Jan 12Pushed 2mo agoCompare

[ Source](https://github.com/paysgator/php-client)[ Packagist](https://packagist.org/packages/paysgator/paysgator-php)[ RSS](/packages/paysgator-paysgator-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (5)Used By (0)

Paysgator PHP Client
====================

[](#paysgator-php-client)

A PHP client library for the Paysgator API.

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

[](#installation)

Install via Composer:

```
composer require paysgator/paysgator-php
```

Usage
-----

[](#usage)

### Configuration

[](#configuration)

For most requests, you simply need to provide your API Key.

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

use Paysgator\PaysgatorClient;

$client = new PaysgatorClient([
    'api_key' => 'YOUR_API_KEY',
]);
```

### Create Payment

[](#create-payment)

Create a payment transaction.

```
$paymentData = [
    'amount' => 100,
    'currency' => 'MZN',
    'payment_methods' => ['MPESA', 'CARD'],
    'returnUrl' => 'https://mysite.com/return',
];

try {
    $result = $client->payments()->create($paymentData);
    echo "Payment Link: " . $result['data']['checkoutUrl'];
    echo "Transaction ID: " . $result['data']['transactionId'];
} catch (\Exception $e) {
    echo "Error: " . $e->getMessage();
}
```

### Confirm Payment

[](#confirm-payment)

Confirm a payment server-side.

```
try {
    $confirmation = $client->payments()->confirm([
        'paymentLinkId' => 'payment_uuid',
        'paymentMethod' => 'MPESA',
        'payment_fields' => ['phoneNumber' => '841234567']
    ]);
    print_r($confirmation);
} catch (\Exception $e) {
    echo "Error: " . $e->getMessage();
}
```

### Subscriptions

[](#subscriptions)

Manage subscriptions.

```
// Pause a subscription
$client->subscriptions()->update('sub_123', 'pause');
```

### Transactions

[](#transactions)

Retrieve transaction details.

```
$transaction = $client->transactions()->get('txn_123');
print_r($transaction);
```

### Wallet

[](#wallet)

Check wallet balance.

```
$balance = $client->wallet()->getBalance();
echo "Balance: " . $balance['balance'] . " " . $balance['currency'];
```

Support
-------

[](#support)

For issues and support, please contact .

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance58

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity17

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://www.gravatar.com/avatar/b9b1f976d9a920ab761dd1853ac5f7b49a594792e0d1ef0514e49fcea147a8c3?d=identicon)[mozinova](/maintainers/mozinova)

---

Top Contributors

[![mozinova](https://avatars.githubusercontent.com/u/148253541?v=4)](https://github.com/mozinova "mozinova (2 commits)")

---

Tags

payment-integration

### Embed Badge

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

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M475](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M271](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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