PHPackages                             digitalvirgo/directpay - 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. digitalvirgo/directpay

ActiveLibrary[Payment Processing](/categories/payments)

digitalvirgo/directpay
======================

Official library for DirectPay

1.0.1(6y ago)33.4k4[1 issues](https://github.com/justpay-payments/php-directpay/issues)[1 PRs](https://github.com/justpay-payments/php-directpay/pulls)MITPHPPHP &gt;=5.6CI failing

Since Jan 16Pushed 6y ago4 watchersCompare

[ Source](https://github.com/justpay-payments/php-directpay)[ Packagist](https://packagist.org/packages/digitalvirgo/directpay)[ RSS](/packages/digitalvirgo-directpay/feed)WikiDiscussions master Synced 3d ago

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

Official DirectPay PHP Library
==============================

[](#official-directpay-php-library)

This library provides integration access to DirectPay Api.

Instalation
-----------

[](#instalation)

### Composer

[](#composer)

Using cli

```
composer require digitalvirgo/directpay

```

or manualy add to "require" in composer.json

```
    "require": {
        "digitalvirgo/directpay":"^1.0.0"
    }
```

Getting started
---------------

[](#getting-started)

If you are using Composer use autoload functionality:

```
include "vendor/autoload.php";
```

Usage
-----

[](#usage)

### 1. Configuration

[](#1-configuration)

Basic setup for DirectPay version 2:

```
use DigitalVirgo\DirectPay\Service\Client;

$client = new Client();
```

First parameter is DirectPay url. Default is for version 2. These urls are in constants: `Client::DP_V1_BASE_URL` and `Client::DP_V2_BASE_URL`You can pass options for Guzzle client as second parameter.

```
use DigitalVirgo\DirectPay\Service\Client;
$options = [
    'timeout' => 10,
]
$client = new Client(Client::DP_V2_BASE_URL, $options);
```

Set your credentials in client:

```
$client->setAuth($login, $password);
```

Alternatively you can pass credentials directly on every request:

```
$request = new \DigitalVirgo\DirectPay\Model\Request\PaymentPointInfoRequest([
    'product' => $product,
    'login' => $login,
    'password' => $password,
])
```

### 2. Getting Payment Points

[](#2-getting-payment-points)

Before you will able to generate new order You have to get know your PaymentPoints

```
$paymentPointResponse = $client->paymentPointInfo([
    'product' => [
        'name' => 'product name',
        'price' => [ // net price and currency is mandatory
            'net' => '1,00',
            'gross' => '1,23',
            'tax' => '0,23',
            'taxRate' => '23',
            'currency' => 'PLN',
        ]
    ]
]);

if ($paymentPointResponse->getError()) {
    throw new \Exception("Unable to get paymentPoints: {$paymentPointResponse->getError()} {$paymentPointResponse->getErrorDescription()}");
}
```

### 3. Choose your PaymentPoint

[](#3-choose-your-paymentpoint)

```
    $singlePaymentPoint = $paymentPointResponse->getProduct()->getPaymentPoints()->getPaymentPoint()[0]; // we use first given
```

### 4. Generate new order

[](#4-generate-new-order)

```
$orderNewResponse = $client->orderNewRequest([
    'order' => [
        'paymentPointId' => $singlePaymentPoint->getPaymentPointId(),
        'orderDescription' => 'order_description',
        'product' => [
            'name' => 'product name',
            'price' => $singlePaymentPoint->getPrice(),
        ],
        'notifyUrl' => 'https://partnerhost.com/notify',  //setup your url's
        'orderFailureUrl' => 'https://partnerhost.com/failure',
        'orderCompleteUrl' => 'https://partnerhost.com/complete',
    ],
]);
```

### 5. Check order status

[](#5-check-order-status)

```
$orderGetResponse = $client->orderGetRequest([
    'orderId' => $orderNewResponse->getOrderId()
]);

if ($orderGetResponse->getError()) {
    throw new \Exception("Unable to get order: {$orderGetResponse->getError()} {$orderGetResponse->getErrorDescription()}");
}

var_dump($orderGetResponse->getOrder()->getOrderId());
var_dump($orderGetResponse->getOrder()->getOrderStatus());
```

### 6. Receiving notifications

[](#6-receiving-notifications)

When you set up `notifyUrl` in `orderNewReqest` you will be notified By DirectPay. You culd parse received xml to `OrderNotifyRequest`:

```
$body = file_get_contents('php://input');
//if you can't receive this notification throw some error.
// if everything is ok return status 200;
$orderNotifyRequest = OrderNotifyRequest::fromXml($body);
$response = new OrderNotifyResponse([
    'order' => $orderNotifyRequest->getOrder(),
    'updateDate' => new DateTimeImmutable(),
]);
print ($response->toXml());
```

All steps are in [example/index.php](example/index.php) and [example/notify.php](example/notify.php);

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 94.4% 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 ~198 days

Recently: every ~128 days

Total

7

Last Release

2262d ago

Major Versions

0.1.5 → 1.0.12020-04-22

PHP version history (2 changes)0.1.0PHP &gt;=5.5

1.0.1PHP &gt;=5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/9901490cd58dd693201e1524f04f09de16caa9595b19b25413000a184fc12a83?d=identicon)[adam.jurek](/maintainers/adam.jurek)

---

Top Contributors

[![adamjurek](https://avatars.githubusercontent.com/u/25053600?v=4)](https://github.com/adamjurek "adamjurek (17 commits)")[![nouc23](https://avatars.githubusercontent.com/u/4539371?v=4)](https://github.com/nouc23 "nouc23 (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/digitalvirgo-directpay/health.svg)

```
[![Health](https://phpackages.com/badges/digitalvirgo-directpay/health.svg)](https://phpackages.com/packages/digitalvirgo-directpay)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.5k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[chargebee/chargebee-php

ChargeBee API client implementation for PHP

758.5M9](/packages/chargebee-chargebee-php)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k13](/packages/tempest-framework)[imdhemy/google-play-billing

Google Play Billing

491.5M5](/packages/imdhemy-google-play-billing)

PHPackages © 2026

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