1. Go to this page and download the library: Download byrokrat/autogiro library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
byrokrat / autogiro example snippets
$writer = (new \byrokrat\autogiro\Writer\WriterFactory)->createWriter(
'123456',
(new \byrokrat\banking\BankgiroFactory)->createAccount('1111-1119')
);
class MyVisitor extends \byrokrat\autogiro\Visitor\Visitor {
function beforeDeleteMandateRequest($node) {
echo "Delete mandate request found!";
}
}
$visitor = new MyVisitor;
$node->accept($visitor);
$visitor = new \byrokrat\autogiro\Visitor\Visitor;
$visitor->before(Node::DELETE_MANDATE_REQUEST, function ($node) {
echo "Delete mandate request found!";
});
$visitor->before(Node::MANDATE_RESPONSE, function ($node) {
if ($node->hasChild(Node::CREATED_FLAG)) {
// Mandate successfully created
}
if ($node->hasChild(Node::DELETED_FLAG)) {
// Mandate successfully deleted
}
if ($node->hasChild(Node::ERROR_FLAG)) {
// Mandate error state
}
});
$visitor->before(Node::SUCCESSFUL_INCOMING_PAYMENT_RESPONSE, function ($node) {
// successfull payment..
});
$visitor->before(Node::FAILED_INCOMING_PAYMENT_RESPONSE, function ($node) {
// failed payment..
});
$xmlWriter = (new \byrokrat\autogiro\Xml\XmlWriterFactory)->createXmlWriter();
echo $xmlWriter->asXml(
$parser->parse($rawFile)
);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.