PHPackages                             kennedymbale/zynle-pay-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. [Payment Processing](/categories/payments)
4. /
5. kennedymbale/zynle-pay-php-sdk

ActiveLibrary[Payment Processing](/categories/payments)

kennedymbale/zynle-pay-php-sdk
==============================

Professional PHP SDK for ZynlePay payment gateway API supporting Mobile Money and Card payments in Zambia.

2.0.0(4mo ago)016MITPHPPHP &gt;=8.0CI failing

Since Jan 2Pushed 4mo agoCompare

[ Source](https://github.com/KennedyMbale/zynle-pay-php-sdk)[ Packagist](https://packagist.org/packages/kennedymbale/zynle-pay-php-sdk)[ RSS](/packages/kennedymbale-zynle-pay-php-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (4)Used By (0)

ZynlePay PHP SDK
================

[](#zynlepay-php-sdk)

A comprehensive PHP 8+ SDK for integrating with the ZynlePay payment gateway API. Supports both production and sandbox environments with full type safety and comprehensive error handling.

Features
--------

[](#features)

- ✅ **PHP 8.0+** with strict typing
- ✅ **Production &amp; Sandbox** environment support
- ✅ **Type-safe API** with detailed PHPDoc
- ✅ **Comprehensive error handling** with custom exceptions
- ✅ **Input validation** for all methods
- ✅ **Composer-ready** package structure
- ✅ **Full test coverage** with PHPUnit

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

[](#installation)

Install via Composer:

```
composer require kennedymbale/zynle-pay-php-sdk
```

Quick Start
-----------

[](#quick-start)

```
use ZynlePay\Client;
use ZynlePay\MomoDeposit;

// Initialize client for sandbox
$client = new Client(
    merchantId: 'your_merchant_id',
    apiId: 'your_api_id',
    apiKey: 'your_api_key',
    channel: 'momo',
    serviceId: '1002'
);

// Create service instance
$momoDeposit = new MomoDeposit($client);

// Process a payment
try {
    $result = $momoDeposit->runBillPayment(
        senderId: '09XXXXXXXX',
        referenceNo: uniqid('ref_', true),
        amount: 1000.00,
        description: 'Payment for services'
    );

    echo "Payment initiated: " . $result['transaction_id'];
} catch (ZynlePay\Exception\ApiException $e) {
    echo "Payment failed: " . $e->getMessage();
}
```

Configuration
-------------

[](#configuration)

### Client Class

[](#client-class)

```
$client = new Client(
    string $merchantId,      // Your ZynlePay merchant ID
    string $apiId,          // Your API ID
    string $apiKey,         // Your API key
    string $channel,        // Payment channel (momo, card, bank, etc.)
    string $serviceId = '1002',  // Service ID (default: '1002')
    bool $sandbox = true     // true for sandbox, false for production
);
```

Services
--------

[](#services)

### MomoDeposit - MOMO Mobile Money Payments

[](#momodeposit---momo-mobile-money-payments)

Process MOMO mobile money payments and check payment status.

```
use ZynlePay\MomoDeposit;

$momoDeposit = new MomoDeposit($client);

// Process payment
$result = $momoDeposit->runBillPayment(
    senderId: '09XXXXXXXX',               // Sender's phone number
    referenceNo: uniqid('ref_', true),     // Unique reference number
    amount: 1000.00,                        // Amount in float
    description: 'Payment'                   // Optional description
);

// Check payment status
$status = $momoDeposit->checkPaymentStatus('REF123456');
```

### CardDeposit - Credit/Debit Card Processing

[](#carddeposit---creditdebit-card-processing)

Handle credit and debit card payments with full PCI compliance.

```
use ZynlePay\MomoDeposit;
$momoService = new MomoDeposit($client);

try {
    $result = $momoService->runBillPayment(
        senderId: '09XXXXXXXX',
        referenceNo: uniqid('ref_', true),
        amount: 70,
        description: 'Payment for services'
    );

    echo "".$result['response_description']."";
    echo "Transaction ID: " . $result['transaction_id'] . "";
    echo "Operator: " . $result['operator'] . "";
    echo "transaction_date: " . $result['transaction_date'] . "";

} catch (ZynlePay\Exception\ApiException $e) {
    echo "Payment failed: " . $e->getMessage();
}
```

### WalletToBank - Bank Transfers from Wallet

[](#wallettobank---bank-transfers-from-wallet)

Transfer funds from your wallet to bank accounts.

```
use ZynlePay\WalletToBank;

$walletToBank = new WalletToBank($client);

// Transfer to bank
$result = $walletToBank->runPayToBank(
    referenceNo: uniqid('ref_', true),
    amount: 500.00,
    description: 'Bank transfer',
    bankName: 'Bank of Example',
    receiverId: '1234567890'
);

// Check transfer status
$status = $walletToBank->checkBankTransferStatus('REF123456');
```

### MomoWithdraw - E-wallet Withdrawals

[](#momowithdraw---e-wallet-withdrawals)

Withdraw funds to MOMO mobile money accounts.

```
use ZynlePay\MomoWithdraw;

$momoWithdraw = new MomoWithdraw($client);

// Withdraw to MOMO
$result = $momoWithdraw->runPayToEwallet(
    referenceNo: 'REF123456',
    amount: 200.00,
    receiverId: '09XXXXXXXX'
);

// Check withdrawal status
$status = $momoWithdraw->checkEwalletTransferStatus('REF123456');
```

### PaymentStatus - Payment Status Checking

[](#paymentstatus---payment-status-checking)

Check the status of any payment transaction.

```
use ZynlePay\PaymentStatus;

$paymentStatus = new PaymentStatus($client);

// Check payment status
try {
    $status = $paymentStatus->checkStatus('REF123456');
    echo "Payment status: " . $status['status'];
} catch (ZynlePay\Exception\ApiException $e) {
    echo "Status check failed: " . $e->getMessage();
}
```

### CheckBalance - Account Balance Inquiry

[](#checkbalance---account-balance-inquiry)

Check your account balance and available funds.

```
use ZynlePay\CheckBalance;

$checkBalance = new CheckBalance($client);

// Check account balance
try {
    $balance = $checkBalance->checkBalance();
    echo "Current balance: " . $balance['balance'] . " " . $balance['currency'];
} catch (ZynlePay\Exception\ApiException $e) {
    echo "Balance check failed: " . $e->getMessage();
}
```

### WebhookHandler - Webhook Processing

[](#webhookhandler---webhook-processing)

Handle payment confirmation webhooks from ZynlePay.

```
use ZynlePay\WebhookHandler;

$webhookHandler = new WebhookHandler();

// Process webhook data
try {
    $result = $webhookHandler->handle($_POST);
    echo "Webhook processed: " . $result['status'];
} catch (ZynlePay\Exception\ApiException $e) {
    echo "Webhook processing failed: " . $e->getMessage();
}
```

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

[](#error-handling)

All service methods throw `ZynlePay\Exception\ApiException` for API-related errors:

```
try {
    $result = $momoDeposit->runBillPayment('09XXXXXXXX', 'REF123', 100.00);
} catch (ZynlePay\Exception\ApiException $e) {
    // Handle API errors (invalid credentials, network issues, etc.)
    error_log("API Error: " . $e->getMessage());
    error_log("Error Code: " . $e->getCode());
} catch (InvalidArgumentException $e) {
    // Handle validation errors (invalid amount, etc.)
    error_log("Validation Error: " . $e->getMessage());
}
```

API Reference
-------------

[](#api-reference)

### Client Class

[](#client-class-1)

- `__construct(string $merchantId, string $apiId, string $apiKey, string $channel, string $serviceId = '1002', ?bool $sandbox = null)`

### MomoDeposit Methods

[](#momodeposit-methods)

- `runBillPayment(string $senderId, string $referenceNo, float $amount, string $description = 'Payment'): array`
- `checkPaymentStatus(string $referenceNo): array`

### CardDeposit Methods

[](#carddeposit-methods)

- `runTranAuthCapture(string $referenceNo, float $amount, string $cardNumber, string $expiryMonth, string $expiryYear, string $cvv, ...$optional): array`

### WalletToBank Methods

[](#wallettobank-methods)

- `runPayToBank(string $referenceNo, float $amount, string $description = 'Bank Transfer', string $bankName = '', string $receiverId = '', ?string $callbackUrl = null, ?string $successUrl = null, ?string $failUrl = null): array`
- `checkBankTransferStatus(string $referenceNo): array`

### MomoWithdraw Methods

[](#momowithdraw-methods)

- `runPayToEwallet(string $referenceNo, float $amount, string $receiverId): array`
- `checkEwalletTransferStatus(string $referenceNo): array`

### PaymentStatus Methods

[](#paymentstatus-methods)

- `checkPaymentStatus(string $referenceNo): array`

### CheckBalance Methods

[](#checkbalance-methods)

- `checkBalance(): array`

### WebhookHandler Methods

[](#webhookhandler-methods)

- `handle(array $webhookData): array`

Testing
-------

[](#testing)

Run the test suite with PHPUnit:

```
composer test
```

Run specific test files:

```
./vendor/bin/phpunit tests/MomoDepositTest.php
```

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

[](#requirements)

- **PHP**: 8.0 or higher
- **Extensions**: curl, json
- **Composer**: For dependency management
- **PHPUnit**: For testing (development only)

Support
-------

[](#support)

For issues and questions:

- Check the [ZynlePay API Documentation](https://sandbox.zynlepay.com/api/docs) (sign in to access)
- Review the test files for usage examples
- Ensure your credentials and configuration are correct

License
-------

[](#license)

This SDK is released under the MIT License. See LICENSE file for details.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance76

Regular maintenance activity

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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

Every ~0 days

Total

3

Last Release

129d ago

Major Versions

1.2.0 → 2.0.02026-01-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/1f959066cad4f04ac5fc9cd07ab0c81ffc24328c2fdbce78edc357683c2f4f30?d=identicon)[KeneliTech](/maintainers/KeneliTech)

---

Top Contributors

[![KennedyMbale](https://avatars.githubusercontent.com/u/18715261?v=4)](https://github.com/KennedyMbale "KennedyMbale (12 commits)")

---

Tags

phpsdkpaymentgatewaycardmobile-moneyzynlepayZambia

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/kennedymbale-zynle-pay-php-sdk/health.svg)

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

###  Alternatives

[lokielse/omnipay-wechatpay

Wechat gateway for Omnipay payment processing library

329224.5k7](/packages/lokielse-omnipay-wechatpay)

PHPackages © 2026

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