PHPackages                             paymentic/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. [API Development](/categories/api)
4. /
5. paymentic/php-sdk

ActiveLibrary[API Development](/categories/api)

paymentic/php-sdk
=================

Paymentic SDK for PHP

1.0.4(2mo ago)32763MITPHPPHP &gt;=8.2CI passing

Since Dec 8Pushed 2mo agoCompare

[ Source](https://github.com/paymentic/php-sdk)[ Packagist](https://packagist.org/packages/paymentic/php-sdk)[ Docs](https://www.paymentic.com)[ RSS](/packages/paymentic-php-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (32)Versions (11)Used By (0)

Paymentic PHP SDK
=================

[](#paymentic-php-sdk)

Official PHP SDK for [Paymentic](https://www.paymentic.com) payment gateway.

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

[](#requirements)

- PHP 8.2+
- PSR-18 HTTP Client (e.g., Guzzle)

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

[](#installation)

```
composer require paymentic/php-sdk
```

For HTTP client, install Guzzle (recommended):

```
composer require guzzlehttp/guzzle guzzlehttp/psr7
```

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

[](#quick-start)

### Initialize the Client

[](#initialize-the-client)

```
use Paymentic\Sdk\PaymenticClientFactory;
use Paymentic\Sdk\Environment;

$client = PaymenticClientFactory::create('your-api-key')
    ->withSandbox() // or ->withProduction()
    ->build();
```

### Create a Transaction

[](#create-a-transaction)

```
use Paymentic\Sdk\Payment\Application\DTO\CreateTransactionRequest;
use Paymentic\Sdk\Shared\Enum\Currency;

$request = new CreateTransactionRequest(
    amount: '100.00',
    title: 'Order #12345',
    currency: Currency::PLN,
    description: 'Payment for order',
    externalReferenceId: 'order-12345',
);

$response = $client->payment()->transactions()->create(
    pointId: 'your-point-id',
    request: $request,
);

// Redirect user to payment page
$paymentUrl = $response->paymentUrl;
```

### Get Transaction by ID

[](#get-transaction-by-id)

```
$transaction = $client->payment()->transactions()->get(
    pointId: 'your-point-id',
    transactionId: 'transaction-uuid',
);

echo $transaction->status->value;
```

### Get Available Payment Channels

[](#get-available-payment-channels)

```
$channels = $client->payment()->points()->getChannels(
    pointId: 'your-point-id',
);

foreach ($channels as $channel) {
    echo $channel->name;
}
```

Webhook Handling
----------------

[](#webhook-handling)

Use `PaymentWebhookHandlerFactory` to process incoming webhooks securely:

```
use Paymentic\Sdk\Payment\Webhook\PaymentWebhookHandlerFactory;

$handler = PaymentWebhookHandlerFactory::create('your-webhook-signature-key');

// Get headers and body from your framework (e.g., Laravel, Symfony)
$headers = new WebhookHeaders(
    event: $request->header('X-Paymentic-Event'),
    notificationId: $request->header('X-Paymentic-Notification-Id'),
    time: $request->header('X-Paymentic-Time'),
    signature: $request->header('X-Paymentic-Signature'),
    userAgent: $request->header('User-Agent'),
);
$rawBody = $request->getContent();

try {
    $webhook = $handler->handle($headers, $rawBody);

    // Access webhook data
    $event = $webhook->headers->event;
    $payload = $webhook->payload;

    // Handle based on event type
    match ($event) {
        \Paymentic\Sdk\Shared\Webhook\WebhookEvent::PAYMENT_TRANSACTION_STATUS_CHANGED =>
            handleTransactionStatusChanged($payload),
        \Paymentic\Sdk\Shared\Webhook\WebhookEvent::PAYMENT_REFUND_STATUS_CHANGED =>
            handleRefundStatusChanged($payload),
        default => null,
    };
} catch (\Paymentic\Sdk\Shared\Webhook\Exception\InvalidWebhookSignatureException $e) {
    // Invalid signature - reject the request
    return response('Unauthorized', 401);
}
```

Framework Integration
---------------------

[](#framework-integration)

### Laravel

[](#laravel)

The SDK auto-registers via package discovery.

#### Configuration

[](#configuration)

Publish the config file:

```
php artisan vendor:publish --tag=paymentic-config
```

Add to your `.env`:

```
PAYMENTIC_API_KEY=your-api-key
PAYMENTIC_SANDBOX=true
PAYMENTIC_WEBHOOK_SECRET=your-webhook-secret
```

#### Using Dependency Injection (recommended)

[](#using-dependency-injection-recommended)

```
use Paymentic\Sdk\PaymenticClient;
use Paymentic\Sdk\Payment\Application\DTO\CreateTransactionRequest;

class PaymentController extends Controller
{
    public function __construct(
        private PaymenticClient $paymentic,
    ) {
    }

    public function createPayment()
    {
        $request = new CreateTransactionRequest(
            amount: '100.00',
            title: 'Order #12345',
        );

        $response = $this->paymentic->payment()->transactions()->create(
            pointId: 'your-point-id',
            request: $request,
        );

        return redirect($response->paymentUrl);
    }
}
```

#### Using Container

[](#using-container)

```
use Paymentic\Sdk\PaymenticClient;

// Via container
$client = app(PaymenticClient::class);

// Or using alias
$client = app('paymentic');

// Then use normally
$transaction = $client->payment()->transactions()->get(
    pointId: 'your-point-id',
    transactionId: 'transaction-uuid',
);
```

#### Manual Instantiation (without container)

[](#manual-instantiation-without-container)

```
use GuzzleHttp\Client;
use GuzzleHttp\Psr7\HttpFactory;
use Paymentic\Sdk\PaymenticClient;
use Paymentic\Sdk\Environment;

$httpFactory = new HttpFactory();

$client = new PaymenticClient(
    apiKey: 'your-api-key',
    httpClient: new Client(),
    requestFactory: $httpFactory,
    streamFactory: $httpFactory,
    environment: Environment::SANDBOX,
);

$channels = $client->payment()->points()->getChannels('your-point-id');
```

#### Webhook Controller Example

[](#webhook-controller-example)

```
use Illuminate\Http\Request;
use Paymentic\Sdk\Shared\Webhook\WebhookHandler;
use Paymentic\Sdk\Shared\Webhook\WebhookEvent;

class WebhookController extends Controller
{
    public function __construct(
        private WebhookHandler $webhookHandler,
    ) {
    }

    public function handle(Request $request)
    {
        $webhook = $this->webhookHandler->handle(
            headers: $request->headers->all(),
            rawBody: $request->getContent(),
        );

        match ($webhook->headers->event) {
            WebhookEvent::PAYMENT_TRANSACTION_STATUS_CHANGED =>
                $this->handleTransactionStatusChanged($webhook->payload),
            default => null,
        };

        return response()->statusText('OK');
    }
}
```

### Symfony

[](#symfony)

Register the bundle in `config/bundles.php`:

```
Paymentic\Sdk\Integration\Symfony\PaymenticBundle::class => ['all' => true],
```

License
-------

[](#license)

MIT License. See [LICENSE](LICENSE) for details.

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance86

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 84.6% 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 ~21 days

Total

5

Last Release

75d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2c1e5adbee60ced153025cb73fe1bd55c7954244ceb5e25bc73078e003c2557c?d=identicon)[kgrzelak-payti](/maintainers/kgrzelak-payti)

---

Top Contributors

[![kgrzelak-payti](https://avatars.githubusercontent.com/u/208849631?v=4)](https://github.com/kgrzelak-payti "kgrzelak-payti (11 commits)")[![Wojtazzzz](https://avatars.githubusercontent.com/u/77293179?v=4)](https://github.com/Wojtazzzz "Wojtazzzz (2 commits)")

---

Tags

paymenticpaymentic-sdkpaymentic-sdk-phpapisdkpaymentpaymentic

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[openai-php/client

OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API

5.8k22.6M232](/packages/openai-php-client)[saloonphp/saloon

Build beautiful API integrations and SDKs with Saloon

2.4k9.6M468](/packages/saloonphp-saloon)[kreait/firebase-php

Firebase Admin SDK

2.4k39.7M72](/packages/kreait-firebase-php)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

963.1M35](/packages/getbrevo-brevo-php)[mollie/mollie-api-php

Mollie API client library for PHP. Mollie is a European Payment Service provider and offers international payment methods such as Mastercard, VISA, American Express and PayPal, and local payment methods such as iDEAL, Bancontact, SOFORT Banking, SEPA direct debit, Belfius Direct Net, KBC Payment Button and various gift cards such as Podiumcadeaukaart and fashioncheque.

60014.4M62](/packages/mollie-mollie-api-php)[square/square

Use Square APIs to manage and run business including payment, customer, product, inventory, and employee management.

793.4M21](/packages/square-square)

PHPackages © 2026

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