PHPackages                             x-laravel/payline-qnb-driver - 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. x-laravel/payline-qnb-driver

ActiveLibrary[Payment Processing](/categories/payments)

x-laravel/payline-qnb-driver
============================

QNB Finansbank VPOS driver for x-laravel/payline

v1.0.0(today)01↑2900%MITPHPPHP ^8.3CI passing

Since Jun 19Pushed todayCompare

[ Source](https://github.com/x-laravel/payline-qnb-driver)[ Packagist](https://packagist.org/packages/x-laravel/payline-qnb-driver)[ RSS](/packages/x-laravel-payline-qnb-driver/feed)WikiDiscussions master Synced today

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

payline-qnb-driver
==================

[](#payline-qnb-driver)

[![Tests](https://github.com/x-laravel/payline-qnb-driver/actions/workflows/tests.yml/badge.svg)](https://github.com/x-laravel/payline-qnb-driver/actions/workflows/tests.yml)[![PHP](https://camo.githubusercontent.com/c8d8dad6beb757a2b8acba331d16140813699543b88a37af0a81f20bd35f61de/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e332532422d626c7565)](https://www.php.net)[![Laravel](https://camo.githubusercontent.com/42e62a9adb05b6cb16993782fd4b04b64a76be3ff5704d170001885eb70c8448/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d313225323025374325323031332d726564)](https://laravel.com)[![License](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)](LICENSE.md)

QNB Finansbank VPOS driver for [x-laravel/payline](https://github.com/x-laravel/payline).

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

[](#requirements)

- PHP ^8.3
- Laravel ^12.0 | ^13.0
- x-laravel/payline ^1.0

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

[](#installation)

```
composer require x-laravel/payline-qnb-driver
```

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

[](#configuration)

Add the `qnb` block to `config/payline.php` under `gateways`:

```
'gateways' => [
    'qnb' => [
        'mbr_id'        => env('QNB_MBR_ID', '5'),
        'merchant_id'   => env('QNB_MERCHANT_ID'),
        'user_name'     => env('QNB_USER_NAME'),
        'password'      => env('QNB_PASSWORD'),
        'merchant_pass' => env('QNB_MERCHANT_PASS'),
        'endpoint'      => env('QNB_ENDPOINT', 'https://vpostest.qnbfinansbank.com/Gateway/Default.aspx'),
        'lang'          => env('QNB_LANG', 'TR'),
    ],
],
```

Set the corresponding environment variables in `.env`:

```
PAYLINE_DRIVER=qnb

QNB_MBR_ID=5
QNB_MERCHANT_ID=your-merchant-id
QNB_USER_NAME=your-user-name
QNB_PASSWORD=your-password
QNB_MERCHANT_PASS=your-merchant-pass
QNB_ENDPOINT=https://vpos.qnbfinansbank.com/Gateway/Default.aspx
```

> **Sandbox endpoint:** `https://vpostest.qnbfinansbank.com/Gateway/Default.aspx`
> **Production endpoint:** `https://vpos.qnbfinansbank.com/Gateway/Default.aspx`

Usage
-----

[](#usage)

### Charging a payment

[](#charging-a-payment)

```
use XLaravel\Payline\DTOs\Card;
use XLaravel\Payline\DTOs\PaymentRequest;

$data = PaymentRequest::fromPayable(
    payable: $order,
    card: new Card(
        holderName: 'John Doe',
        number: '4111111111111111',
        expiryMonth: '12',
        expiryYear: '2030',
        cvv: '123',
    ),
    installments: 1,
    customerIp: $request->ip(),
);

$response = $order->pay('qnb')->charge($data);
```

QNB uses a **3DS HTML form** flow. On success, `pay()` returns a `PaymentResponse` with `status = Pending` and a `redirectForm` containing a self-submitting HTML form that forwards the customer to their bank's 3DS page:

```
if ($response->requiresRedirect()) {
    return response($response->redirectForm); // renders and auto-submits the form
}
```

### Handling the callback

[](#handling-the-callback)

Payline handles the callback automatically via its built-in route (`/payline/callbacks/qnb`). After 3DS completes, QNB POSTs back to this URL. The driver verifies the response hash and the user is redirected to `payline.callback_success_url` or `payline.callback_failure_url`.

You can listen to the dispatched events for any post-payment logic:

```
use XLaravel\Payline\Events\PaymentSucceeded;
use XLaravel\Payline\Events\PaymentFailed;

class HandlePaymentSucceeded
{
    public function handle(PaymentSucceeded $event): void
    {
        $event->payment;     // Payment model
        $event->transaction; // Transaction model
        $event->response;    // PaymentResponse DTO
    }
}
```

### Pre-authorization &amp; Capture

[](#pre-authorization--capture)

```
use XLaravel\Payline\DTOs\CaptureData;
use XLaravel\Payline\Facades\Payline;

// 1. Pre-authorize (TxnType=PreAuth, 3DS flow)
$response = $order->pay('qnb')->authorize($data);

// 2. Capture later
Payline::via('qnb')->capture(
    new CaptureData(
        gatewayTransactionId: $transaction->gateway_transaction_id,
        amount: $transaction->amount,
        currency: $transaction->currency,
    ),
    $payment,
    $transaction,
);
```

### Refund

[](#refund)

```
use XLaravel\Payline\DTOs\RefundData;

Payline::via('qnb')->refund(
    new RefundData(
        gatewayTransactionId: $transaction->gateway_transaction_id,
        amount: 5000, // kuruş
        currency: 'TRY',
    ),
    $payment,
    $transaction,
);
```

### Void (Cancel)

[](#void-cancel)

```
use XLaravel\Payline\DTOs\VoidData;

Payline::via('qnb')->void(
    new VoidData(gatewayTransactionId: $transaction->gateway_transaction_id),
    $payment,
    $transaction,
);
```

Supported Currencies
--------------------

[](#supported-currencies)

ISO CodeQNB CodeTRY949USD840EUR978GBP826Supported Operations
--------------------

[](#supported-operations)

OperationSupportedNotesPay (3DS)✓Returns self-submitting HTML form (`redirectForm`)Authorize✓PreAuth + 3DS flowCapture✓PostAuth via `OrgOrderId`Refund✓Partial or fullVoid/Cancel✓Webhooks✗QNB uses callback-only flowTesting
-------

[](#testing)

```
# Build first (once per PHP version)
DOCKER_BUILDKIT=0 docker compose --profile php83 build

# Run tests
docker compose --profile php83 up
docker compose --profile php84 up
docker compose --profile php85 up
```

Or directly:

```
composer test
```

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](https://opensource.org/license/MIT).

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance100

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

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

0d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2bdb64c6c087c331b8bd5906bb1aa7eb06bc83af3654a48ba8ab9da365976651?d=identicon)[X-Adam](/maintainers/X-Adam)

---

Top Contributors

[![x-adam](https://avatars.githubusercontent.com/u/60411758?v=4)](https://github.com/x-adam "x-adam (2 commits)")

---

Tags

laravelpaymentvposfinansbankqnb

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/x-laravel-payline-qnb-driver/health.svg)

```
[![Health](https://phpackages.com/badges/x-laravel-payline-qnb-driver/health.svg)](https://phpackages.com/packages/x-laravel-payline-qnb-driver)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)

PHPackages © 2026

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