PHPackages                             mblsolutions/simfoni-php - 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. mblsolutions/simfoni-php

ActivePackage[API Development](/categories/api)

mblsolutions/simfoni-php
========================

Official Simfoni interface for PHP applications.

v3.1.5(10mo ago)05.0k↓50%11MITPHPPHP &gt;=7.1|^8.0CI passing

Since Jan 20Pushed 10mo ago3 watchersCompare

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

READMEChangelog (10)Dependencies (2)Versions (27)Used By (1)

Simfoni interface for PHP
=========================

[](#simfoni-interface-for-php)

[![](https://github.com/mblsolutions/simfoni-php/actions/workflows/simfoni-php.yml/badge.svg)](https://packagist.org/packages/mblsolutions/simfoni-php)[![Latest Stable Version](https://camo.githubusercontent.com/675db09c2b4535e5b2997af4f17754edbf97d7bef26810ca6d0b3f3385e05919/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d626c736f6c7574696f6e732f73696d666f6e692d706870)](https://packagist.org/packages/mblsolutions/simfoni-php)[![License](https://camo.githubusercontent.com/0978785e4145cf98ee089f614cfdb93d76599499e7e0e3a8e478a297c1dda5da/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d626c736f6c7574696f6e732f73696d666f6e692d706870)](https://packagist.org/packages/mblsolutions/simfoni-php)

The Simfoni Interface for PHP gives you an API interface into the Simfoni Platform for your PHP applications.

Contents
--------

[](#contents)

- [Installation](#installation)
- [Authentication](#authentication)
- [Create Order](#create-order)
- [Issued Info](#issued-info)
- [Decryption](#decryption)
- [Responses](#responses)
- [Errors](#errors)
- [License](#license)

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

[](#installation)

The recommended way to install Simfoni PHP is through [Composer](https://getcomposer.org/).

```
composer require mblsolutions/simfoni-php
```

### Authentication

[](#authentication)

Please Note: Your API credentials (Client ID, Client Secret and access\_tokens) carry many permissions. Keep these credentials secure. Do not share this data in Github, client side code etc... If you believe any of your credentials have been compromised, within the Simfoni application interface revoke/reset user tokens, client secrets and encryption keys.

Authentication can be made by passing your Simfoni Application `Client ID`, `Client Secret`, `Users Email` and `Users Password` to the authentication password method.

```
$simfoniAuth = new \MBLSolutions\Simfoni\Authentication();

$authentication = $simfoniAuth->password(1, 'auth-secret', 'john.doe@exmaple.com', 'password');
```

A successful authentication will return an OAuth response containing access, refresh and user information.

```
[
    'token_type' => 'Bearer',
    'expires_in' => 31622400,
    'access_token' => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjBmOGMwNDAxZDAy',
    'refresh_token' => 'def5020002eca9ac7875d5d800c195024d7fb702535c0d30a0',
    'user' => [
        'name' => 'John Doe',
        'email' => 'john.doe@example.com',
        'role' => 'programme_manager'
    ]
];
```

We recommend this information is stored and reused between requests (the authentication will expire '31622400' seconds from the moment the authentication is issued).

Use your `access_token` by setting the token in the Simfoni Configuration. The PHP library will automatically attach this token to each api request (within the current request, each PHP request would need to re-set this token).

```
\MBLSolutions\Simfoni\Simfoni::setToken('eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjBmOGMwNDAxZDAy');
```

### Create Order

[](#create-order)

To create an order, certain parameters are required, many are optional depending on the nature of the order. For example, to request a single e-Code for a product with a value of £10.00, the following example would be the minimum required. Under these circumstances much of the order information is predetermined by the configuration of the Simfoni system.

The processing of orders is subject to certain rules applied to the product being ordered. One of these is a control over when the product can be ordered without manual intervention for payment. Orders will not be processed if the account does not have sufficient funds available either through a credit or debit facility (or the account is in aged debt). Similarly, the product may be subject to restrictions on when it can be ordered without manual intervention (Fast Track). Normally, this will be set to 24 X 7 processing. If for any reason there are restrictions on a product, an error message will be returned in the form:

```
$payload = [
    'urn' => 1234,
    'items' => [
        'data' => [
            [
                'sku' => 'ECODE_SKU',
                'quantity' => 1,
                'price' => 10.00,
                'activation_date' => '2021-01-01T17:00:00+00:00',
            ],
        ]
    ]
];

\MBLSolutions\Simfoni\Simfoni::setToken('your-token');

$order = new \MBLSolutions\Simfoni\Order();
$response = $order->create($payload);
```

A successful request will show information about the placed order.

```
[
    'data' => [
        'id' => 6000001,
        'invoice_number' => null,
        'client_name' => 'An Client',
        'account_name' => 'An Account',
        'reference' => 'order-reference-here',
        'po_number' => null,
        'discount' => 0,
        'handling' => 0,
        'status' => 'Awaiting Payment',
        'contact_company' => 'An Account',
        'contact_title' => 'Ms',
        'contact_first_name' => 'Dayton',
        'contact_last_name' => 'Quitzon',
        'contact_email' => 'bryon.tromp@example.net',
        'contact_address1' => '843',
        'contact_address2' => 'Freeway',
        'contact_address3' => 'Apt. 979',
        'contact_town_city' => 'Lake Faye',
        'contact_county' => 'Idaho',
        'contact_postcode' => '43270',
        'contact_country' => 'GB',
        'billing_company' => 'An Account',
        'billing_title' => 'Ms',
        'billing_first_name' => 'Dayton',
        'billing_last_name' => 'Quitzon',
        'billing_email' => 'bryon.tromp@example.net',
        'billing_address1' => '843',
        'billing_address2' => 'Freeway',
        'billing_address3' => 'Apt. 979',
        'billing_town_city' => 'Lake Faye',
        'billing_county' => 'Idaho',
        'billing_postcode' => '43270',
        'billing_country' => 'GB',
        'order_date' => '2021-01-01T15:00:00+00:00'
    ],
];
```

### Issued Info

[](#issued-info)

To view details on encrypted PAN, Serial, Pin and Url information associated with the order you must request this using `IssuedInfo`

In order to call this end point, a Webhook must be set up to return the required parameter information when the order is complete.

```
\MBLSolutions\Simfoni\Simfoni::setToken('your-token');

$issuedInfo = new \MBLSolutions\Simfoni\IssuedInfo();
$result = $issedInfo->show('your-hash');
```

An example successful response

```
[
    'data' => [
        [
            'item_id' => 'XqVroNPWnw',
            'sku' => '12345678',
            'value' => 100,
            'masked_pan' => '************1350',
            'encr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QT21KVkE9PSIsInZhbHVlIjoiZW02eTFCem9wRmZsV3pxNUZsZkFqZWFHYWwyOEFhajNCXC9nSVFcL0lEUk9rWnIrbTM5NjBkK0lMV0paSlVzcVRUcG0xVXk0d0ZjYk9wWjlTTlUrQlRIa3QxbHhscWlJdDJ3VlhFUkladjl5eEo4Rnk2UlwvdmNcL21ZTmMzR3ZOc3RuNVYwU0YyUmVtdVA2T0YybDhWSHlydGx6TTZLY2hUUGdxOEhmTWw3NDZoMlJnQ01GRUFSZFdUVE41UEZOditzdWxrQ3NqaGlFOEZWS0d3ZjR0VGUrdTVXcHdHT1E4dzRjQ08xUVJUdWVoSUlNamhcL3ZOTUEwY29henh0S25ZU0MrTWcrNEFBWko1MjdFR1U1RHpvcUN2K01LSzArVjZNZmR0S29EQkM4NG4zNFIxbGhXNG1Ma25OeHZLSmk3aWtcL0siLCJtYWMiOiJiMmY1M2JhNTYyNmFhNzJhNmJmNGNkOWRkMDhlODY0ZDY2MjYzNjJjN2ZkODViM2E0MzRmNWUyYTY2MjQ2MzRiIn0=',
            'activation_date' => '2018-12-25T00:00:00+00:00'
        ]
    ],
    'links' => [
        'first' => 'https://simfoni.co.uk/api/order/eyJpdiI6Im9FN1pMZ2kwMlRlcXU1c1Z5cGxxNXc9PSIsInZhbHVlIjoiXC9SXC9xOFFSSklWa3lEWG82bDhsN293PT0iLCJtYWMiOiIxMDBmYmVjODlhYjE3MDcxNzc2ZDM2NmMxY2YwNThlNWFjN2E3ZDQ3MjBkMTE5NGQwYzE4MDZlNmI3YjkwZjdmIn0=/issuedinfo?page=1',
        'last' => 'https://simfoni.co.uk/api/order/eyJpdiI6Im9FN1pMZ2kwMlRlcXU1c1Z5cGxxNXc9PSIsInZhbHVlIjoiXC9SXC9xOFFSSklWa3lEWG82bDhsN293PT0iLCJtYWMiOiIxMDBmYmVjODlhYjE3MDcxNzc2ZDM2NmMxY2YwNThlNWFjN2E3ZDQ3MjBkMTE5NGQwYzE4MDZlNmI3YjkwZjdmIn0=/issuedinfo?page=1',
        'prev' => null,
        'next' => null
    ],
    'meta' => [
        'current_page' => 1,
        'from' => 1,
        'last_page' => 1,
        'path' => 'https://simfoni.co.uk/api/order/eyJpdiI6Im9FN1pMZ2kwMlRlcXU1c1Z5cGxxNXc9PSIsInZhbHVlIjoiXC9SXC9xOFFSSklWa3lEWG82bDhsN293PT0iLCJtYWMiOiIxMDBmYmVjODlhYjE3MDcxNzc2ZDM2NmMxY2YwNThlNWFjN2E3ZDQ3MjBkMTE5NGQwYzE4MDZlNmI3YjkwZjdmIn0=/issuedinfo',
        'per_page' => 20,
        'to' => 1,
        'total' => 1
    ],
];
```

### Decryption

[](#decryption)

When utilising `IssuedInfo` the data returned contains encrypted PAN, Serial, Pin and Url information associated with the order. As this information is confidential, it is returned in an encrypted form. To decrypt the values, a secret key is required.

To decrypt the values, a secret key is required. This is specifically for the decryption of this information. This key will be provided by Redu Retail as part of the configuration.

```
// test decrypting a 4 digit pin
$decrypt = new new \MBLSolutions\Simfoni\Decrypt('JD62JFgGrKJdc1UsZmHykg==');
$string = 'eyJpdiI6Ikhjdlp1Uzc0WFZ2MkdDZ3lHc3VVQnc9PSIsInZhbHVlIjoiXC8reHhBditLWUc3eDdiWlFhVm96enBXQlhJSUR6VzZZb3I4NE9MNkd6Tms9IiwibWFjIjoiYjFiNWRlYzI0NDY2ZmZmYTk4NGJhMjgxN2EwZTAyZjg0YzJmNjg5YmNiMDA2ZDQ1OWViODgxM2QwM2FiNjk3YSJ9';

$pin = $decrypt->data($string);
// pin = 3840
```

### Responses

[](#responses)

All responses will be returned as an array. To make calls consistent, all will paginate their results, even if the response only contains one result, or no results at all.

There will be three top-level keys in a response

- `data`, which contains an array of results.
- `links`, which contains links for pagination purposes.
- `meta`, which contains additional pagination-related information.

```
[
    'data' => [
        // results
    ],
    'links' => [
        'first' => 'https://simfoni.co.uk/api/order?page=1',
        'next' => 'https://simfoni.co.uk/api/order?page=2',
    ],
    'meta' => [
        'current_page' => 1,
        'from' => 1,
        'last_page' => 1,
        'path' => 'https://simfoni.co.uk/api/order',
        'per_page' => 20,
        'to' => 1,
        'total' => 1
    ]
];
```

### Errors

[](#errors)

#### Exceptions

[](#exceptions)

For exception levels errors retrieving data from Simfoni an array will be returned with a single `message` index.

```
[
    'message' => 'A message describing the error',
];
```

#### Validation Failures

[](#validation-failures)

For methods that require specific parameters, if a parameter fails validation then you will receive the following response body:

```
[
    'message' => 'The given data was invalid.',
    'errors' =>  [
        // errors here
    ],
];
```

The `errors` key will contain an object where the keys are the name of the field that failed validation, and the value is an array of messages describing the validation failure so you can correct your input.

Field names use “dotted” notation to designate nested field names. For example, the field items\[0\]\[sku\] would be represented as items.0.sku in the errors object.

### License

[](#license)

Simfoni Interface for PHP is free software distributed under the terms of the MIT license.

A contract/subscription to Simfoni is required to make use of this package, for more information contact [Redu Group Technical](mailto:tech@redu.co.uk)

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance54

Moderate activity, may be stable

Popularity23

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~71 days

Recently: every ~59 days

Total

24

Last Release

306d ago

Major Versions

v0.2.0 → v1.0.02021-01-27

v1.0.1 → v2.0.02021-04-23

v2.6.2 → v3.0.02024-04-17

v2.x-dev → v3.0.12024-04-19

PHP version history (2 changes)v0.1.0PHP &gt;=7.1

v2.5.0PHP &gt;=7.1|^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/610936?v=4)[Christian Innerbichler](/maintainers/lerouse)[@lerouse](https://github.com/lerouse)

![](https://www.gravatar.com/avatar/102e5b958c4a1e833fd8812ac866581ccf52bbc0cd9627253589025c42cf0f37?d=identicon)[hayleyberryl2s](/maintainers/hayleyberryl2s)

---

Top Contributors

[![rsloan-mlbsolutions](https://avatars.githubusercontent.com/u/115983535?v=4)](https://github.com/rsloan-mlbsolutions "rsloan-mlbsolutions (24 commits)")[![lerouse](https://avatars.githubusercontent.com/u/610936?v=4)](https://github.com/lerouse "lerouse (16 commits)")[![pureskillz83](https://avatars.githubusercontent.com/u/8451038?v=4)](https://github.com/pureskillz83 "pureskillz83 (15 commits)")[![JonKnibbsPP](https://avatars.githubusercontent.com/u/132350278?v=4)](https://github.com/JonKnibbsPP "JonKnibbsPP (6 commits)")[![hayleyberryl2s](https://avatars.githubusercontent.com/u/152175725?v=4)](https://github.com/hayleyberryl2s "hayleyberryl2s (3 commits)")[![MinaWilliam](https://avatars.githubusercontent.com/u/4950742?v=4)](https://github.com/MinaWilliam "MinaWilliam (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mblsolutions-simfoni-php/health.svg)

```
[![Health](https://phpackages.com/badges/mblsolutions-simfoni-php/health.svg)](https://phpackages.com/packages/mblsolutions-simfoni-php)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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