PHPackages                             coinwaka/coinwaka-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. coinwaka/coinwaka-php

ArchivedLibrary[Utility &amp; Helpers](/categories/utility)

coinwaka/coinwaka-php
=====================

Official PHP SDK for the Coinwaka Pay API.

v1.0.0(1mo ago)001MITPHPPHP &gt;=8.1CI passing

Since Jun 23Pushed 1mo agoCompare

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

READMEChangelogDependenciesVersions (2)Used By (1)

coinwaka/coinwaka-php
=====================

[](#coinwakacoinwaka-php)

Official PHP SDK for the [Coinwaka Pay API](https://developers.coinwaka.com). No third-party dependencies (ext-curl + ext-json), PHP 8.1+.

```
composer require coinwaka/coinwaka-php
```

Quickstart
----------

[](#quickstart)

Create an intent, redirect the customer to its hosted checkout, and fulfil the order on the signed `payment_intent.paid` webhook.

```
use Coinwaka\Coinwaka;

$coinwaka = new Coinwaka(['apiKey' => getenv('COINWAKA_SECRET_KEY')]);

$intent = $coinwaka->paymentIntents->create([
    'amount' => '2500',
    'currency' => 'KES',
    'settlement_currency' => 'USDT',
    'payment_methods' => ['mpesa', 'card', 'coinwaka_balance'],
    'merchant_reference' => 'ORDER-1001',
]);

header('Location: ' . $intent['checkout_url']);
```

A `cwk_test_…` key runs in sandbox (no real money); a `cwk_live_…` key is live. Every create call sends an `Idempotency-Key` automatically, so an automatic retry (on 429/5xx) never double-charges.

Resources
---------

[](#resources)

```
$coinwaka->auth->verify();
$coinwaka->rates->retrieve();
$coinwaka->quotes->create(['source_currency' => 'KES', 'target_asset' => 'USDT', 'amount' => '2500']);

$coinwaka->paymentIntents->create($params, ['idempotencyKey' => 'order-1001']);
$coinwaka->paymentIntents->retrieve('pi_...');
$coinwaka->paymentIntents->all(['limit' => 20, 'status' => 'paid']);
$coinwaka->paymentIntents->cancel('pi_...');
$coinwaka->paymentIntents->refundRequest('pi_...', ['reason' => 'Customer returned item']);

$coinwaka->paymentLinks->create(['title' => 'Deposit', 'amount' => '15000', 'currency' => 'KES']);
$coinwaka->paymentLinks->retrieve('pl_...');
```

Verify webhooks
---------------

[](#verify-webhooks)

Pass the **raw** request body.

```
$payload = file_get_contents('php://input');

try {
    $event = $coinwaka->webhooks->verify(
        $payload,
        $_SERVER['HTTP_COINWAKA_SIGNATURE'],
        $_SERVER['HTTP_COINWAKA_TIMESTAMP'],
        getenv('COINWAKA_WEBHOOK_SECRET')
    );
    if ($event['type'] === 'payment_intent.paid') {
        // fulfil the order (dedupe on $event['id'])
    }
    http_response_code(200);
} catch (\Coinwaka\CoinwakaError $e) {
    http_response_code(400);
}
```

Errors
------

[](#errors)

```
try {
    $coinwaka->paymentIntents->create(['amount' => '0', 'currency' => 'KES']);
} catch (\Coinwaka\CoinwakaError $e) {
    error_log($e->type . ' ' . $e->apiCode . ' ' . $e->getMessage() . ' ' . $e->getRequestId());
}
```

The full contract is published as OpenAPI at .

License
-------

[](#license)

MIT

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance90

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

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

45d ago

### Community

Maintainers

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

---

Tags

cryptopaymentspayment gatewaympesaUSDTcoinwaka

### Embed Badge

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

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

###  Alternatives

[andrewcarteruk/cryptokey

A command line tool for generating keys using a CSPRNG.

6024.4k](/packages/andrewcarteruk-cryptokey)

PHPackages © 2026

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