loppep / peppol-directory-client
An API client for the Peppol directory
Installs: 216
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/loppep/peppol-directory-client
Requires
- php: ^7.4 || ^8.0
- ext-json: *
- ext-mbstring: *
- ext-simplexml: *
- paragonie/constant_time_encoding: ^2.8 || ^3.0
- php-http/discovery: ^1.17
- psr/http-client: *
- psr/http-client-implementation: *
- psr/http-factory-implementation: *
Requires (Dev)
- nyholm/psr7: ^1.8
- symfony/http-client: ^5.4
README
An API client for searching Peppol participants in the Peppol Directory.
The additional SMP check ensures that the participant is actually reachable via Peppol.
This was mainly implemented because of the following reason found in the documentation of the Peppol Directory:
A crucial governance note: updating the Directory is performed by SMP providers and is not mandatory. Therefore, a company can be fully routable on Peppol and still not appear in the public Directory. This does not invalidate their Peppol status; it only means their SMP has not published a “business card” to the Directory.
Getting started
Install our library
composer require loppep/peppol-directory-client
Install a PSR-18 library, e.g. Symfony HttpClient
composer require symfony/http-client
Install a PSR-7 library, e.g. Nyholm PSR-7
composer require nyholm/psr7
Search for a Peppol participant
This performs a search in the Peppol Directory and additionally checks the SMP.
use Http\Discovery\Psr18Client; use Loppep\PeppolDirectoryClient\Enum\Environment; use Loppep\PeppolDirectoryClient\PeppolDirectoryClient; $directory = new PeppolDirectoryClient( new Psr18Client(), Environment::production() ); $directory->search('DE343985244');
Get a Peppol participant by their ID
This bypasses the Peppol Directory and checks directly with the SMP.
use Http\Discovery\Psr18Client; use Loppep\PeppolDirectoryClient\Data\IdType; use Loppep\PeppolDirectoryClient\Enum\Environment; use Loppep\PeppolDirectoryClient\PeppolDirectoryClient; $directory = new PeppolDirectoryClient( new Psr18Client(), Environment::production() ); $directory->get( new IdType( $scheme = 'iso6523-actorid-upis', $value = '9930:de343985244' ) );
Quickly check if a Peppol participant is registered
This bypasses the Peppol Directory and checks directly with the SMP.
use Http\Discovery\Psr18Client; use Loppep\PeppolDirectoryClient\Data\IdType; use Loppep\PeppolDirectoryClient\Enum\Environment; use Loppep\PeppolDirectoryClient\PeppolDirectoryClient; $directory = new PeppolDirectoryClient( new Psr18Client(), Environment::production() ); $directory->isRegistered( new IdType( $scheme = 'iso6523-actorid-upis', $value = '9930:de343985244' ) );