PHP code example of netsensei / be-bank-transfer-message

1. Go to this page and download the library: Download netsensei/be-bank-transfer-message 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/ */

    

netsensei / be-bank-transfer-message example snippets

 php
$transferMessage = new BeBankTransferMessage\TransferMessage();
echo transferMessage->getStructuredMessage();
 php
$transferMessage = new BeBankTransferMessage\TransferMessage(12345);
echo transferMessage->getStructuredMessage();
 php
$transferMessage->setNumber(54321);
$transferMessage->generate();
echo transferMessage->getStructuredMessage();
 php
$transferMessage->setNumber();
$transferMessage->generate();
echo transferMessage->getStructuredMessage();
 php
$transferMessage->setNumber();
$transferMessage->generate(TransferMessage::CIRCUMFIX_ASTERISK);
echo transferMessage->getStructuredMessage();
 php
$transferMessage = new BeBankTransferMessage\TransferMessage();
$transferMessage->setStructuredMessage('+++090/9337/55493+++');
$result = $transferMessage->validate();  // TRUE
 php
$transferMessage = new BeBankTransferMessage\TransferMessage();
$transferMessage->setStructuredMessage('+++011/9337/55493+++');
$result = $transferMessage->validate();  // FALSE