PHPackages                             paynl/omnipay-paynl-v3 - 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. paynl/omnipay-paynl-v3

ActiveLibrary[Payment Processing](/categories/payments)

paynl/omnipay-paynl-v3
======================

Pay.nl driver for the Omnipay PHP payment processing library based on the V3 PayNL orders API

172[2 PRs](https://github.com/paynl/omnipay/pulls)PHP

Since Nov 5Pushed 1y ago3 watchersCompare

[ Source](https://github.com/paynl/omnipay)[ Packagist](https://packagist.org/packages/paynl/omnipay-paynl-v3)[ RSS](/packages/paynl-omnipay-paynl-v3/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

 [![](https://camo.githubusercontent.com/5c75d96c38b24c983eec9a63ba2a31737c29a55fb45c1f75df91a1a5f8a5803f/68747470733a2f2f7777772e7061792e6e6c2f75706c6f6164732f312f6272616e64732f6d61696e5f6c6f676f2e706e67)](https://camo.githubusercontent.com/5c75d96c38b24c983eec9a63ba2a31737c29a55fb45c1f75df91a1a5f8a5803f/68747470733a2f2f7777772e7061792e6e6c2f75706c6f6164732f312f6272616e64732f6d61696e5f6c6f676f2e706e67)

Pay. Omnipay driver
===================

[](#pay-omnipay-driver)

Description
===========

[](#description)

Pay. driver for the Omnipay payment processing library

- [Description](#description)
- [Available payment methods](#available-payment-methods)
- [Requirements](#requirements)
- [Installation](#installation)
- [Update instructions](#update-instructions)
- [Usage](#usage)
- [Tests](#test)
- [Support](#support)

Available payment methods
=========================

[](#available-payment-methods)

Bank PaymentsCreditcardsGift cards &amp; VouchersPay by invoiceOthersiDEAL + QRVisaVVV CadeaukaartAfterPayPayPalBancontact + QRMastercardWebshop GiftcardAchteraf betalen via BillinkWeChatPayGiropayAmerican ExpressFashionChequeFocum AchterafBetalen.nlAmazonPayMyBankCarte BancairePodium CadeaukaartCapayable Achteraf BetalenCashlySOFORTPostePayGezondheidsbonin3 keer betalen, 0% rentePay Fixed Price (phone)MaestroDankortFashion GiftcardKlarnaInstore Payments (POS)Bank TransferCartasiGivaCardSprayPayPrzelewy24TikkieDe CadeaukaartYourGiftCreditclickApple PayMultibancoPaysafecardPayconiqHuis en Tuin CadeauRequirements
============

[](#requirements)

Before running the tests, make sure you have:

- PHP installed (7.4 or higher recommended)
- Composer installed
- A Pay.nl account with API credentials

Installation
============

[](#installation)

#### Installing

[](#installing)

In command line, navigate to the installation directory of Omnipay

Enter the following command:

```
composer require league/omnipay:^3 paynl/omnipay-paynl-v3

```

The plugin is now installed

##### Setup

[](#setup)

1. Create a new php file
2. Use the following code:

```
# require autoloader
require_once('vendor/autoload.php');

use Omnipay\Omnipay;

# Setup payment gateway
$gateway = Omnipay::create('PaynlV3');

$gateway->setApiSecret('****************************************');
$gateway->setTokenCode('AT-####-####');
$gateway->setServiceId('SL-####-####');
```

3. Enter the TokenCode, API token, ServiceId (these can be found in the Pay. My Pay Panel --&gt;

Go to the *Settings* / *Sales locations* tab in the Pay. Scroll down to the sales location and there copy the SL code and the secret.

#### Update instructions

[](#update-instructions)

In command line, navigate to the installation directory of Omnipay

Enter the following command:

```
composer update league/omnipay:^3 paynl/omnipay-paynl-v3

```

The plugin has now been updated

Usage
=====

[](#usage)

### Get payment methods

[](#get-payment-methods)

```
$response = $gateway->fetchPaymentMethods()->send();

$response->getPaymentMethods();

$paymentMethods = array();
foreach ($response->getPaymentMethods() as $paymentMethod) {
    $paymentMethods[] = [
        'id' => $paymentMethod->getId(),
        'name' => $paymentMethod->getName(),
    ];
}
```

### Get Issuers (Ideal)

[](#get-issuers-ideal)

```
$response = $gateway->fetchIssuers()->send();

$response->getIssuers();

$issuers = array();
foreach ($response->getIssuers() as $issuer) {
    $issuers[] = [
        'name' => $issuer->getName(),
        'id' => $issuer->getId(),
        'paymentMethod' => $issuer->getPaymentMethod(),
    ];
}
```

### Pay. items

[](#pay-items)

```
# Use Pay. Item class
use Omnipay\Paynl\Common\Item;

# Add items to transaction
$arrItems = array();
$item = new Item();
$item->setProductId('SKU01')
        ->setProductType('ARTICLE')
        ->setVatPercentage(21)
        ->setDescription('Description')
        ->setPrice('10')
        ->setQuantity(4);
$arrItems[] = $item;

$item = new Item();
$item->setProductId('SHIP01')
        ->setProductType('SHIPPING')
        ->setVatPercentage(21)
        ->setDescription('Description')
        ->setPrice('5')
        ->setQuantity(1);
$arrItems[] = $item;

$item = new Item();
$item->setProductId('SKU02')
        ->setProductType('DISCOUNT')
        ->setVatPercentage(21)
        ->setDescription('Description')
        ->setPrice('1')
        ->setQuantity(1);
$arrItems[] = $item;
```

### Start a transaction (Order:Create)

[](#start-a-transaction-ordercreate)

```
# Send purchase request
$response = $gateway->purchase(
    [
        'amount' => '46.00',
        'currency' => 'EUR',
        'transactionReference' => 'referenceID1',
        'clientIp' => '192.168.192.12',
        'returnUrl' => 'http://www.yourdomain.com/return_from_pay',
        'items' => $arrItems,
        'card' => array(
            'firstName' => 'Example',
            'lastName' => 'User',
            'gender' => 'M',
            'birthday' => '01-02-1992',
            'phone' => '1111111111111111',
            'email' => 'john@example.com',
            'country' => 'NL',

            'shippingAddress1' => 'Shippingstreet 1B',
            'shippingAddress2' => '',
            'shippingCity' => 'Shipingtown',
            'shippingPostcode' => '1234AB',
            'shippingState' => '',
            'shippingCountry' => 'NL',

            'billingFirstName' => 'Billingexample',
            'billingLastName' => 'Billinguser',
            'billingAddress1' => 'Billingstreet 1B',
            'billingAddress2' => '',
            'billingCity' => 'Billingtown',
            'billingPostcode' => '1234AB',
            'billingState' => '',
            'billingCountry' => 'NL'
        )
    ]
)->send();

# Process response
if ($response->isSuccessful()) {
    # Get the url for fetching the Transaction
    $statusUrl = $response->getStatusUrl();
    $voidUrl = $response->getVoidUrl();
    $redirectUrl = $response->getRedirectUrl();
    $givenCaptureUrl = $response->getCaptureUrl();
    $givenCaptureAmountUrl = $response->getCaptureAmountUrl();
    $givenCaptureProductsUrl = $response->getCaptureProductsUrl();
    $abortUrl = $response->getAbortUrl();
    $approveUrl = $response->getApproveUrl();
    $declineUrl = $response->getDeclineUrl();
    $debugUrl = $response->getDebugUrl();
    $checkoutUrl = $response->getCheckoutUrl();
}

    # Payment was successful
    var_dump($response);

} elseif ($response->isRedirect()) {
    # Get the url for fetching the Transaction
    $redirectUrl = $response->getRedirectUrl();
} else {
    # Payment failed
    echo $response->getMessage();
}
```

### Get a transaction (Order:status)

[](#get-a-transaction-orderstatus)

```
$response = $gateway->fetchTransaction(['stateUrl' => $statusUrl])->send();

if ($response->isSuccessful()) {
    # Get was successful
    print_r($response);

} else {
    # Get failed
    echo $response->getMessage();
}
```

### Approve order (Order:approve)

[](#approve-order-orderapprove)

```
$response = $gateway->approve(['approveUrl' => $approveUrl])->send();

if ($response->isSuccessful()) {
    # Get was successful
    print_r($response);

} else {
    # Get failed
    echo $response->getMessage();
}
```

### Approve order (Order:Decline)

[](#approve-order-orderdecline)

```
$response = $gateway->decline(['declineUrl' => $declineUrl])->send();

if ($response->isSuccessful()) {
    # Get was successful
    print_r($response);

} else {
    # Get failed
    echo $response->getMessage();
}
```

### Capture order (Order:Capture)

[](#capture-order-ordercapture)

```
$response = $gateway->capture(['captureUrl' => $captureUrl])->send();

if ($response->isSuccessful()) {
    # Get was successful
    print_r($response);

} else {
    # Get failed
    echo $response->getMessage();
}
```

### Capture amount order (Order:CaptureAmount)

[](#capture-amount-order-ordercaptureamount)

```
$response = $gateway->captureAmount([
    'captureAmountUrl' => $captureAmountUrl,
    'amount' => '14.00'
])->send();

if ($response->isSuccessful()) {
    # Get was successful
    print_r($response);

} else {
    # Get failed
    echo $response->getMessage();
}
```

### Capture products order (Order:CaptureProducts)

[](#capture-products-order-ordercaptureproducts)

```
$arrItems = array();
$item = new Item();
$item->setProductId('SKU01')
        ->setProductType('ARTICLE')
        ->setVatPercentage(21)
        ->setDescription('Description')
        ->setPrice('10')
        ->setQuantity(4);

$arrItems[] = $item;

$response = $gateway->captureProducts([
    'captureAmountUrl' => $captureProductsUrl,
    'items' => $arrItems
])->send();

if ($response->isSuccessful()) {
    # Get was successful
    print_r($response);

} else {
    # Get failed
    echo $response->getMessage();
}
```

### Capture products order (Order:Abort)

[](#capture-products-order-orderabort)

```
$response = $gateway->abort([
    'abortUrl' => $abortUrl
])->send();

if ($response->isSuccessful()) {
    # Get was successful
    print_r($response);

} else {
    # Get failed
    echo $response->getMessage();
}
```

### Void a transaction

[](#void-a-transaction)

```
$response = $gateway->void(['voidUrl' => $voidUrl])->send();

if ($response->isSuccessful()) {
    # Get was successful
    print_r($response);

} else {
    # Get failed
    echo $response->getMessage();
}
```

Test
====

[](#test)

Before running the tests, make sure you have:

- PHP installed (7.4 or higher recommended)
- Composer installed
- A Pay.nl account with API credentials

Setup
-----

[](#setup-1)

1. Install dependencies:

```
composer install
```

2. Create a copy of the phpunit configuration file:

```
cp phpunit.xml.dist phpunit.xml
```

3. Configure environment variables in your `phpunit.xml`:

Replace the empty values with your Pay.nl credentials:

> **Note**: Never commit your actual API credentials to version control. The `phpunit.xml` file should be in your `.gitignore`.

Running Tests
-------------

[](#running-tests)

To run all the tests:

```
./vendor/bin/phpunit --testsuite "Omni pay v3 tests"
```

Environment Variables
---------------------

[](#environment-variables)

VariableDescription`PAYNL_SERVICE_CODE`Your Pay.nl service location code (SL-xxxx-xxxx)`PAYNL_API_SECRET`Your Pay.nl API tokenSupport
=======

[](#support)

Contact us:

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity18

Early-stage or recently created project

 Bus Factor1

Top contributor holds 50% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3de4fdf653f1c9f2fd2fd25bb1ee8c5cfc05051f17a41759099e44fc47f6a089?d=identicon)[paynl](/maintainers/paynl)

---

Top Contributors

[![NickHes](https://avatars.githubusercontent.com/u/41060466?v=4)](https://github.com/NickHes "NickHes (2 commits)")[![Bas-Scenius](https://avatars.githubusercontent.com/u/187017557?v=4)](https://github.com/Bas-Scenius "Bas-Scenius (1 commits)")[![woutse](https://avatars.githubusercontent.com/u/6763638?v=4)](https://github.com/woutse "woutse (1 commits)")

### Embed Badge

![Health badge](/badges/paynl-omnipay-paynl-v3/health.svg)

```
[![Health](https://phpackages.com/badges/paynl-omnipay-paynl-v3/health.svg)](https://phpackages.com/packages/paynl-omnipay-paynl-v3)
```

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

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