Method | Description | |
---|---|---|
__construct ( $config ) | ||
addCustomNode ( $parent_XPATH, $name, $value = "", $attr = [] ) | Function to add a custom node to the document. | |
addPayment ( $payment ) | Public function to add payments | |
getDirectDebitInfo ( ) | ||
isEmpty ( ) | getBatch | |
save ( ) : The | Function to finalize and save the document after all payments are added. | |
validate ( $xml ) | Function to validate xml against the pain.008.001.02 schema definition. | |
validateAmount ( $amount ) : TRUE | Function to validate an amount, to check that amount is in cents. | |
validateBIC ( $BIC ) : TRUE | Validate a BIC number.Payment Information | |
validateBatch ( $batch ) : boolean | Validate an batch config option. | |
validateDDType ( $type ) : True | Function to validate the Direct Debit Transaction types | |
validateDate ( $date ) : True | Function to validate a ISO date. | |
validateEndToEndId ( $EndToEndId ) : boolean | Validate an EndToEndId. | |
validateIBAN ( $IBAN ) : boolean | Validate an IBAN Number. | |
validateMandateDate ( $date ) : True | Function to validate a ISO date. |
Method | Description | |
---|---|---|
calcTotalAmount ( $array ) : The | Function to calculate the sum of the amounts, given as decimals in an array. | |
createGroupHeader ( ) | Function to create the GroupHeader (GrpHdr) in the CstmrDrctDbtInit Node | |
decimalToInt ( $decimal ) : The | Function to convert an amount in decimal to cents (without point). | |
finalize ( ) | Function to finalize the document, completes the header with metadata, and processes batches. | |
getBatch ( $type, $date ) | Function to create a batch (PmtInf with BtchBookg set true) element. | |
getCstmrDrctDbtInitnNode ( ) : The | Function to get the CstmrDrctDbtInitnNode from the current document. | |
intToDecimal ( $int ) : The | Function to convert an amount in cents to a decimal (with point). | |
makeId ( ) : the | Create a random id, combined with the name (truncated at 22 chars). | |
makeMsgId ( ) : the | Create a random Message Id f$PmtInfNodeor the header, prefixed with a timestamp. | |
prepareDocument ( ) | Build the main document node and set xml namespaces. | |
validateConfig ( $config ) : TRUE | Check the config file for required fields and validity. | |
validatePayment ( $payment ) : TRUE | Check a payment for validity |
public addCustomNode ( $parent_XPATH, $name, $value = "", $attr = [] ) | ||
$parent_XPATH | A valid XPATH expression defining the parent of the new node | |
$name | The name of the new node | |
$value | The value of the new node (Optional, default "") | |
$attr | Key => Value array defining the attributes (Optional, default none) |
public save ( ) : The | ||
return | The | XML to be echoed or saved to file. |
public validate ( $xml ) | ||
$xml | The xml, as a string, to validate agianst the schema. |
public static validateAmount ( $amount ) : TRUE | ||
$amount | The amount to validate. | |
return | TRUE | if valid, FALSE if invalid. |
public validateBIC ( $BIC ) : TRUE | ||
$BIC | the BIC number to check. | |
return | TRUE | if valid, FALSE if invalid. |
public static validateBatch ( $batch ) : boolean | ||
$batch | the boolean to check. | |
return | boolean | TRUE if valid, FALSE if invalid. |
public static validateDDType ( $type ) : True | ||
return | True | if valid, error string if invalid. |
public static validateDate ( $date ) : True | ||
$date | The date to validate. | |
return | True | if valid, error string if invalid. |
public static validateEndToEndId ( $EndToEndId ) : boolean | ||
$EndToEndId | the EndToEndId to check. | |
return | boolean | TRUE if valid, error string if invalid. |
public validateIBAN ( $IBAN ) : boolean | ||
$IBAN | the IBAN number to check. | |
return | boolean | TRUE if valid, FALSE if invalid. |
public static validateMandateDate ( $date ) : True | ||
$date | The date to validate. | |
return | True | if valid, error string if invalid. |