PHPackages                             faso-dev/saflan-sdk - 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. faso-dev/saflan-sdk

ActiveLibrary

faso-dev/saflan-sdk
===================

20PHP

Since Jan 11Pushed 3y ago1 watchersCompare

[ Source](https://github.com/faso-dev/saflan-sdk)[ Packagist](https://packagist.org/packages/faso-dev/saflan-sdk)[ RSS](/packages/faso-dev-saflan-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

SAFLAN SDK
==========

[](#saflan-sdk)

This package aim to simplify the use of the SAFLAN API by providing a set of classes and functions to interact with the API.

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

[](#requirements)

Before using this package, you need to have a valid API login and password. You also need to have theses requirements installed:

- PHP 7.4 or higher
- composer
- ext-json
- ext-curl

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

[](#installation)

You can install the package using composer:

```
composer require faso-dev/saflan-sdk
```

Usage
-----

[](#usage)

When you have installed the package, you can use it in your code:

```
	require __DIR__ . '/vendor/autoload.php';

	use FasoDev\SaflanSdk\Saflan\Config\Config;
	use FasoDev\SaflanSdk\Saflan\Config\DataCode;
	use FasoDev\SaflanSdk\Saflan\Credentials\Credentials;
	use FasoDev\SaflanSdk\Saflan\SaflanClient;

	$config = Config::auth(new Credentials('username', 'password'))
	                ->defineSslVerification(false)
	                ->defineTimeout(30)
	                ->defineBaseEndPoint('http://www.saflan-bf.com:7170/saflanentreprise')
	;

	$saflan = SaflanClient::loadConfig($config);

	$creditResponse = $saflan->credit()->chargeWithStandard(1000, ['702000000', '702000001']);
	$mobileMoneyCreditDataResponse = $saflan->credit()->chargeWithMobileMoney(1000, ['702000000', '702000001']);
	$mobileDataResponse = $saflan->mobileData()->charge(DataCode::MOOV_PROMO_10Go_9500F_30JRS, ['702000000', '702000001']);
	$transactionStatusReponse = $saflan->transaction()->checkStatus('p20220609.478');
```

- The `Credentials` class is used to store your API login and password.
- The `Config` class is used to configure the client such as defining the credentials, the base endpoint, the timeout, the SSL verification and more.
- The `SaflanClient` class is used to load the configuration and to interact with the API. So we have 3 endpoints methods: `credit()`, `mobileData()` and `transaction()`.
- The `credit()` endpoint method is used to interact with the credit REST API to buy credit for a given numbers.
- The `mobileData()` endpoint method is used to interact with the mobile data REST API to buy mobile data for a given numbers.
- The `transaction()` endpoint method is used to interact with the transaction REST API to check the status of a given transaction.
- The `DataCode` class is used to define the data code for the mobile data.

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

[](#contributing)

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

Please make sure to update tests as appropriate.

License
-------

[](#license)

[MIT](https://choosealicense.com/licenses/mit/)

Credits
-------

[](#credits)

[![FasoDev](https://avatars.githubusercontent.com/u/40303326?v=4)](https://github.com/faso-dev)

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity23

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5f30387249ba011301439f329ef324e73d5269750c44c1265bf1a66496750028?d=identicon)[faso-dev](/maintainers/faso-dev)

---

Top Contributors

[![faso-dev](https://avatars.githubusercontent.com/u/40303326?v=4)](https://github.com/faso-dev "faso-dev (13 commits)")

### Embed Badge

![Health badge](/badges/faso-dev-saflan-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/faso-dev-saflan-sdk/health.svg)](https://phpackages.com/packages/faso-dev-saflan-sdk)
```

PHPackages © 2026

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