diff --git a/vendor/lib/Sepa.php b/vendor/lib/Sepa.php index cea3dbe..6eb05a2 100644 --- a/vendor/lib/Sepa.php +++ b/vendor/lib/Sepa.php @@ -1,5 +1,5 @@ setAccountName($name); $this->setAccountIban($iban); - if ($bic) + if ($bic !== '') { $this->setAccountBic($bic); } @@ -358,7 +358,7 @@ public function setAccount(string $name, string $iban, string $bic = '') : Payme } /** - * set applicant name + * Set applicant name * * @param string $name * @throws PaymentException @@ -376,7 +376,7 @@ public function setAccountName(string $name) : Payment } /** - * get applicant name + * Get applicant name * * @return string */ @@ -386,7 +386,7 @@ public function getAccountName() : string } /** - * set applicant IBAN + * Set applicant IBAN * * @param string $iban * @throws PaymentException @@ -408,7 +408,7 @@ public function setAccountIban(string $iban) : Payment } /** - * get applicant IBAN + * Get applicant IBAN * * @return string */ @@ -418,7 +418,7 @@ public function getAccounIban() : string } /** - * set applicant BIC + * Set applicant BIC * * @param string $bic * @throws PaymentException @@ -440,7 +440,7 @@ public function setAccountBic(string $bic = '') : Payment } /** - * get applicant BIC + * Get applicant BIC * * @return string */ @@ -450,7 +450,7 @@ public function getAccountBic() : string } /** - * set account currency + * Set account currency * * @param string $currency * @throws PaymentException @@ -473,7 +473,7 @@ public function setAccountCurrency(string $currency) : Payment } /** - * get applicant currency + * Get applicant currency * * @return string */ @@ -483,7 +483,7 @@ public function getAccountCurrency() : string } /** - * set ultimate applicant + * Set ultimate applicant * * @param string $ultimateName * @return Payment @@ -496,7 +496,7 @@ public function setUltimateName(string $ultimateName) : Payment } /** - * get ultimate applicant + * Get ultimate applicant * * @return string */ @@ -506,7 +506,7 @@ public function getUltimateName() : string } /** - * add transaction + * Add transaction * * @param Transaction $transaction * @return Payment @@ -519,7 +519,7 @@ public function addTransaction(Transaction $transaction) : Payment } /** - * get payment transactions + * Get payment transactions * * return array */ @@ -529,7 +529,7 @@ public function getTransactions() : array } /** - * counts the transactions in this payment collection + * Counts the transactions in this payment collection * * @return int */ @@ -539,7 +539,7 @@ public function getNumberOfTransactions() : int } /** - * get control sum + * Get control sum * * @return int */ @@ -554,7 +554,7 @@ public function getControlSum() : int } /** - * check necessary payment data + * Check necessary payment data * * @param bool $isDirectDebit * @throws PaymentException diff --git a/vendor/lib/Sepa/Transaction.php b/vendor/lib/Sepa/Transaction.php index 0ab644a..1e3564a 100644 --- a/vendor/lib/Sepa/Transaction.php +++ b/vendor/lib/Sepa/Transaction.php @@ -1,5 +1,5 @@ calculateCheckDigit($checkSum) === 97); diff --git a/vendor/lib/Sepa/Validator/Iban.php b/vendor/lib/Sepa/Validator/Iban.php index 27e4a32..3cefb74 100644 --- a/vendor/lib/Sepa/Validator/Iban.php +++ b/vendor/lib/Sepa/Validator/Iban.php @@ -1,5 +1,5 @@ calculateCheckDigit($checkSum) === 97); diff --git a/vendor/lib/Sepa/Xml.php b/vendor/lib/Sepa/Xml.php index 3cf5ed7..1a3a4e7 100644 --- a/vendor/lib/Sepa/Xml.php +++ b/vendor/lib/Sepa/Xml.php @@ -1,5 +1,5 @@ compression = false; + $this->compression = true; return $this; } /** - * get XML + * Get XML * * @return string */ @@ -95,7 +95,7 @@ public function get() : string } /** - * save XML to file + * Save XML to file * * @param string $filename * @return bool @@ -145,7 +145,7 @@ public function save(string $filename) : bool } /** - * download XML + * Download XML * * @param string $filename * @return void @@ -165,7 +165,7 @@ public function download(string $filename = '') : void } /** - * generate the XML file + * Generate the XML file * * @throws XmlException * @return Xml @@ -199,7 +199,7 @@ public function create() : Xml } /** - * validate XML + * Validate XML * * @throws XmlException * @return bool @@ -208,7 +208,7 @@ public function validate() : bool { libxml_use_internal_errors(true); - $xsdFile = $this->getPainFile(); + $xsdFile = $this->getSchemaFile(); if ($this->tmpFile === null) { $this->create(); @@ -221,7 +221,12 @@ public function validate() : bool return $xml->isValid(); } - public function getPainFile() : string + /** + * Get schema file + * + * @return string + */ + public function getSchemaFile() : string { $xsdFile = __DIR__ . '/../../schema/' . $this->sepa->getPain() . '.xsd'; if (!is_file($xsdFile)) @@ -232,7 +237,7 @@ public function getPainFile() : string } /** - * get errors + * Get errors * * @return array */ @@ -247,7 +252,7 @@ public function getErrors() : array } /** - * get last error + * Get last error * * @return Exception */ @@ -262,7 +267,7 @@ public function getLastError() : Exception } /** - * destroy temp file + * Destroy temp file */ private function cleanup() { @@ -274,7 +279,7 @@ private function cleanup() } /** - * generate document root and group header + * Generate document root and group header * * @param \XMLWriter $xml */ @@ -329,7 +334,7 @@ private function generateDocument(\XMLWriter $xml) } /** - * generate payment information + * Generate payment information * * @param Payment $payment * @param \XMLWriter $xml @@ -460,7 +465,7 @@ private function generatePayment(Payment $payment, \XMLWriter $xml, int $count) } /** - * generate transaction information + * Generate transaction information * * @param Transaction $transaction * @param \XMLWriter $xml @@ -504,7 +509,7 @@ private function generateTransaction(Transaction $transaction, \XMLWriter $xml) $xml->startElement('MndtRltdInf'); $xml->writeElement('MndtId', $transaction->getMandateId()); $xml->writeElement('DtOfSgntr', $transaction->getMandateDate()); - if ($transaction->hasMandateChanged()) // Aenderung an Mandat + if ($transaction->hasMandateChanged()) // Mandate changed { $xml->writeElement('AmdmntInd', 'true'); $xml->startElement('AmdmntInfDtls'); @@ -577,7 +582,7 @@ private function generateTransaction(Transaction $transaction, \XMLWriter $xml) } /** - * convert string into epc conform + * Convert string into epc conform * * @param string $string * @param int $maxlen @@ -585,7 +590,7 @@ private function generateTransaction(Transaction $transaction, \XMLWriter $xml) */ private function formatString(string $string, int $maxlen = 0) : string { - // EPC 2009 erlaubt: + // EPC 2009 allowed: // [A-Za-z0-9\+\?\/\-:\(\)\.,' ] $map = [ 'Ä' => 'Ae', 'À' => 'A', 'Á' => 'A', 'Â' => 'A', 'Ã' => 'A', 'Å' => 'A', 'Ă' => 'A', 'Æ' => 'A', @@ -614,7 +619,7 @@ private function formatString(string $string, int $maxlen = 0) : string } /** - * format amount + * Format amount * * @param int $amount * @return string