PHPackages                             buildry-wire/wire-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. [Payment Processing](/categories/payments)
4. /
5. buildry-wire/wire-php

ActiveLibrary[Payment Processing](/categories/payments)

buildry-wire/wire-php
=====================

Official PHP SDK for the Wire payment API

v1.0.0(2d ago)00MITPHPPHP &gt;=8.1CI passing

Since Jun 7Pushed 2d agoCompare

[ Source](https://github.com/buildry-wire/wire-php)[ Packagist](https://packagist.org/packages/buildry-wire/wire-php)[ Docs](https://wire.mn)[ RSS](/packages/buildry-wire-wire-php/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

buildry-wire/wire-php
=====================

[](#buildry-wirewire-php)

Official PHP SDK for the [Wire](https://wire.mn) payment API. Dependency-free (uses only `ext-curl` and `ext-json`); requires PHP 8.1+.

Full documentation: [docs.wire.mn](https://docs.wire.mn).

Install
-------

[](#install)

```
composer require buildry-wire/wire-php
```

Quickstart
----------

[](#quickstart)

```
use BuildryWire\Wire\Wire;

$wire = new Wire('your-api-key');

// Create a payment intent. Amounts are in minor units (MNT integer).
// In test mode use the "sandbox" operator id; in live mode use the
// operator ids enabled on your account.
$pi = $wire->paymentIntents->create([
    'amount' => 50000,
    'currency' => 'MNT',
    'allowed_operators' => ['sandbox'],
]);

echo $pi->id, ' ', $pi->status, PHP_EOL;

// Confirm it.
$pi = $wire->paymentIntents->confirm($pi->id, [
    'return_url' => 'https://example.com/return',
]);
```

Auto-pagination
---------------

[](#auto-pagination)

List methods return a lazy iterator that follows `has_more` automatically:

```
foreach ($wire->charges->list(limit: 50) as $charge) {
    echo $charge->id, PHP_EOL;
}
```

Webhook verification
--------------------

[](#webhook-verification)

Verify the **raw** request body before parsing it. Verification fails closed.

```
use BuildryWire\Wire\Webhooks;
use BuildryWire\Wire\SignatureVerificationError;

$rawBody = file_get_contents('php://input');
$header = $_SERVER['HTTP_WIREPAYMENT_SIGNATURE'] ?? '';

try {
    $event = (new Webhooks())->verify($rawBody, $header, $endpointSecret);
    // handle $event->type
} catch (SignatureVerificationError $e) {
    http_response_code(400);
    exit;
}
```

Errors
------

[](#errors)

```
use BuildryWire\Wire\WireError;
use BuildryWire\Wire\WireConnectionError;

try {
    $wire->paymentIntents->create(['amount' => -1]);
} catch (WireConnectionError $e) {
    // network failure or timeout (retries already exhausted)
} catch (WireError $e) {
    echo $e->code, ' ', $e->requestId, ' ', $e->statusCode, PHP_EOL;
}
```

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

[](#configuration)

```
$wire = new Wire('your-api-key', [
    'baseURL'    => 'https://api.wire.mn', // default
    'timeout'    => 30.0,                  // seconds
    'maxRetries' => 2,                     // retried on 429/5xx/network
    'backoffMs'  => 500,                   // base backoff
]);
```

Requests are authenticated with a bearer token, every `POST` carries an `Idempotency-Key` (generated automatically if you do not supply one and reused across retries), and `429`/`5xx`/network errors are retried with exponential backoff and jitter, honoring `Retry-After`.

License
-------

[](#license)

MIT

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance99

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

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

Unknown

Total

1

Last Release

2d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5488836?v=4)[Usukhbayar](/maintainers/usukhv)[@usukhv](https://github.com/usukhv)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[omnipay/coinbase

Coinbase driver for the Omnipay payment processing library

18570.2k1](/packages/omnipay-coinbase)[yenepay/php-sdk

YenePay SDK for PHP

112.7k](/packages/yenepay-php-sdk)

PHPackages © 2026

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