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

ActiveLibrary[Payment Processing](/categories/payments)

paykrypt/paykrypt-php-sdk
=========================

Official PHP SDK for the PayKrypt crypto payment gateway API.

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

Since Jun 14Pushed 1mo agoCompare

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

READMEChangelogDependencies (8)Versions (2)Used By (0)

PayKrypt PHP SDK
================

[](#paykrypt-php-sdk)

Official PHP SDK for the PayKrypt crypto payment gateway API.

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

[](#installation)

```
composer require paykrypt/paykrypt-php-sdk
composer require guzzlehttp/guzzle
```

The SDK is framework-agnostic and uses PSR-18 HTTP clients. If no PSR-18 client can be auto-discovered, install one such as `guzzlehttp/guzzle` or `symfony/http-client`.

Requires PHP 8.1 or newer.

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

[](#quick-start)

```
use PayKrypt\PayKryptClient;

$paykrypt = new PayKryptClient([
    'apiKey' => getenv('PAYKRYPT_API_KEY'),
    'baseUrl' => getenv('PAYKRYPT_BASE_URL') ?: 'https://api.paykrypt.io',
]);

$intent = $paykrypt->paymentIntents->create([
    'amount' => '100.00',
    'currency' => 'USD',
    'description' => 'Order #12345',
    'customerEmail' => 'customer@example.com',
    'allowedChains' => ['ethereum', 'tron'],
    'expiresInMinutes' => 60,
]);

// Redirect the customer to:
// https://gate.paykrypt.io/pay/{$intent['id']}
```

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

[](#configuration)

```
$paykrypt = new PayKryptClient([
    'apiKey' => 'pk_12345678_...',
    'baseUrl' => 'https://api.paykrypt.io',
    'timeout' => 30_000,
    'retries' => 3,
    'retryDelayMs' => 250,
]);
```

All merchant API calls use:

```
Authorization: Bearer pk__
```

Sandbox and live environments are selected by `baseUrl`.

Idempotency
-----------

[](#idempotency)

PayKrypt requires an `Idempotency-Key` on value-creating POST endpoints. The SDK generates one automatically for:

- `paymentIntents->create()`
- `payouts->create()`
- `payouts->createWithVerification()`
- `refunds->create()`
- `refunds->createWithVerification()`
- `conversions->convert()`

Pass your own stable key when retrying the same app-level action:

```
$intent = $paykrypt->paymentIntents->create(
    ['amount' => '100.00', 'currency' => 'USD'],
    ['idempotencyKey' => 'order:12345'],
);
```

Resources
---------

[](#resources)

```
$paykrypt->paymentIntents->retrieve('pi_...');
$paykrypt->paymentIntents->list(['page' => 1, 'limit' => 20]);
$paykrypt->paymentIntents->cancel('pi_...');

$paykrypt->payouts->create([
    'amount' => '95',
    'currency' => 'USDT',
    'destinationAddress' => 'TXYZ...',
    'chainId' => 'tron',
]);
$paykrypt->payouts->stats();

$paykrypt->refunds->create([
    'paymentIntentId' => '00000000-0000-0000-0000-000000000000',
    'amount' => '50.00',
    'reason' => 'Customer requested refund',
]);

$paykrypt->webhooks->register([
    'url' => 'https://example.com/webhooks/paykrypt',
    'events' => ['payment.confirmed.v1'],
]);

$paykrypt->addressBook->create([
    'label' => 'Treasury wallet',
    'address' => 'TXYZ...',
    'chainId' => 'tron',
]);

$paykrypt->conversions->preview([
    'fromAssetId' => 1,
    'toAssetId' => 2,
    'amount' => 10,
]);

$paykrypt->currencies->list();
$paykrypt->assets->list();
$paykrypt->assets->listByChain('tron');
$paykrypt->pricing->rates(['currency' => 'USD', 'symbols' => ['BTC', 'ETH', 'USDT']]);
```

Responses are returned as associative arrays to stay compatible with PayKrypt's evolving API response shapes.

Webhook Verification
--------------------

[](#webhook-verification)

PayKrypt signs webhook deliveries with `X-PayKrypt-Signature` and `X-PayKrypt-Timestamp`. Use the `secret` returned from `webhooks->register(...)` as `PAYKRYPT_WEBHOOK_SECRET`.

```
use PayKrypt\Webhook;
use PayKrypt\WebhookVerificationException;

$rawBody = file_get_contents('php://input');
$headers = getallheaders() ?: [];

try {
    $event = Webhook::constructEvent(
        $rawBody,
        $headers,
        getenv('PAYKRYPT_WEBHOOK_SECRET')
    );

    if ($event['type'] === 'payment.confirmed.v1') {
        // Fulfill the order.
    }
} catch (WebhookVerificationException $exception) {
    http_response_code(400);
    echo 'Invalid webhook signature';
    return;
}
```

The signature payload is:

```
.
```

The SDK also accepts the older documented aliases `Paykrypt-Signature` and `Paykrypt-Timestamp`.

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

[](#error-handling)

```
use PayKrypt\PayKryptApiException;

try {
    $paykrypt->paymentIntents->retrieve('pi_missing');
} catch (PayKryptApiException $exception) {
    error_log($exception->getStatusCode() . ' ' . $exception->getErrorCode() . ' ' . $exception->getMessage());
}
```

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

[](#development)

```
composer validate --strict
composer install
composer lint
composer analyse
composer test
```

Publishing To Packagist
-----------------------

[](#publishing-to-packagist)

1. Push `main` to `https://github.com/PayKrypt/paykrypt-php-sdk`.
2. Submit the public repository URL to Packagist once under `paykrypt/paykrypt-php-sdk`.
3. Enable Packagist auto-updates through the GitHub app, or configure a GitHub webhook manually: payload URL `https://packagist.org/api/github?username=PACKAGIST_USERNAME`, content type `application/json`, secret set to your Packagist API token, and push events only.
4. Tag releases with semantic version tags such as `v1.0.0`; Composer reads package versions from VCS tags, so do not add a `version` field to `composer.json`.
5. Create a GitHub Release from the tag and verify Packagist indexed the new version.

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

 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

46d ago

### Community

Maintainers

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

---

Top Contributors

[![sc-starman](https://avatars.githubusercontent.com/u/40363706?v=4)](https://github.com/sc-starman "sc-starman (1 commits)")

---

Tags

sdkcryptopaymentspayment gatewaypaykrypt

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

36789.4k2](/packages/telnyx-telnyx-php)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k17](/packages/tempest-framework)[chargebee/chargebee-php

ChargeBee API client implementation for PHP

758.5M9](/packages/chargebee-chargebee-php)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

1003.9M50](/packages/getbrevo-brevo-php)[laudis/neo4j-php-client

Neo4j-PHP-Client is the most advanced PHP Client for Neo4j

185702.8k44](/packages/laudis-neo4j-php-client)

PHPackages © 2026

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