PHPackages                             kwaadpepper/payment-form-api - 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. kwaadpepper/payment-form-api

ActiveLibrary[API Development](/categories/api)

kwaadpepper/payment-form-api
============================

Common API to make Lyra payment platform integration easier in PHP based websites.

3.0.3(3y ago)0151GPL-3.0+PHPPHP &gt;=5.3.0

Since Mar 30Pushed 3y agoCompare

[ Source](https://github.com/Kwaadpepper/payment-form-api)[ Packagist](https://packagist.org/packages/kwaadpepper/payment-form-api)[ RSS](/packages/kwaadpepper-payment-form-api/feed)WikiDiscussions develop Synced 1mo ago

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

Lyra payment form API
=====================

[](#lyra-payment-form-api)

Lyra payment form API is an open source PHP SDK that allows integration of secured payment gateway developped by [Lyra Network](https://www.lyra-network.com/) inside e-commerce websites.

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

[](#requirements)

PHP 5.3.0 and later.

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

[](#installation)

### Composer

[](#composer)

You can install the API via [Composer](http://getcomposer.org/). Run the following command:

```
composer require kwaadpepper/payment-form-api
```

To use the API, use Composer's [autoload](https://getcomposer.org/doc/00-intro.md#autoloading):

```
require_once('vendor/autoload.php');
```

### Manual Installation

[](#manual-installation)

If you do not wish to use Composer, you can download the [latest release](https://github.com/lyra/payment-form-api/releases). Then, to use the API, include the `init.php` file.

```
require_once('/path/to/payment-form-api/init.php');
```

Usage
-----

[](#usage)

To create payment form do :

```
$ctxMode = 'TEST';
$keyTest = '1111111111111111';
$keyProd = '2222222222222222';
$algo = 'SHA-1';

$request = new \Lyranetwork\Request();
$request->set('ctx_mode', $ctxMode);
$request->set('key_test', $keyTest);
$request->set('key_prod', $keyProd);
$request->set('sign_algo', $algo);

$request->set('site_id', '12345678');
$request->set('amount', '100'); // amount in cents
$request->set('currency', '978');
$request->set('capture_delay', '');
$request->set('validation_mode', '');

echo $request->getRequestHtmlForm(); // display generated payment form
```

To process payment result, do :

```
$keyTest = '1111111111111111';
$keyProd = '2222222222222222';
$algo = 'SHA-1';

$response = new \LyraNetwork\Response($_REQUEST, $keyTest, $keyProd, $algo);

if (! $response->isAuthentified()) {
    // Unauthenticated response received
    die('An error occurred while computing the signature.');
}

$order = get_my_order($response->get('order_id'));

if ($response->isAcceptedPayment()) {
    // update order status, reduce products stock, send customer notifications, ...
    update_my_order($order, 'success');

    // redirect to success page
} elseif ($response->isCancelledPayment()) {
    // redirect to cart page to allow re-order
} else {
     // failed payment logic here
     update_my_order($order, 'failed');

    // redirect to failure or cart page
}
```

License
-------

[](#license)

Each Lyra payment form API source file included in this distribution is licensed under GNU GENERAL PUBLIC LICENSE (GPL 3.0).

Please see LICENSE file for the full text of the GPL 3.0 license. It is also available through the world-wide-web at this URL: .

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.2% 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 ~2 days

Total

3

Last Release

1138d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7d6fe69e010efceae2bd9a92eb6463139fff339c94c545b6b7b1210a00d963e4?d=identicon)[Kwaadpepper](/maintainers/Kwaadpepper)

---

Top Contributors

[![nabil-semaoune-lyra](https://avatars.githubusercontent.com/u/244469839?v=4)](https://github.com/nabil-semaoune-lyra "nabil-semaoune-lyra (31 commits)")[![Kwaadpepper](https://avatars.githubusercontent.com/u/6019313?v=4)](https://github.com/Kwaadpepper "Kwaadpepper (3 commits)")

---

Tags

phpapisdkpaymente-commercelyra

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kwaadpepper-payment-form-api/health.svg)

```
[![Health](https://phpackages.com/badges/kwaadpepper-payment-form-api/health.svg)](https://phpackages.com/packages/kwaadpepper-payment-form-api)
```

###  Alternatives

[checkout/checkout-sdk-php

Checkout.com SDK for PHP

553.3M7](/packages/checkout-checkout-sdk-php)[postfinancecheckout/sdk

PostFinance Checkout SDK for PHP

22219.1k14](/packages/postfinancecheckout-sdk)[wallee/sdk

wallee SDK for PHP

12354.2k11](/packages/wallee-sdk)

PHPackages © 2026

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