Payment_DTA
[ class tree: Payment_DTA ] [ index: Payment_DTA ] [ all elements ]

Class: DTA

Source Location: /Payment_DTA-1.4.3/DTA.php

Class Overview

DTABase
   |
   --DTA

Dta class provides functions to create and handle with DTA files used in Germany to exchange informations about money transactions with banks or online banking programs.


Author(s):

Version:

  • Release: 1.4.3

Variables

Methods


Inherited Variables

Inherited Methods

Class: DTABase

DTABase::__construct()
Constructor.
DTABase::addExchange()
Adds an exchange. First the account data for the receiver of the exchange is set. In the case the DTA file contains credits, this is the payment receiver.
DTABase::checkStr()
Checks if string $input contains the expected value at an offset.
DTABase::count()
Return number of exchanges
DTABase::current()
DTABase::filter()
Auxillary method to filter output strings.
DTABase::getFileContent()
Returns the full content of the generated file.
DTABase::getMetaData()
Returns an array with information about the transactions.
DTABase::getNum()
Read integer number of given length from input at offset.
DTABase::getParsingErrors()
Get parsing errors.
DTABase::getStr()
Read string of given length from input at offset.
DTABase::key()
DTABase::makeValidString()
Makes the given string valid for DTA files.
DTABase::next()
DTABase::rewind()
DTABase::saveFile()
Writes the DTA file.
DTABase::setAccountFileSender()
Set the sender of the file.
DTABase::valid()
DTABase::validString()
Checks if the given string contains only chars valid for fields in DTA files.

Class Details

[line 97]
Dta class provides functions to create and handle with DTA files used in Germany to exchange informations about money transactions with banks or online banking programs.

Specifications:

  • http://www.ebics-zka.de/dokument/pdf/Anlage%203-Spezifikation%20der%20Datenformate%20-%20Version%202.3%20Endfassung%20vom%2005.11.2008.pdf, part 1.1 DTAUS0, p. 4ff
  • http://www.bundesbank.de/download/zahlungsverkehr/zv_spezifikationen_v1_5.pdf
  • http://www.hbci-zka.de/dokumente/aenderungen/DTAUS_2002.pdf



[ Top ]


Class Variables

$sum_accounts =

[line 118]

Sum of account numbers in exchanges; used for control fields.
  • Access: protected

Type:   integer


[ Top ]

$sum_bankcodes =

[line 111]

Sum of bank codes in exchanges; used for control fields.
  • Access: protected

Type:   integer


[ Top ]

$type =

[line 104]

Type of DTA file, DTA_CREDIT or DTA_DEBIT.
  • Access: protected

Type:   integer


[ Top ]



Method Detail

__construct (Constructor)   [line 139]

DTA __construct( integer|string $type)

Constructor. Creates an empty DTA object or imports one.

If the parameter is a string, then it is expected to be in DTA format an its content (sender and transactions) is imported. If the string cannot be parsed at all then an empty DTA object with type DTA_CREDIT is returned. If only parts of the string can be parsed, then all transactions before the error are included into the object. The user should use getParsingError() to check whether a parsing error occured.

Otherwise the parameter has to be the type of the new DTA object, either DTA_CREDIT or DTA_DEBIT. In this case exceptions are never thrown to ensure compatibility.

  • Access: public

Overrides DTABase::__construct() (Constructor.)

Parameters:

integer|string   $type   —  Either a string with DTA data or the type of the new DTA file (DTA_CREDIT or DTA_DEBIT). Must be set.

[ Top ]

addExchange   [line 288]

boolean addExchange( array $account_receiver, double $amount, array $purposes, [array $account_sender = array()])

Adds an exchange. First the account data for the receiver of the exchange is set. In the case the DTA file contains credits, this is the payment receiver.

In the other case (the DTA file contains debits), this is the account, from which money is taken away. If the sender is not specified, values of the file sender are used by default.

Account data for receiver and sender contain name Name. Maximally 27 chars are allowed. bank_code Bank code. account_number Account number. additional_name If necessary, additional line for name (maximally 27 chars).

  • Access: public

Overrides DTABase::addExchange() (Adds an exchange. First the account data for the receiver of the exchange is set. In the case the DTA file contains credits, this is the payment receiver.)

Parameters:

array   $account_receiver   —  Receiver's account data.
double   $amount   —  Amount of money in this exchange. Currency: EURO
array   $purposes   —  Array of up to 14 lines (maximally 27 chars each) for description of the exchange. A string is accepted as well.
array   $account_sender   —  Sender's account data.

[ Top ]

getFileContent   [line 632]

string getFileContent( )

Returns the full content of the generated DTA file.

All added exchanges are processed.

  • Access: public

Overrides DTABase::getFileContent() (Returns the full content of the generated file.)
[ Top ]

getMetaData   [line 678]

array getMetaData( )

Returns an array with information about the transactions.

Can be used to print an accompanying document (Begleitzettel) for disks.

  • Return: Returns an array with keys: "sender_name", "sender_bank_code", "sender_account", "sum_amounts", "type", "sum_bankcodes", "sum_accounts", "count", "date", "exec_date"
  • Access: public

Overrides DTABase::getMetaData() (Returns an array with information about the transactions.)
[ Top ]

parse   [line 1161]

void parse( string $input)

Parser. Read data from an existing DTA file content.

Parsing can leave us with four situations:

  • the input is parsed correctly => valid DTA object.
  • the input is parsed but a checksum does not match the data read => valid DTA object. throws a Payment_DTA_ChecksumException.
  • the n-th transaction cannot be parsed => parsing stops there, yielding a valid DTA object, but with only the first n-1 transactions and without checksum verification. throws a Payment_DTA_ParseException.
  • a parsing error occurs in the A record => the DTA object is invalid throws a Payment_DTA_FatalParseException.

  • Throws: Payment_DTA_Exception on unrecognized input
  • Access: protected

Parameters:

string   $input   —  content of DTA file

[ Top ]

setAccountFileSender   [line 180]

boolean setAccountFileSender( array $account)

Set the sender of the DTA file. Must be set for valid DTA file.

The given account data is also used as default sender's account. Account data contains name Sender's name. Maximally 27 chars are allowed. bank_code Sender's bank code. account_number Sender's account number. additional_name If necessary, additional line for sender's name (maximally 27 chars). exec_date Optional execution date for the DTA file in format DDMMYYYY.

  • Access: public

Overrides DTABase::setAccountFileSender() (Set the sender of the file.)

Parameters:

array   $account   —  Account data for file sender.

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:49:02 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.