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

ActiveLibrary[Payment Processing](/categories/payments)

pagnow/sdk-php
==============

Official PHP SDK for the PagNow payments API

v0.5.0(1mo ago)05MITPHPPHP &gt;=8.1

Since May 27Pushed 1mo agoCompare

[ Source](https://github.com/pagnowtech/sdk-php)[ Packagist](https://packagist.org/packages/pagnow/sdk-php)[ Docs](https://docs.v2.pagnow.com)[ RSS](/packages/pagnow-sdk-php/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (6)Used By (0)

pagnow/sdk-php
==============

[](#pagnowsdk-php)

Official PHP client for the [PagNow](https://pagnow.com) payments API. Zero runtime dependencies (native cURL), PHP 8.1+.

```
composer require pagnow/sdk-php
```

Quickstart
----------

[](#quickstart)

```
use Pagnow\PagNow;

// The apikey identifies your tenant — no tenantId needed.
// baseUrl defaults to https://v2.pagnow.com (the live API host).
$pagnow = new PagNow(['apiKey' => getenv('PAGNOW_API_KEY')]);

$charge = $pagnow->payments->create([
    'amount' => 1990,                 // cents
    'currency' => 'BRL',
    'paymentMethods' => ['PIX'],
    'customer' => [
        'name' => 'João Silva',
        'document' => '52998224725',
        'email' => 'joao@exemplo.com',
    ],
    'idempotencyKey' => "pedido-{$orderId}",
]);

echo $charge['pixCopyPaste'];

// Status, refund (full/partial), cancel:
$status = $pagnow->payments->retrieve($charge['id']);
$pagnow->payments->refund($charge['id'], ['idempotencyKey' => "refund-{$charge['id']}"]);
$pagnow->payments->cancel($charge['id']);
```

Payouts (withdrawals)
---------------------

[](#payouts-withdrawals)

Move money **out** of your wallet to a PIX key, bank account, or crypto address.

```
$payout = $pagnow->payouts->create([
    'type' => 'PIX',
    'amount' => 10000,            // cents
    'currency' => 'BRL',
    'pixKey' => 'joao@exemplo.com',
    'pixKeyType' => 'EMAIL',
]);

$pagnow->payouts->retrieve($payout['id']);
$pagnow->payouts->list(['status' => 'PENDING']);
```

A payout starts as `PENDING`. Whether it dispatches **immediately** or waits for **manual review** is controlled per-account by PagNow (the "auto-payout" setting — ask your account manager to enable it). Track the outcome with the `withdrawal.*` webhook events or by polling `retrieve()`.

You may hold **multiple wallets per currency**. Omit `walletId` and the payout debits the currency's default wallet (or any spendable wallet with balance); pass `walletId` to target a specific one.

Wallets
-------

[](#wallets)

```
$wallets = $pagnow->wallets->list();
// → [['id' => ..., 'currency' => 'BRL', 'isDefault' => true, 'balance' => ...], ...]

$pagnow->wallets->retrieve($wallets[0]['id']);
```

Balances are in the smallest currency unit (centavos). Wallet creation is handled by PagNow (admin); the SDK is read-only here.

Webhooks
--------

[](#webhooks)

```
$raw = file_get_contents('php://input');
$sig = $_SERVER['HTTP_X_PAGNOW_SIGNATURE'] ?? '';

if (!$pagnow->webhooks->verify($raw, $sig, getenv('PAGNOW_WEBHOOK_SECRET'))) {
    http_response_code(401);
    exit;
}
$event = json_decode($raw, true);
// ...handle $event['newStatus'] ...
http_response_code(200);
```

Errors
------

[](#errors)

Every non-2xx response throws a typed exception carrying the API's stable error envelope (`statusCode`, `message`, `requestId`, `fieldErrors`):

HTTPClassUse400 / 422`Pagnow\Exceptions\PagNowValidationException`inspect `->fieldErrors`401 / 403`Pagnow\Exceptions\PagNowAuthException`check the apikey / tenant status409`Pagnow\Exceptions\PagNowConflictException`idempotencyKey reused with a different body5xx`Pagnow\Exceptions\PagNowException`retried automatically (3 attempts, jittered backoff)transport`Pagnow\Exceptions\PagNowNetworkException`timeout / connection failure```
use Pagnow\Exceptions\PagNowValidationException;

try {
    $pagnow->payments->create([...]);
} catch (PagNowValidationException $e) {
    foreach ($e->fieldErrors as $field => $reasons) {
        echo "$field: " . implode(', ', $reasons) . "\n";
    }
    echo "requestId: {$e->requestId}\n"; // quote this to support
}
```

Defaults
--------

[](#defaults)

- 30s per-request timeout (`timeoutMs`)
- 3 retries on 5xx / network errors with full-jitter exponential backoff; 4xx never retried
- Amounts are in the smallest currency unit (cents/centavos)

Prefer raw HTTP?
----------------

[](#prefer-raw-http)

The API is plain REST + JSON — implement directly with Guzzle/cURL using the in-dashboard docs (Integração → Documentação) and the OpenAPI reference at `https://v2.pagnow.com/docs/payments/reference`.

License
-------

[](#license)

MIT

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance89

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

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.

###  Release Activity

Cadence

Every ~0 days

Total

5

Last Release

57d ago

### Community

Maintainers

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

---

Top Contributors

[![Muulfz](https://avatars.githubusercontent.com/u/33735654?v=4)](https://github.com/Muulfz "Muulfz (6 commits)")

---

Tags

stripepaymentssepapixstablecoinpagnow

### Embed Badge

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

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

###  Alternatives

[aktive_merchant/aktive_merchant

Aktive-Merchant provides a common interface to process payments using multiple gateways.

14936.8k](/packages/aktive-merchant-aktive-merchant)[chronon/stripe

A CakePHP 2.x Stripe Payment Processing Component.

4246.8k](/packages/chronon-stripe)[enupal/stripe

Allows customers sign up for recurring and one-time payments with Stripe, perfect for orders, donations, subscriptions, and events. Create simple payment forms in seconds easily without coding. For Craft CMS 3.x

3416.6k1](/packages/enupal-stripe)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

882.2k1](/packages/musahmusah-laravel-multipayment-gateways)[tomatophp/filament-payments

Manage your payments inside FilamentPHP app with multi payment gateway integration

542.5k](/packages/tomatophp-filament-payments)[mmanos/laravel-billing

A billing package for Laravel 4.

461.3k](/packages/mmanos-laravel-billing)

PHPackages © 2026

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