Download the PHP package cube43/ebics-client without Composer
On this page you can find all versions of the php package cube43/ebics-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package ebics-client
cube43/ebics-client
PHP library to communicate with bank through EBICS protocol.
License
cube43/ebics-client is licensed under the MIT License, see the LICENSE file for details
Note
This library is a refactoring of andrew-svirin/ebics-client-php to allow multiple protocol version + unit test and E2e test
Ebics protocol version supported :
- 2.4
- 2.5
- 3.0
Command supported :
- INI
- HIA
- HPB
- FDL
This library work only with X509 certified communication
Installation
Initialize client
You will need to have this informations from your Bank :
- HostID
- HostURL
- PartnerID
- UserID
- protocol version
Note : $HOST_ID, $HOST_URL, $PARTNER_ID, $USER_ID and version are decided between you and your bank.
How to use
Before making what you want to achieve (ex: FDL call) you have to generate keys and communicate it to with the server (INI, HIA and HPB command).
INI command
INI command will generate a certificat of type A and send it to ebics server. After making this request, you have to save the keyring with the new generate certificat because it will be used in call after.
HIA command
HIA command will generate a certificat of type e and x and then send it to ebics server. After making this request, you have to save the keyring with the new generate certificat because it will be used in call after.
HPB command
HPB command will retrieve certificat of type e and x from the ebics server. After making this request, you have to save the keyring with the new retrieved certificat because it will be used in call after.
Once INI, HIA and HPB have been run your good to use ebics protocol.
FDL command
Saving keyring
Wakeup keyring
good to know
This website provide an ebics server testing environnement : https://software.elcimai.com/efs/accueil-qualif.jsp
Full sample to generate certificate and get letter
Working with Doctrine2 instead of file
/**
* @ORM\Table(name="ebics")
* @ORM\Entity()
*
* @Type()
*/
class Ebics
{
/**
* @ORM\Column(type="uuid")
* @ORM\Id
*/
private UuidInterface $id;
/** @ORM\Column(type="string") */
private string $hostUrl;
/** @ORM\Column(type="string") */
private string $partnerId;
/** @ORM\Column(type="string") */
private string $userId;
/** @ORM\Column(type="string") */
private string $hostId;
/** @ORM\Column(type="json") */
private array $certificat;
public function __construct(
string $hostUrl,
string $hostId,
string $partnerId,
string $userId
) {
$this->id = Uuid::uuiv4();
$this->hostUrl = $hostUrl;
$this->partnerId = $partnerId;
$this->userId = $userId;
$this->hostId = $hostId;
$this->certificat = [];
}
public function getKeyring(): KeyRing
{
return KeyRing::fromArray($this->getCertificat(), (string) getenv('PASSWORD'));
}
public function getBank(): Bank
{
return new Bank($this->getHostId(), $this->getHostUrl(), Version::v24(), $this->getPartnerId(), $this->getUserId());
}
public function setCertificat(KeyRing $keyRing): void
{
$this->certificat = json_decode(json_encode($keyRing->jsonSerialize()), true);
}
}
$ebicsEntity = new Ebics('EBIXQUAL', 'https://server-ebics.webank.fr:28103/WbkPortalFileTransfert/EbicsProtocol', Version::v24(), $partnerId, $userId);
$x509OptionGenerator = new DefaultX509OptionGenerator();
if (!$ebicsEntity->getKeyring()->hasUserCertificatA()) {
$ebicsEntity->setCertificat((new INICommand())->__invoke($ebicsEntity->getBank(), $ebicsEntity->getKeyring(), $x509OptionGenerator));
}
if (!$ebicsEntity->getKeyring()->hasUserCertificateEAndX()) {
$ebicsEntity->setCertificat((new HIACommand())->__invoke($ebicsEntity->getBank(), $ebicsEntity->getKeyring(), $x509OptionGenerator));
}
if (!$ebicsEntity->getKeyring()->hasBankCertificate()) {
$ebicsEntity->setCertificat((new HPBCommand())->__invoke($ebicsEntity->getBank(), $ebicsEntity->getKeyring()));
}
``
All versions of ebics-client with dependencies
ext-dom Version *
ext-openssl Version *
ext-zlib Version *
ext-json Version *
phpseclib/phpseclib Version ^2.0.47
symfony/http-client Version ^6.3.12 || ^7.1.11