Ejemplo n.º 1
0
 * @category  Payment
 * @package   Payment_DTA
 * @author    Martin Schütte <*****@*****.**>
 * @copyright 2010 Martin Schütte
 * @license   http://www.debian.org/misc/bsd.license  BSD License (3 Clause)
 * @version   SVN: $Id$
 * @link      http://pear.php.net/package/Payment_DTA
 */
require_once "Payment/DTAZV.php";
/**
* Initialize new DTAZV file.
* In this example the file contains credits.
* This means that in an exchange the sender is the person who pays money
* to the receiver.
*/
$dtazv_file = new DTAZV();
/**
* Set file sender. This is also the default sender for transactions.
*/
$dtazv_file->setAccountFileSender(array("name" => "Michael Mustermann", "bank_code" => 11112222, "account_number" => 654321));
/**
* Add transaction.
*/
$dtazv_file->addExchange(array("name" => "Franz Mueller", "bank_code" => "COBADEFF374", "account_number" => "DE89370400440532013000"), 12.01, array("Credit Nr. 01234", "Information"));
/**
* Output DTAZV-File.
*/
echo $dtazv_file->getFileContent();
/**
* Write DTAZV-File.
*/
Ejemplo n.º 2
0
 public function testParserTimestamp()
 {
     $date_creation = '100830';
     // 2010-08-30
     $date_execution = '100831';
     // 2010-08-31
     $dates = $date_creation . '00' . $date_execution;
     $teststring = '0256Q160500003503007767SENDERS NAME                             ' . '                                                                ' . '                                   ' . $dates . 'N0000000000    ' . '                                                                ' . '0768T16050000EUR350300776700000000000000   0000000000RZTIAT22263' . '                                                                ' . '                                                                ' . '               DE RECEIVERS NAME                                ' . '                                                                ' . '                                                                ' . '                                    /DE21700519950000007229     ' . '       EUR00000000000123450TEST-VERWENDUNGSZWECK                ' . '                                                                ' . '                                       00000000                 ' . '        0013                                                    ' . '          0                                                   00' . '0768T16050000EUR350300776700000000000000   0000000000RZTIAT22263' . '                                                                ' . '                                                                ' . '               DE SECOND RECEIVERS NAME                         ' . '                                                                ' . '                                                                ' . '                                    /DE21700519950000007229     ' . '       EUR00000000000234560TEST2                                ' . '                                                                ' . '                                       00000000                 ' . '        0013                                                    ' . '          0                                                   00' . '0256Z000000000000357000000000000002                             ' . '                                                                ' . '                                                                ' . '                                                                ';
     $dtazv = new DTAZV($teststring);
     $meta = $dtazv->getMetaData();
     $this->assertEquals("2", $meta["count"]);
     $this->assertEquals("CREDIT", $meta["type"]);
     $this->assertEquals($date_creation, strftime("%y%m%d", $meta["date"]));
 }