dolibarr.bankimport/vendor/nemiah/php-fints/Samples/transfer.php
data 014a943f78 feat: HKEKA-Implementierung, PDF-Bugfixes, Sortierung, Umsatz-Umbenennung
- HKEKA v3/v4/v5 Segmente fuer phpFinTS implementiert (VR Bank unterstuetzt kein HKEKP)
- GetElectronicStatement Action mit Base64-Erkennung und Quittungscode
- PDF-Deduplizierung per MD5 (Bank sendet identische Saldenmitteilungen)
- Saldenmitteilungen ohne Auszugsnummer werden uebersprungen
- Datums-Validierung: 30.02. (Bank-Konvention) wird auf 28.02. korrigiert
- Numerische Sortierung fuer statement_number (CAST statt String-Sort)
- Jahr-Filter: statement_year=0 ausgeschlossen
- Menue/Button: "Kontoauszuege" -> "Umsaetze" (statements.php zeigt MT940, nicht PDFs)
- Redirect nach FinTS-Abruf auf aktuelles Jahr statt year=0

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 07:10:59 +01:00

54 lines
1.7 KiB
PHP
Executable file

<?php
/** @noinspection PhpUnhandledExceptionInspection */
/** @noinspection PhpUndefinedMethodInspection */
/** @noinspection PhpUndefinedNamespaceInspection */
/** @noinspection PhpUndefinedClassInspection */
/**
* SAMPLE - Execute a SEPA transfer.
*
* Note: The phpFinTs library only implements the FinTS protocol. For SEPA transfers, you need a separate library to
* produce the SEPA XML data, which is then wrapped into FinTS requests. This example uses the phpSepaXml library
* (see https://github.com/nemiah/phpSepaXml), which you need to install separately.
*/
use nemiah\phpSepaXml\SEPACreditor;
use nemiah\phpSepaXml\SEPADebitor;
use nemiah\phpSepaXml\SEPATransfer;
// See login.php, it returns a FinTs instance that is already logged in.
/** @var \Fhp\FinTs $fints */
$fints = require_once 'login.php';
$dt = new \DateTime();
$dt->add(new \DateInterval('P1D'));
$sepaDD = new SEPATransfer([
'messageID' => time(),
'paymentID' => time(),
]);
$sepaDD->setDebitor(new SEPADebitor([ //this is you
'name' => 'My Company',
'iban' => 'DE68210501700012345678',
'bic' => 'DEUTDEDB400', //,
//'identifier' => 'DE98ZZZ09999999999'
]));
$sepaDD->addCreditor(new SEPACreditor([ //this is who you want to send money to
//'paymentID' => '20170403652',
'info' => '20170403652',
'name' => 'Max Mustermann',
'iban' => 'CH9300762011623852957',
'bic' => 'GENODEF1P15',
'amount' => 48.78,
'currency' => 'EUR',
'reqestedExecutionDate' => $dt,
]));
$sendSEPATransfer = \Fhp\Action\SendSEPATransfer::create($oneAccount, $sepaDD->toXML());
$fints->execute($sendSEPATransfer);
if ($sendSEPATransfer->needsTan()) {
handleStrongAuthentication($sendSEPATransfer); // See login.php for the implementation.
}