PHPackages                             labyrinthe/payment - 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. labyrinthe/payment

ActiveLibrary[API Development](/categories/api)

labyrinthe/payment
==================

A package facilitating the integration of payment modules from several payment aggregators

1.0.0(2y ago)232MITPHP

Since Mar 31Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Dr-Lab1/Labyrinthe-Payment)[ Packagist](https://packagist.org/packages/labyrinthe/payment)[ RSS](/packages/labyrinthe-payment/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (2)Used By (0)

Labyrinthe - Payment : Documentation
====================================

[](#labyrinthe---payment--documentation)

Plan
----

[](#plan)

- [ Package description ](#package-description)
- [ Install the Labyrinthe/Payment package ](#install-the-labyrinthepayment-package)

    - [ Using Composer ](#using-composer)
    - [ Using GitHub ](#using-github)
- [ How to use Labyrinthe\\Payment ](#how-to-use-labyrinthepayment)

    - [ Global ](#global)
    - [ Labyrinthe API ](#labyrinthe-api)
        - [ Labyrinthe mobile service ](#labyrinthe-mobile-service)
            - [ Labyrinthe sandbox ](#labyrinthe-sandbox)
        - [ Labyrinthe check transaction ](#labyrinthe-check-transaction)
    - [ Flexpay ](#flexpay)
        - [ Flexpay mobile service ](#flexpay-mobile-service)
            - [ Flexpay mobile payment ](#flexpay-mobile-payment)
            - [ Flexpay mobile payment ](#flexpay-mobile-payment)
            - [ Flexpay check mobile results ](#flexpay-check-mobile-results)
        - [ Flexpay card service ](#flexpay-card-service)
            - [ Flexpay check card results ](#flexpay-check-card-results)
        - [ Flexpay check transaction ](#flexpay-check-transaction)

Package description
===================

[](#package-description)

In programming, a package (or module, depending on the language) is a collection of various code elements, such as classes, functions, variables and constants. It's a crucial organizational tool that enables code to be structured in a modular and coherent way, making it easier to read, maintain and reuse.

The main aim of our package is to make available classes and functions that facilitate the integration of various payment aggregators such as Labyrinthe, Flexpay, Stripe,... Instead of coding the logic from scratch, you'll save time by using this package. In some cases, a single line of code will suffice to execute complex functions.

Install the Labyrinthe/Payment package
======================================

[](#install-the-labyrinthepayment-package)

Our package can be installed in a number of ways, including composer and github.

Using Composer
--------------

[](#using-composer)

If you haven't composed yet, it's time to install it. After all, it's the main installer of PHP dependencies. [ Click here to install composer](https://getcomposer.org/download/).

After installation, go to the root of your project and issue this command :

```
composer require labyrinthe/payment

```

Using GitHub
------------

[](#using-github)

With installation via github, there are two ways out. Either by git clone or by downloading the package zip file.

1. Git clone

    ```
     git clone https://github.com/Dr-Lab1/Labyrinthe-Payment

    ```
2. Get the link and download

    ```
     https://github.com/Dr-Lab1/Labyrinthe-Payment

    ```

How to use Labyrinthe\\Payment ?
================================

[](#how-to-use-labyrinthepayment-)

Global
------

[](#global)

Using only static methods to simplify its use, the package is easy to understand and practical to use. For example, to make a mobile payment from an X aggregator, the code to call the methods for this operation will be fairly straightforward.

Example:

```
  // array of params
  $array = [];
  $mobile_payment = AggregatorServiceProvider::mobile($array);

```

Responses from package methods and classes all have the same format. In other words, you don't have to go into the details of the response to understand its nature.

   Response     Params Descritption Example   success This is the status of the request. Returns 'true' if everything works and 'false' if it fails. true or false   message This is the message that accompanies the response to give it greater meaning "Process failed"   data This is an array containing the set of data returned by the query  \[code\] =&gt; 0
 \[message\] =&gt; Transaction envoyée avec succès.
 \[orderNumber\] =&gt; sjXMRrf98ISP243896699032
    errors A table listing all the errors encountered in the request \[errors\] =&gt; Could not resolve host: beta-backend  The default response format is JSON. Why is this? Because it's easy to access. To access the JSON key 'success', for example, all you need to do is :

```
$mobile_payment->success
// we can print it
echo $mobile_payment->success;

```

Some people are more comfortable with arrays than JSON in PHP, so they'll pass an array `$options` as a parameter to render the results as an array.

```
$options = [
  "JSON" => false
];

```

Now you can pass your parameters to the desired method to retrieve your data in the format in which you feel most comfortable.

```
$mobile_payment = AggregatorServiceProvider::mobile($array, $options);

```

Labyrinthe API
--------------

[](#labyrinthe-api)

Labyrinthe-API is a service like many others covered by Labyrinthe-RDC (a digital-based company).

The APIs collection offered by Labyrinthe is scalable and comprehensive. It supports a wide range of payment methods available only from us. From mobile payment methods to banking and soon cryptocurrencies, integrate payment solutions with ease.

### Labyrinthe mobile service

[](#labyrinthe-mobile-service)

In the mobile section, we'll be looking at all the services related to mobile payment. In other words, making a payment and checking the results of different payments. We also offer a sandbox for different payment tests before going premium. Easy to integrate.

#### Labyrinthe sandbox

[](#labyrinthe-sandbox)

As mentioned in the introduction, this section deals with transactions. Perhaps the most difficult part of this section will be understanding the various parameters to be passed in the method (function). But relax, it's all explained in this section, and we'll start with.

   SandBox     Params Descritption Example Required   token This is the token given by Labyrinthe xxxx xxxxx YES   reference This is the transaction reference. In other words, the data that will enable the transaction to be traced on your side.  xxxxxxxxxx YES   phone The telephone number involved in the transaction 0896699032 YES   gateway This is the URL that labyrinthe gave you to carry out these mobile transactions   YES  Here is a code snippet showing how to fill its parameters :

```
$array = [
  "token" => "$2y$12$ngaXsXGwkrxpTAA.ubLXietv/Pdadfbx3OziwIH88inGU4sGi6ivm",
  "reference" => "First_TX",
  "phone" => "0896699032",
  "gateway" => "https://payment.labyrinthe-rdc.com/",
];

```

After filling in the table with the correct information provided by Flexpay, please copy the following code portion:

```
$labyrinthe = LabyrintheServiceProvider::sandbox($array);

```

Now run your code from your controller and process the information as required. All the information is returned in the variable `$labyrinthe`.

### Labyrinthe check transaction

[](#labyrinthe-check-transaction)

Transaction verification is an action aimed at checking the status of a transaction and/or extracting certain details from it. This exercise concerns both mobile and card transactions in the system.

There are a few parameters to enter:

   mobile &amp; card     Params Descritption Example Required   token This is the token given by Labyrinthe xxxxxxxxxxxxxx YES   orderNumber This is the transaction orderNumber In other words, the data that will enable the transaction to be traced on your side.  xxxxxxxxxx YES   gateway This is the URL that flexpay gave you to carry out these transactions  YES  Here is a code snippet showing how to fill its parameters :

```
$array = [
  "token" => "xxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "gateway" => "https://xyz.cd/check/",
  "orderNumber" => "azertyytreza",
];

```

After filling in the table with the correct information provided by Flexpay, please copy the following code portion:

```
$labyrinthe = LabyrintheServiceProvider::checkTransaction($array);

```

Now run your code from your controller and process the information as required. All the information is returned in the variable `$labyrinthe`.

Flexpay
-------

[](#flexpay)

FlexPaie is the electronic payments application that supports all electronic payment methods, with all operators and bank cards. It's the ideal solution for all merchants and customers. You no longer need to have an electronic account for each network - a single application operational with : Visa, Mastercard, Afrimoney, Orange Money, Airtel Money, M-Pesa etc.

### Flexpay mobile service

[](#flexpay-mobile-service)

In the mobile section, we'll be looking at all the services related to mobile payment. In other words, making a payment and checking the results of different payments.

#### Flexpay mobile payment

[](#flexpay-mobile-payment)

As mentioned in the introduction, this section deals with transactions. Perhaps the most difficult part of this section will be understanding the various parameters to be passed in the method (function). But relax, it's all explained in this section, and we'll start with.

   mobile     Params Descritption Example Required   authorization This is the Bearer token sent by Flexpay Bearer xxxxx YES   merchant The merchant code is the one provided by flexpay "Orange" YES   type This is the type of transaction you want to carry out. In our case it's mobile. So the type will be "1". 1 YES   type This is the type of transaction you want to carry out. In our case it's mobile. So the type will be "1". 1 YES   reference This is the transaction reference. In other words, the data that will enable the transaction to be traced on your side.  xxxxxxxxxx YES   phone The telephone number involved in the transaction 243896699032 YES   amount The amount of the transaction  100 YES   currency This is the currency to be used in the transaction USD YES   callbackUrl This is the route by which the response (the final information about the transaction) will be returned. abcdef.com YES   gateway This is the URL that flexpay gave you to carry out these mobile transactions flexpay.cd YES  Here is a code snippet showing how to fill its parameters :

```
$array = [
  "authorization" => "Orange",
  "merchant" => "orange",
  "type" => 1,
  // Continue with other params...
];

```

After filling in the table with the correct information provided by Flexpay, please copy the following code portion:

```
$flexpay = FlexpayServiceProvider::mobile($array);

```

Now run your code from your controller and process the information as required. All the information is returned in the variable `$flexpay`.

#### Flexpay check mobile results

[](#flexpay-check-mobile-results)

In each transaction, you've sent a callbackUrl, which is the url to which the result of the transaction will be sent by the aggregator. But this sending of data needs to be checked to ensure that the right information is being processed (stored in the database, for example).

In your action whose endpoint is your callbackUrl, you will call this static function :

```
$flexpay = FlexpayServiceProvider::phoneResults($array);

```

This function will automatically check the result and return the transaction code status. If all is well, it will return `true` to the `success` variable and `false` otherwise. The processing of information coming from the aggregator will depend on the result of the function. You can either save to the database, or perform calculations,...

### Flexpay card

[](#flexpay-card)

In this section, we focus on banking transactions. It will cover much more about checking and checking results.

#### Flexpay check card results

[](#flexpay-check-card-results)

In each transaction, you've sent a callbackUrl, which is the url to which the result of the transaction will be sent by the aggregator. But this sending of data needs to be checked to ensure that the right information is being processed (stored in the database, for example).

In your action whose endpoint is your callbackUrl, you will call this static function :

```
$flexpay = FlexpayServiceProvider::cardResults($array);

```

This function will automatically check the result and return the transaction code status. If all is well, it will return `true` to the `success` variable and `false` otherwise. The processing of information coming from the aggregator will depend on the result of the function. You can either save to the database, or perform calculations,...

### Flexpay check transaction

[](#flexpay-check-transaction)

Transaction verification is an action aimed at checking the status of a transaction and/or extracting certain details from it. This exercise concerns both mobile and card transactions in the system.

There are a few parameters to enter:

   mobile &amp; card     Params Descritption Example Required   authorization This is the Bearer token sent by Flexpay Bearer xxxxx YES   orderNumber This is the transaction orderNumber In other words, the data that will enable the transaction to be traced on your side.  xxxxxxxxxx YES   gateway This is the URL that flexpay gave you to carry out these transactions flexpay.cd YES  Here is a code snippet showing how to fill its parameters :

```
$array = [
  "authorization" => "Orange",
  "gateway" => "https://xyz.cd/check/",
  "orderNumber" => "azertyytreza",
];

```

After filling in the table with the correct information provided by Flexpay, please copy the following code portion:

```
$flexpay = FlexpayServiceProvider::checkTransaction($array);

```

Now run your code from your controller and process the information as required. All the information is returned in the variable `$flexpay`.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

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

768d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ca20cdc31d97065e7a3c4bf140e21e9c0c20c319e0814bca717286fb01fa5b2f?d=identicon)[Dr-Lab1](/maintainers/Dr-Lab1)

---

Top Contributors

[![Dr-Lab1](https://avatars.githubusercontent.com/u/96502938?v=4)](https://github.com/Dr-Lab1 "Dr-Lab1 (224 commits)")

---

Tags

apiapi-restcomposerpackagepackage-managerpackagistpaymentpayment-gatewaypayment-integration

### Embed Badge

![Health badge](/badges/labyrinthe-payment/health.svg)

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M474](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M186](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M33](/packages/facebook-php-business-sdk)[microsoft/microsoft-graph

The Microsoft Graph SDK for PHP

65723.5M95](/packages/microsoft-microsoft-graph)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)

PHPackages © 2026

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