PHPackages                             pythagus/lydia - 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. pythagus/lydia

ActivePackage[Payment Processing](/categories/payments)

pythagus/lydia
==============

Oriented-Object Package to use Lydia payment way in PHP

v1.1.1(4y ago)08611MITPHPPHP ^7.3|^8.0

Since Nov 22Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Pythagus/lydia)[ Packagist](https://packagist.org/packages/pythagus/lydia)[ RSS](/packages/pythagus-lydia/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (4)Used By (1)

Lydia payment
=============

[](#lydia-payment)

[Lydia](https://lydia-app.com/fr) is an online-payment solution. This package presents an implementation of this tool in an Object-Oriented view. This is a stand-alone package.

Version
-------

[](#version)

This package works since PHP 7.3. Please refer to the next table to check whether your PHP version is compatible with this package.

Package versionPHP version1.x7.x, 8.xInstallation
------------

[](#installation)

### With composer

[](#with-composer)

Use the package manager [composer](https://getcomposer.org/) to install this package.

```
composer require pythagus/lydia
```

### Without package manager

[](#without-package-manager)

You can clone the current repository and completely use this package. You need to make (or use) an autoload package (like [composer](https://getcomposer.org/)) to correctly discover the files.

Usage
-----

[](#usage)

This section describes how to correctly and fully use this package.

### The Lydia facade

[](#the-lydia-facade)

The `Pythagus\Lydia\Lydia` class allows you to custom the Lydia main interactions with your application. **You need to extend this class**. The package won't work otherwise. You can refer to the [example/MyLydiaFacade](example/MyLydiaFacade)class to have an example how to override this class.

When you override the `Lydia` class, you need to àdd the next line to be taking into account:

```
Lydia::setInstance(new MyLydiaFacade()) ;
```

If you are using a framework, you can add this line when your application is starting. If you are not, you need to add this line before every request you make.

**Note :** if you are using a framework, you will probably have a redirect response manager. So you can override the `Lydia.redirect()`method to use your framework instead.

### Configuration

[](#configuration)

You have an example of a configuration file in the [example folder](example). The `MyLydiaFacade` class show you what you should override to adapt this package to your application. I suggest you copying the `lydia.php` config file and only add your personal keys.

#### Properties

[](#properties)

The `properties` key in the `example/lydia.php` config file allows you to declare some properties that won't change from a request to another (like the currency).

### Lydia requests

[](#lydia-requests)

For now, the package implements 3 Lydia's requests:

#### PaymentRequest

[](#paymentrequest)

Make a payment request to the Lydia's server. You need to use the `setFinishCallback()` method to define the return route using by Lydia to redirect the user. You also need to define **amount** and **recipient** parameters like:

```
$request = new PaymentRequest() ;
$request->setFinishCallback('my/route') ;
$data = $request->execute([
	'amount'    => 5,
	'recipient' => 'test@test.com'
]) ;

// Save your data.

return $request->redirect() ;
```

The `execute()` method will redirect the user to the Lydia's page. After payment, the user will be redirected to `my/route`.

#### PaymentStateRequest

[](#paymentstaterequest)

Check the state of a payment. You need to set the `request_uuid` that is given in the `Lydia.savePaymentData()` array when the payment is requested. You can execute the request like:

```
$request = new PaymentStateRequest("payment_request_uuid") ;
$state   = $request->execute() ;
```

#### RefundRequest

[](#refundrequest)

Refund partially or globally a transaction. You need to set the `transaction_identifier` that is given in the `PaymentRequest` finish route. You need to add the **amount** parameter. You can execute the request like:

```
$request = new RefundRequest("payment_transaction_identifier") ;
$status  = $request->execute([
	'amount' => 10
]) ;
```

Contributing
------------

[](#contributing)

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License
-------

[](#license)

[MIT](LICENSE)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~245 days

Total

3

Last Release

1513d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/34168890?v=4)[Damien MOLINA](/maintainers/Pythagus)[@Pythagus](https://github.com/Pythagus)

---

Top Contributors

[![Pythagus](https://avatars.githubusercontent.com/u/34168890?v=4)](https://github.com/Pythagus "Pythagus (1 commits)")[![stel-zv](https://avatars.githubusercontent.com/u/123560618?v=4)](https://github.com/stel-zv "stel-zv (1 commits)")

### Embed Badge

![Health badge](/badges/pythagus-lydia/health.svg)

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

###  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)
