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

ActivePackage

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

Official Simfoni interface for Laravel PHP applications.

v4.0.1(2mo ago)04.9k↓50%5[1 PRs](https://github.com/mblsolutions/simfoni-php-laravel/pulls)MITPHPPHP ^8.2CI passing

Since Jan 27Pushed 2mo ago2 watchersCompare

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

READMEChangelog (10)Dependencies (8)Versions (20)Used By (0)

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

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

[![](https://github.com/mblsolutions/simfoni-php-laravel/actions/workflows/simfoni-php-laravel.yml/badge.svg)](https://packagist.org/packages/mblsolutions/simfoni-php-laravel)[![Latest Stable Version](https://camo.githubusercontent.com/bed52609874816e333558c59198fd03640b64b878f1c9cbdac83fc738984fb59/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d626c736f6c7574696f6e732f73696d666f6e692d7068702d6c61726176656c)](https://packagist.org/packages/mblsolutions/simfoni-php-laravel)[![License](https://camo.githubusercontent.com/d40d735c0bc8ee3003bcb94b27898e9800af5cb8094189d881cf9129a5992e3c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d626c736f6c7574696f6e732f73696d666f6e692d7068702d6c61726176656c)](https://packagist.org/packages/mblsolutions/simfoni-php-laravel)

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

Contents
--------

[](#contents)

- [Installation](#installation)
- [Configuration](#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 Laravel is through [Composer](https://getcomposer.org/).

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

#### Laravel without auto-discovery

[](#laravel-without-auto-discovery)

If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php

```
\MBLSolutions\SimfoniLaravel\SimfoniServiceProvider::class,
```

If you want to use the facade for authentication, add this to your facades in app.php

'SimfoniAuth' =&gt; \\MBLSolutions\\SinfoniLaravel\\SimAuthFacade::class,

### Configuration

[](#configuration)

To import the default Simfoni configuration file into laravel please run the following command

```
php artisan vendor:publish --provider="MBLSolutions\SimfoniLaravel\SimfoniServiceProvider"
```

A new config file will be available in config/simfoni.php - Please ensure you update these configuration items with details provided by Redu Retail.

### 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',
            'encrypted_pan' => 'eyJpdiI6ImJuY2RIM3hrSnVcL3Q4amhET1BwSjZnPT0iLCJ2YWx1ZSI6ImRwWU42anNZNlFXZUJ0REVFSXJDTFFmNjVuZHFcL3ZNaXQ1Z3gzNUZ1OUt3PSIsIm1hYyI6IjVkMjM5ODlkYWM2ZjE5OWJiYjMzNWQyYTZkZDI1ZWJkZGUzMTVlZDFjOGM5NDM4YzllNWM5ZWExN2YxNDZhMjYifQ==',
            'masked_serial' => '****4360',
            'encrypted_serial' => 'eyJpdiI6IlwvVXpuQW9KVittem1rQnVQc0t3N2p3PT0iLCJ2YWx1ZSI6IlFKSGt6OXpHWWlnSFJ5WjFGWDAxaVE9PSIsIm1hYyI6ImRlNTEwMzUzZTZlZjUyNjdkZDBhZTFlYWFiOWNiYzIyNmZlNWJhMGFiYjgxYzI1NzgzMTIzMjFiYjYwOWYyMDQifQ==',
            'pin' => 'eyJpdiI6IndXNldUdkRDeDZkVFFiSVErK25sM1E9PSIsInZhbHVlIjoidjJBUFVhUlMzaTFMREVTSEVTYTRQRTkydnlaN2tESmR4ZXVpd1hpMVZaWGdseVwvNnNFeEVZVyttZEMyRnZ1dVhXWElNM3p6dWhGYmNjTko0ZE12N3dYemFxTllMVU5SVU9EdHhaZGFad2xlUXFKXC9HWEpyTFVnUVNcL2wwQTAwT2RMWEdxUVM4ZklvdnJtNlNzY3ZYaHBuS0dzZkt5QlRoSWZHc2kyb0ppSkRiR0ttMVYrbXg3ZmYrRXBjS1ZkQVhacjV4clhjaVg1TlNxVkFmV2FZb3dKRTdIajVZRDQ1ck9vVFwvTkFZZXpOa1VSSW5pTE9lTVdXelVVTU5OR2h1MWNUK2JFMjZZT1lZQmZ1OEkrS1VINzNnPT0iLCJtYWMiOiJkNTNiOWE1NzFlZDI2MGM1Y2M1MjU3NTcxYzNmMjgxZmRlMjdmMDYwYzRmZDIyYzA2YmQzN2RkZTBkZGMxY2RmIn0=',
            'url' => 'eyJpdiI6Imk0YndiZUZQUGxmN25JMWZQT21KVkE9PSIsInZhbHVlIjoiZW02eTFCem9wRmZsV3pxNUZsZkFqZWFHYWwyOEFhajNCXC9nSVFcL0lEUk9rWnIrbTM5NjBkK0lMV0paSlVzcVRUcG0xVXk0d0ZjYk9wWjlTTlUrQlRIa3QxbHhscWlJdDJ3VlhFUkladjl5eEo4Rnk2UlwvdmNcL21ZTmMzR3ZOc3RuNVYwU0YyUmVtdVA2T0YybDhWSHlydGx6TTZLY2hUUGdxOEhmTWw3NDZoMlJnQ01GRUFSZFdUVE41UEZOditzdWxrQ3NqaGlFOEZWS0d3ZjR0VGUrdTVXcHdHT1E4dzRjQ08xUVJUdWVoSUlNamhcL3ZOTUEwY29henh0S25ZU0MrTWcrNEFBWko1MjdFR1U1RHpvcUN2K01LSzArVjZNZmR0S29EQkM4NG4zNFIxbGhXNG1Ma25OeHZLSmk3aWtcL0siLCJtYWMiOiJiMmY1M2JhNTYyNmFhNzJhNmJmNGNkOWRkMDhlODY0ZDY2MjYzNjJjN2ZkODViM2E0MzRmNWUyYTY2MjQ2MzRiIn0=',
            '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 MBL Solutions 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 [MBL Solutions Technical](mailto:tech@mblsolutions.co.uk)

###  Health Score

54

—

FairBetter than 97% of packages

Maintenance84

Actively maintained with recent releases

Popularity25

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity74

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

Recently: every ~162 days

Total

15

Last Release

82d ago

Major Versions

v1.1.0 → v2.02021-04-23

v2.4.0 → v3.0.02024-04-17

v2.x-dev → v3.1.02024-05-17

v3.2.0 → v4.0.02026-02-24

### 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 (12 commits)")[![JonKnibbsPP](https://avatars.githubusercontent.com/u/132350278?v=4)](https://github.com/JonKnibbsPP "JonKnibbsPP (10 commits)")[![pureskillz83](https://avatars.githubusercontent.com/u/8451038?v=4)](https://github.com/pureskillz83 "pureskillz83 (7 commits)")[![lerouse](https://avatars.githubusercontent.com/u/610936?v=4)](https://github.com/lerouse "lerouse (5 commits)")[![hayleyberryl2s](https://avatars.githubusercontent.com/u/152175725?v=4)](https://github.com/hayleyberryl2s "hayleyberryl2s (5 commits)")[![mforcer](https://avatars.githubusercontent.com/u/850149?v=4)](https://github.com/mforcer "mforcer (2 commits)")[![sambenne](https://avatars.githubusercontent.com/u/363734?v=4)](https://github.com/sambenne "sambenne (1 commits)")[![lewisf2001uk](https://avatars.githubusercontent.com/u/11738262?v=4)](https://github.com/lewisf2001uk "lewisf2001uk (1 commits)")[![DavidDowdall](https://avatars.githubusercontent.com/u/2772138?v=4)](https://github.com/DavidDowdall "DavidDowdall (1 commits)")

---

Tags

laravelgiftcarde-giftsimfoni

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[barryvdh/laravel-debugbar

PHP Debugbar integration for Laravel

19.2k124.3M624](/packages/barryvdh-laravel-debugbar)[fruitcake/laravel-debugbar

PHP Debugbar integration for Laravel

19.1k662.9k29](/packages/fruitcake-laravel-debugbar)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M107](/packages/laravel-cashier)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[laravel-doctrine/orm

An integration library for Laravel and Doctrine ORM

8425.3M87](/packages/laravel-doctrine-orm)

PHPackages © 2026

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