PHP code example of jttech / sie

1. Go to this page and download the library: Download jttech/sie library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.

/* Start to develop here. Best regards */


jttech / sie example snippets

// create a company
$company = (new SIE\Data\Company())
    // set company name
    ->setCompanyName('My company')
    // add a verification series
    ->addVerificationSeries(new SIE\Data\VerificationSeries())
    // add two accounts
    ->addAccount((new SIE\Data\Account(1511))->setName('Kundfordringar'))
    ->addAccount((new SIE\Data\Account(3741))->setName('Öresutjämning'))

// add a verification with two transactions
$verification = (new SIE\Data\Verification(591000490))->setDate('20150105')
        (new SIE\Data\Transaction())
        (new SIE\Data\Transaction())
// add the verification to the company
// validate data, will throw Exception if invalid data

$dumper = new SIE\Dumper\SIEDumper();
$output = $dumper->dump($company);
echo $output;