Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: /home/www/web1/html/admin/tools/PHPDoc/files/Dta.php
PEAR::Payment_DTA -

Dta

Dta

Dta class provides functions to create and handle with DTA files

 

private class Dta

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

AuthorsHermann Stainer <hs@web-gear.com>
SinceDta 0.1
Version$Revision: 0.7 $

 

Public Method Summary

void

Dta(integer $type)

Constructor. The type of the DTA file must be set. One file can
boolean

validString(string $string)

Checks if the given string contains only chars valid for fields in DTA files.
string

makeValidString(string $string)

Makes the given string valid for DTA files. German umlauts become uppercase,
boolean

setAccountFileSender(array $account)

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

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

Adds an exchange. First the account data for the receiver of the exchange is set.
string

getFileContent()

Returns the full content of the generated DTA file. All added exchanges are processed.
boolean

saveFile(string $filename)

Writes the DTA file.

Private Field Summary

integer

$type

Type of DTA file, DTA_CREDIT or DTA_DEBIT.
integer

$account_file_sender

Account data for the file sender.
array

$validString_chars

Array of ASCII Codes of valid chars for DTA field data.
integer

$timestamp

Current timestamp.
integer

$exchanges

Array of exchanges that the DTA file should contain.

Private Constant Summary

DTA_CREDIT >>0<< Determines the type of the DTA file:
DTA_DEBIT >>1<< Determines the type of the DTA file:

Public Method Details

Dta

public void Dta( integer $type )

  Constructor. The type of the DTA file must be set. One file can
only contain credits (DTA_CREDIT) OR debits (DTA_DEBIT).This is a definement of the DTA format.

Parameter
integer $type
Determines the type of the DTA file. Either DTA_CREDIT or DTA_DEBIT. Must be set.
Returns void


validString

public boolean validString( string $string )

  Checks if the given string contains only chars valid for fields in DTA files.

Parameter
string $string
String that is checked.
Returns boolean


makeValidString

public string makeValidString( string $string )

  Makes the given string valid for DTA files. German umlauts become uppercase,
all other chars not allowed are replaced with space

Parameter
string $string
String that should made valid.
Returns string


setAccountFileSender

public 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 containsname 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).

Parameter
array $account
Account data fot file sender.
Returns boolean


addExchange

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

  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 othercase (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 containname 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).

Parameter
array $account_receiver
Receiver's account data.
double $amount
Amount of money in this exchange. Currency: EURO
array $purposes
Array of up to 15 lines (maximally 27 chars each) for description of the exchange.
array $account_sender = >>array()<<
Sender's account data.
Returns boolean


getFileContent

public string getFileContent( )

  Returns the full content of the generated DTA file. All added exchanges are processed.

Returns string


saveFile

public boolean saveFile( string $filename )

  Writes the DTA file.

Parameter
string $filename
Filename.
Returns boolean


Private Field Details

$type

private integer $type

>><<

Type of DTA file, DTA_CREDIT or DTA_DEBIT.


$account_file_sender

private integer $account_file_sender

>><<

Account data for the file sender.


$validString_chars

private array $validString_chars

>><<

Array of ASCII Codes of valid chars for DTA field data.


$timestamp

private integer $timestamp

>><<

Current timestamp.


$exchanges

private integer $exchanges

>><<

Array of exchanges that the DTA file should contain.


Private Constant Details

DTA_CREDIT

define( DTA_CREDIT, >>0<< )
Case: default: case sensitive

Determines the type of the DTA file:
DTA file contains credit payments.


DTA_DEBIT

define( DTA_DEBIT, >>1<< )
Case: default: case sensitive

Determines the type of the DTA file:
DTA file contains debit payments (default).



Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta