PHP 클래스 SEPASDD, sepa-direct-debit

파일 보기 프로젝트 열기: congressus/sepa-direct-debit 1 사용 예제들

공개 메소드들

메소드 설명
__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.

비공개 메소드들

메소드 설명
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

메소드 상세

__construct() 공개 메소드

public __construct ( $config )

addCustomNode() 공개 메소드

Function to add a custom node to the document.
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)

addPayment() 공개 메소드

Public function to add payments
public addPayment ( $payment )

getDirectDebitInfo() 공개 메소드

public getDirectDebitInfo ( )

isEmpty() 공개 메소드

getBatch
public isEmpty ( )

save() 공개 메소드

Function to finalize and save the document after all payments are added.
public save ( ) : The
리턴 The XML to be echoed or saved to file.

validate() 공개 메소드

Function to validate xml against the pain.008.001.02 schema definition.
public validate ( $xml )
$xml The xml, as a string, to validate agianst the schema.

validateAmount() 공개 정적인 메소드

Function to validate an amount, to check that amount is in cents.
public static validateAmount ( $amount ) : TRUE
$amount The amount to validate.
리턴 TRUE if valid, FALSE if invalid.

validateBIC() 공개 메소드

Validate a BIC number.Payment Information
public validateBIC ( $BIC ) : TRUE
$BIC the BIC number to check.
리턴 TRUE if valid, FALSE if invalid.

validateBatch() 공개 정적인 메소드

Validate an batch config option.
public static validateBatch ( $batch ) : boolean
$batch the boolean to check.
리턴 boolean TRUE if valid, FALSE if invalid.

validateDDType() 공개 정적인 메소드

Function to validate the Direct Debit Transaction types
public static validateDDType ( $type ) : True
리턴 True if valid, error string if invalid.

validateDate() 공개 정적인 메소드

Function to validate a ISO date.
public static validateDate ( $date ) : True
$date The date to validate.
리턴 True if valid, error string if invalid.

validateEndToEndId() 공개 정적인 메소드

Validate an EndToEndId.
public static validateEndToEndId ( $EndToEndId ) : boolean
$EndToEndId the EndToEndId to check.
리턴 boolean TRUE if valid, error string if invalid.

validateIBAN() 공개 메소드

Validate an IBAN Number.
public validateIBAN ( $IBAN ) : boolean
$IBAN the IBAN number to check.
리턴 boolean TRUE if valid, FALSE if invalid.

validateMandateDate() 공개 정적인 메소드

Function to validate a ISO date.
public static validateMandateDate ( $date ) : True
$date The date to validate.
리턴 True if valid, error string if invalid.