PHPackages                             palpluss/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. palpluss/sdk

ActiveLibrary[Payment Processing](/categories/payments)

palpluss/sdk
============

Official PHP SDK for the PalPluss payments API — STK Push, B2C payouts, and service wallet management

01PHP

Since Mar 24Pushed 3mo agoCompare

[ Source](https://github.com/Palpluss/Palpluss-php)[ Packagist](https://packagist.org/packages/palpluss/sdk)[ RSS](/packages/palpluss-sdk/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

PalPluss PHP SDK
================

[](#palpluss-php-sdk)

Official PHP SDK for the [PalPluss](https://palpluss.com) payment API.

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

[](#requirements)

- PHP 8.1+
- Composer

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

[](#installation)

```
composer require palpluss/sdk
```

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

[](#quick-start)

```
use PalPluss\PalPluss;

$client = new PalPluss(apiKey: 'pk_live_...');

$result = $client->stkPush(amount: 500, phone: '254712345678');
echo $result['transactionId'];
```

The API key can also be set via the `PALPLUSS_API_KEY` environment variable:

```
$client = new PalPluss(); // reads PALPLUSS_API_KEY from env
```

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

[](#configuration)

```
$client = new PalPluss(
    apiKey: 'pk_live_...',
    timeout: 30.0,               // request timeout in seconds (default: 30)
    autoRetryOnRateLimit: true,  // auto-retry on HTTP 429 (default: true)
    maxRetries: 3,               // max retry attempts (default: 3)
);
```

Methods
-------

[](#methods)

### STK Push

[](#stk-push)

```
$result = $client->stkPush(
    amount: 500,
    phone: '254712345678',
    accountReference: 'ORDER-001',    // optional
    transactionDesc: 'Order payment', // optional
    channelId: 'ch_abc',              // optional
    callbackUrl: 'https://...',       // optional
    credentialId: 'cred_abc',         // optional
);
// $result['transactionId'], $result['status'], ...
```

### B2C Payout

[](#b2c-payout)

```
$result = $client->b2cPayout(
    amount: 1000,
    phone: '254712345678',
    currency: 'KES',                 // optional
    reference: 'PAYOUT-001',        // optional
    description: 'Salary payment',  // optional
    channelId: 'ch_abc',            // optional
    credentialId: 'cred_abc',       // optional
    callbackUrl: 'https://...',     // optional
    idempotencyKey: 'uuid-...',     // optional — auto-generated UUID v4 if not provided
);
```

### Service Wallet

[](#service-wallet)

```
// Get balance
$balance = $client->getServiceBalance();
// $balance['balance'], $balance['currency']

// Top up
$topup = $client->serviceTopup(
    amount: 500,
    phone: '254712345678',
    accountReference: 'REF-001',    // optional
    transactionDesc: 'Top up',      // optional
    idempotencyKey: 'uuid-...',     // optional
);
```

### Transactions

[](#transactions)

```
// Get single transaction
$txn = $client->getTransaction('txn_abc123');

// List transactions
$list = $client->listTransactions(
    limit: 20,          // optional
    cursor: 'cursor_',  // optional — for pagination
    status: 'SUCCESS',  // optional
    type: 'STK',        // optional — "STK" or "B2C"
);
// $list['items'], $list['next_cursor']
```

### Payment Wallet Channels

[](#payment-wallet-channels)

```
// Create
$channel = $client->createChannel(
    type: 'PAYBILL',          // "PAYBILL", "TILL", or "SHORTCODE"
    shortcode: '123456',
    name: 'My Paybill',
    accountNumber: 'ACC-01',  // optional
    isDefault: true,          // optional
);

// Update
$channel = $client->updateChannel(
    channelId: 'ch_001',
    name: 'Updated Name',     // all update fields are optional
);

// Delete
$client->deleteChannel('ch_001');
```

### Webhooks

[](#webhooks)

```
use PalPluss\Webhooks;

// In your webhook handler:
$payload = Webhooks::parsePayload(file_get_contents('php://input'));

echo $payload['event_type'];              // e.g. "transaction.success"
echo $payload['transaction']['id'];       // transaction ID
echo $payload['transaction']['status'];   // transaction status
```

Valid event types: `transaction.success`, `transaction.failed`, `transaction.cancelled`, `transaction.expired`, `transaction.updated`.

`parsePayload()` throws `\InvalidArgumentException` if the payload is invalid or missing required fields.

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

[](#error-handling)

```
use PalPluss\Http\Errors\PalPlussApiError;
use PalPluss\Http\Errors\RateLimitError;

try {
    $result = $client->stkPush(amount: 500, phone: '254712345678');
} catch (RateLimitError $e) {
    echo "Rate limited. Retry after: {$e->retryAfter}s\n";
} catch (PalPlussApiError $e) {
    echo "API error [{$e->errorCode}] HTTP {$e->httpStatus}: {$e->getMessage()}\n";
    // $e->requestId  — request ID from the API response
    // $e->details    — additional error details array
}
```

Development
-----------

[](#development)

```
# Install dependencies
composer install

# Run tests
vendor/bin/phpunit
```

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance55

Moderate activity, may be stable

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

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/5637692?v=4)[Navid](/maintainers/bazarin)[@bazarin](https://github.com/bazarin)

---

Top Contributors

[![BazarinTech](https://avatars.githubusercontent.com/u/161435099?v=4)](https://github.com/BazarinTech "BazarinTech (3 commits)")

### Embed Badge

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

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

###  Alternatives

[omnipay/coinbase

Coinbase driver for the Omnipay payment processing library

18570.2k1](/packages/omnipay-coinbase)

PHPackages © 2026

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