Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ufozone/php-sepa
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.3
Choose a base ref
...
head repository: ufozone/php-sepa
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 7 commits
  • 36 files changed
  • 1 contributor

Commits on Aug 25, 2024

  1. Fix Exceptions

    ufozone committed Aug 25, 2024
    Copy the full SHA
    e6913dc View commit details
  2. Fix examples

    ufozone committed Aug 25, 2024
    Copy the full SHA
    0ce5864 View commit details
  3. Fix derivation of exceptions

    ufozone committed Aug 25, 2024
    Copy the full SHA
    4bf9749 View commit details
  4. Copy the full SHA
    4a413ac View commit details
  5. Fix PHPUnit tests

    ufozone committed Aug 25, 2024
    Copy the full SHA
    619d464 View commit details
  6. Remove old subversion relicts

    ufozone committed Aug 25, 2024
    Copy the full SHA
    f870c8b View commit details
  7. Fix typos

    ufozone committed Aug 25, 2024
    Copy the full SHA
    49fe267 View commit details
Showing with 133 additions and 147 deletions.
  1. +11 −11 README.md
  2. +7 −7 examples/credit.php
  3. +6 −6 examples/debit.php
  4. +7 −7 examples/exception.php
  5. +18 −18 tests/SepaTest.php
  6. +1 −1 vendor/autoload.php
  7. +4 −5 vendor/lib/Sepa.php
  8. +3 −4 vendor/lib/Sepa/CreditTransfer.php
  9. +3 −4 vendor/lib/Sepa/DirectDebit.php
  10. +1 −2 vendor/lib/Sepa/Exception.php
  11. +3 −4 vendor/lib/Sepa/Payment.php
  12. +2 −3 vendor/lib/Sepa/Payment/Exception.php
  13. +3 −4 vendor/lib/Sepa/Transaction.php
  14. +2 −3 vendor/lib/Sepa/Transaction/Exception.php
  15. +1 −2 vendor/lib/Sepa/Validator.php
  16. +2 −3 vendor/lib/Sepa/Validator/Amount.php
  17. +2 −3 vendor/lib/Sepa/Validator/Bic.php
  18. +1 −2 vendor/lib/Sepa/Validator/Checksum.php
  19. +2 −3 vendor/lib/Sepa/Validator/CreditorBusinessCode.php
  20. +2 −3 vendor/lib/Sepa/Validator/CreditorId.php
  21. +2 −3 vendor/lib/Sepa/Validator/Currency.php
  22. +2 −3 vendor/lib/Sepa/Validator/Date.php
  23. +2 −3 vendor/lib/Sepa/Validator/DateTime.php
  24. +16 −0 vendor/lib/Sepa/Validator/Exception.php
  25. +4 −5 vendor/lib/Sepa/Validator/Factory.php
  26. +2 −3 vendor/lib/Sepa/Validator/Iban.php
  27. +2 −3 vendor/lib/Sepa/Validator/Id1.php
  28. +2 −3 vendor/lib/Sepa/Validator/Id2.php
  29. +2 −3 vendor/lib/Sepa/Validator/Mock.php
  30. +2 −3 vendor/lib/Sepa/Validator/Priority.php
  31. +2 −3 vendor/lib/Sepa/Validator/Purpose.php
  32. +2 −3 vendor/lib/Sepa/Validator/Scope.php
  33. +2 −3 vendor/lib/Sepa/Validator/Sequence.php
  34. +2 −3 vendor/lib/Sepa/Validator/StringV.php
  35. +3 −5 vendor/lib/Sepa/Xml.php
  36. +5 −6 vendor/lib/Sepa/Xml/Exception.php
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -14,21 +14,21 @@ License: BSD 2-Clause License
## Example of using SEPA Credit Transfer

```php
$validatorFactory = new \MG\Sepa\Validator\Factory();
$validatorFactory = new \ufozone\phpsepa\Sepa\Validator\Factory();

$sepa = new \MG\Sepa\CreditTransfer($validatorFactory);
$sepa = new \ufozone\phpsepa\Sepa\CreditTransfer($validatorFactory);
$sepa->setInitiator('Max Mustermann'); // Einreicher
//$sepa->setId($msgId); // Nachrichtenreferenz

$payment = new \MG\Sepa\Payment($validatorFactory);
$payment = new \ufozone\phpsepa\Sepa\Payment($validatorFactory);
$payment->setPriority('HIGH'); // Prioritaet NORM oder HIGH
//$payment->setScope('INST'); // Echtzeitueberweisung
$payment->setAccount('Max Mustermann', 'DE02370501980001802057', 'COLSDE33'); // Auftraggaber
//$payment->setAccountCurrency($currency); // Kontowaehrung
//$payment->disableBatchBooking(); // deaktiviere Sammelbuchung
//$payment->setDate($date); // Faelligkeitsdatum

$transaction = new \MG\Sepa\Transaction($validatorFactory);
$transaction = new \ufozone\phpsepa\Sepa\Transaction($validatorFactory);
$transaction->setEndToEndId('R2017742-1') // Transaktions-ID (End-to-End)
->setName('Karl Kümmel') // Name des Zahlungspflichtigen
->setIban('DE02300209000106531065') // IBAN des Zahlungspflichtigen
@@ -38,7 +38,7 @@ $transaction->setEndToEndId('R2017742-1') // Transaktions-ID (End-to-End)
->setReference('Rechnung R2017742 vom 17.06.2017'); // Verwendungszweck (eine Zeile, max. 140 Zeichen))
$payment->addTransaction($transaction);

$transaction = new \MG\Sepa\Transaction($validatorFactory);
$transaction = new \ufozone\phpsepa\Sepa\Transaction($validatorFactory);
$transaction->setEndToEndId('R2017742-1')
->setName('Doris Dose')
->setIban('DE02500105170137075030')
@@ -49,28 +49,28 @@ $payment->addTransaction($transaction);

$sepa->addPayment($payment);

$xml = new \MG\Sepa\Xml($sepa);
$xml = new \ufozone\phpsepa\Sepa\Xml($sepa);
$xml->download('sepa.xml');
```

## Example of using SEPA Direct Debit

```php
$validatorFactory = new \MG\Sepa\Validator\Factory();
$validatorFactory = new \ufozone\phpsepa\Sepa\Validator\Factory();

$sepa = new \MG\Sepa\DirectDebit($validatorFactory);
$sepa = new \ufozone\phpsepa\Sepa\DirectDebit($validatorFactory);
$sepa->setInitiator('Max Mustermann'); // Einreicher
//$sepa->setId($msgId); // Nachrichtenreferenz

$payment = new \MG\Sepa\Payment($validatorFactory);
$payment = new \ufozone\phpsepa\Sepa\Payment($validatorFactory);
//$payment->setScope('CORE'); // Lastschriftart (CORE oder B2B)
$payment->setAccount('Max Mustermann', 'DE02370501980001802057', 'COLSDE33'); // Auftraggaber
//$payment->setAccountCurrency($currency); // Kontowaehrung
$payment->setCreditorId('DE98ZZZ09999999999'); // Glaeubigeridentifikationsnummer
//$payment->disableBatchBooking(); // deaktiviere Sammelbuchung
//$payment->setDate($date); // Gewuenschter Ausfuehrungstermin

$transaction = new \MG\Sepa\Transaction($validatorFactory);
$transaction = new \ufozone\phpsepa\Sepa\Transaction($validatorFactory);
$transaction->setEndToEndId('R2017742-1') // Transaktions-ID (End-to-End)
->setName('Karl Kümmel') // Name des Zahlungspflichtigen
->setIban('DE02300209000106531065') // IBAN des Zahlungspflichtigen
@@ -84,7 +84,7 @@ $payment->addTransaction($transaction);

$sepa->addPayment($payment);

$xml = new \MG\Sepa\Xml($sepa);
$xml = new \ufozone\phpsepa\Sepa\Xml($sepa);
$xml->download('sepa.xml');
```

14 changes: 7 additions & 7 deletions examples/credit.php
Original file line number Diff line number Diff line change
@@ -4,20 +4,20 @@

try
{
$validatorFactory = new \MG\Sepa\Validator\Factory();
$validatorFactory = new \ufozone\phpsepa\Sepa\Validator\Factory();

$sepa = new \MG\Sepa\CreditTransfer($validatorFactory);
$sepa = new \ufozone\phpsepa\Sepa\CreditTransfer($validatorFactory);
$sepa->setInitiator('Max Mustermann'); // Einreicher
//$sepa->setId($msgId); // Nachrichtenreferenz

$payment = new \MG\Sepa\Payment($validatorFactory);
$payment = new \ufozone\phpsepa\Sepa\Payment($validatorFactory);
$payment->setPriority('HIGH'); // Prioritaet NORM oder HIGH
$payment->setAccount('Max Mustermann', 'DE02370501980001802057', 'COLSDE33'); // Auftraggaber
//$payment->setAccountCurrency($currency); // Kontowaehrung
//$payment->disableBatchBooking(); // deaktiviere Sammelbuchung
//$payment->setDate($date); // Faelligkeitsdatum

$transaction = new \MG\Sepa\Transaction($validatorFactory);
$transaction = new \ufozone\phpsepa\Sepa\Transaction($validatorFactory);
$transaction->setEndToEndId('R2017742-1') // Transaktions-ID (End-to-End)
->setName('Karl Kümmel') // Name des Zahlungspflichtigen
->setIban('DE02300209000106531065') // IBAN des Zahlungspflichtigen
@@ -27,7 +27,7 @@
->setReference('Rechnung R2017742 vom 17.06.2017'); // Verwendungszweck (eine Zeile, max. 140 Zeichen))
$payment->addTransaction($transaction);

$transaction = new \MG\Sepa\Transaction($validatorFactory);
$transaction = new \ufozone\phpsepa\Sepa\Transaction($validatorFactory);
$transaction->setEndToEndId('R2017742-1')
->setName('Doris Dose')
->setIban('DE02500105170137075030')
@@ -42,10 +42,10 @@
header("Content-Disposition: attachment; filename=\"sepa.xml\"");
header("Pragma: no-cache");

$xml = new \MG\Sepa\Xml($sepa);
$xml = new \ufozone\phpsepa\Sepa\Xml($sepa);
echo $xml->get();
}
catch (\MG\Exception $e)
catch (Exception $e)
{
print_r($e);
exit;
12 changes: 6 additions & 6 deletions examples/debit.php
Original file line number Diff line number Diff line change
@@ -4,21 +4,21 @@

try
{
$validatorFactory = new \MG\Sepa\Validator\Factory();
$validatorFactory = new \ufozone\phpsepa\Sepa\Validator\Factory();

$sepa = new \MG\Sepa\DirectDebit($validatorFactory);
$sepa = new \ufozone\phpsepa\Sepa\DirectDebit($validatorFactory);
$sepa->setInitiator('Max Mustermann'); // Einreicher
//$sepa->setId($msgId); // Nachrichtenreferenz

$payment = new \MG\Sepa\Payment($validatorFactory);
$payment = new \ufozone\phpsepa\Sepa\Payment($validatorFactory);
//$payment->setScope('CORE'); // Lastschriftart (CORE oder B2B)
$payment->setAccount('Max Mustermann', 'DE02370501980001802057', 'COLSDE33'); // Auftraggaber
//$payment->setAccountCurrency($currency); // Kontowaehrung
$payment->setCreditorId('DE98ZZZ09999999999'); // Glaeubigeridentifikationsnummer
//$payment->disableBatchBooking(); // deaktiviere Sammelbuchung
//$payment->setDate($date); // Gewuenschter Ausfuehrungstermin

$transaction = new \MG\Sepa\Transaction($validatorFactory);
$transaction = new \ufozone\phpsepa\Sepa\Transaction($validatorFactory);
$transaction->setEndToEndId('R2017742-1') // Transaktions-ID (End-to-End)
->setName('Karl Kümmel') // Name des Zahlungspflichtigen
->setIban('DE02300209000106531065') // IBAN des Zahlungspflichtigen
@@ -36,10 +36,10 @@
header("Content-Disposition: attachment; filename=\"sepa.xml\"");
header("Pragma: no-cache");

$xml = new \MG\Sepa\Xml($sepa);
$xml = new \ufozone\phpsepa\Sepa\Xml($sepa);
echo $xml->get();
}
catch (\MG\Exception $e)
catch (Exception $e)
{
print_r($e);
exit;
14 changes: 7 additions & 7 deletions examples/exception.php
Original file line number Diff line number Diff line change
@@ -3,20 +3,20 @@

try
{
$validatorFactory = new \MG\Sepa\Validator\Factory();
$sepa = new \MG\Sepa\CreditTransfer($validatorFactory);
$payment = new \MG\Sepa\Payment($validatorFactory);
$transaction = new \MG\Sepa\Transaction($validatorFactory);
$validatorFactory = new \ufozone\phpsepa\Sepa\Validator\Factory();
$sepa = new \ufozone\phpsepa\Sepa\CreditTransfer($validatorFactory);
$payment = new \ufozone\phpsepa\Sepa\Payment($validatorFactory);
$transaction = new \ufozone\phpsepa\Sepa\Transaction($validatorFactory);
}
catch (\MG\Sepa\Payment\Exception $e)
catch (\ufozone\phpsepa\Sepa\Payment\Exception $e)
{
// Payment-Fehler
}
catch (\MG\Sepa\Transaction\Exception $e)
catch (\ufozone\phpsepa\Sepa\Transaction\Exception $e)
{
// Transaction-Fehler
}
catch (\MG\Exception $e)
catch (\ufozone\phpsepa\Sepa\Exception $e)
{
// Sonstiger Fehler
}
36 changes: 18 additions & 18 deletions tests/SepaTest.php
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ public function testSepaObject()
{
$exception = true;
}
$this->assertTrue($exception);
$this->assertTrue(!$exception);
}

public function testValidateXmlFile()
@@ -61,29 +61,29 @@ private function getSepaObject($validatorFactoryMock = false)
}
else
{
$validatorFactory = new \MG\Sepa\Validator\Factory();
$validatorFactory = new \ufozone\phpsepa\Sepa\Validator\Factory();
}
$sepa = new \MG\Sepa\CreditTransfer($validatorFactory);
$sepa->setInitiator("Markus Görnhardt");
$sepa = new \ufozone\phpsepa\Sepa\CreditTransfer($validatorFactory);
$sepa->setInitiator('Max Mustermann');

$payment = new \MG\Sepa\Payment($validatorFactory);
$payment->setAccount("Markus Görnhardt", "DE89840500001565003795", "HELADEF1RRS");
$payment = new \ufozone\phpsepa\Sepa\Payment($validatorFactory);
$payment->setAccount('Max Mustermann', 'DE02370501980001802057', 'COLSDE33');

// first transaction
$transaction = new \MG\Sepa\Transaction($validatorFactory);
$transaction->setName("Karl Kümmel")
->setIban("DE87200500001234567890")
->setBic("BANKDEZZXXX")
$transaction = new \ufozone\phpsepa\Sepa\Transaction($validatorFactory);
$transaction->setName('Karl Kümmel')
->setIban('DE02300209000106531065')
->setBic('CMCIDEDD')
->setAmount(123.45)
->setReference("Rechnung R2017742 vom 17.06.2017");
->setReference('Rechnung R2017742 vom 17.06.2017');
$payment->addTransaction($transaction);

// second transaction
$transaction = new \MG\Sepa\Transaction($validatorFactory);
$transaction->setName("Doris Dose")
->setIban("DE87200500001234567890")
$transaction = new \ufozone\phpsepa\Sepa\Transaction($validatorFactory);
$transaction->setName('Doris Dose')
->setIban('DE02500105170137075030')
->setAmount(234.56)
->setReference("Kinderfahrrad");
->setReference('Kinderfahrrad');
$payment->addTransaction($transaction);

$sepa->addPayment($payment);
@@ -93,7 +93,7 @@ private function getSepaObject($validatorFactoryMock = false)

private function getSepaXmlObject($sepa)
{
$xml = new \MG\Sepa\Xml($sepa);
$xml = new \ufozone\phpsepa\Sepa\Xml($sepa);

return $xml;
}
@@ -102,9 +102,9 @@ private function getValidatorFactoryMock()
{
return new class
{
public function getValidator(string $type) : \MG\Sepa\Validator
public function getValidator(string $type) : \ufozone\phpsepa\Sepa\Validator
{
return new \MG\Sepa\Validator\Mock();
return new \ufozone\phpsepa\Sepa\Validator\Mock();
}
};
}
2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
spl_autoload_register(function ($class)
{
// project-specific namespace prefix
$prefix = 'MG\\';
$prefix = 'ufozone\\phpsepa\\';

// does the class use the namespace prefix?
$len = strlen($prefix);
9 changes: 4 additions & 5 deletions vendor/lib/Sepa.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<?php
// $Id: Sepa.php 8745 2024-03-28 17:08:31Z markus $
declare(strict_types=1);

namespace MG;
namespace ufozone\phpsepa;

use \MG\Sepa\Exception as SepaException;
use \MG\Sepa\Payment;
use \MG\Sepa\Validator\Factory as ValidatorFactory;
use \ufozone\phpsepa\Sepa\Exception as SepaException;
use \ufozone\phpsepa\Sepa\Payment;
use \ufozone\phpsepa\Sepa\Validator\Factory as ValidatorFactory;

/**
* SEPA
7 changes: 3 additions & 4 deletions vendor/lib/Sepa/CreditTransfer.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?php
// $Id: CreditTransfer.php 8745 2024-03-28 17:08:31Z markus $
declare(strict_types=1);

namespace MG\Sepa;
namespace ufozone\phpsepa\Sepa;

use MG\Sepa;
use \MG\Sepa\Validator\Factory as ValidatorFactory;
use \ufozone\phpsepa\Sepa;
use \ufozone\phpsepa\Sepa\Validator\Factory as ValidatorFactory;

/**
* Credit Transfer
7 changes: 3 additions & 4 deletions vendor/lib/Sepa/DirectDebit.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?php
// $Id: DirectDebit.php 8745 2024-03-28 17:08:31Z markus $
declare(strict_types=1);

namespace MG\Sepa;
namespace ufozone\phpsepa\Sepa;

use MG\Sepa;
use \MG\Sepa\Validator\Factory as ValidatorFactory;
use \ufozone\phpsepa\Sepa;
use \ufozone\phpsepa\Sepa\Validator\Factory as ValidatorFactory;

/**
* Direct Debit
3 changes: 1 addition & 2 deletions vendor/lib/Sepa/Exception.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?php
// $Id: Exception.php 8747 2024-03-28 17:20:05Z markus $
declare(strict_types=1);

namespace MG\Sepa;
namespace ufozone\phpsepa\Sepa;

/**
* Extension of base exception to define SEPA related errors
7 changes: 3 additions & 4 deletions vendor/lib/Sepa/Payment.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?php
// $Id: Payment.php 8745 2024-03-28 17:08:31Z markus $
declare(strict_types=1);

namespace MG\Sepa;
namespace ufozone\phpsepa\Sepa;

use \MG\Sepa\Payment\Exception as PaymentException;
use \MG\Sepa\Validator\Factory as ValidatorFactory;
use \ufozone\phpsepa\Sepa\Payment\Exception as PaymentException;
use \ufozone\phpsepa\Sepa\Validator\Factory as ValidatorFactory;

/**
* Payment Class
5 changes: 2 additions & 3 deletions vendor/lib/Sepa/Payment/Exception.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?php
// $Id: Exception.php 7657 2019-04-12 21:26:58Z markus $
declare(strict_types=1);

namespace MG\Sepa\Payment;
namespace ufozone\phpsepa\Sepa\Payment;

/**
* Extension of base exception to define payment related errors
@@ -11,7 +10,7 @@
* @since 2017-06-13
* @uses \Exception
*/
class Exception extends \MG\Exception
class Exception extends \ufozone\phpsepa\Sepa\Exception
{
const PAYMENT_INFORMATION_ID_EMPTY = 2101;
const PAYMENT_INFORMATION_ID_INVALID = 2102;
7 changes: 3 additions & 4 deletions vendor/lib/Sepa/Transaction.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?php
// $Id: Transaction.php 8745 2024-03-28 17:08:31Z markus $
declare(strict_types=1);

namespace MG\Sepa;
namespace ufozone\phpsepa\Sepa;

use \MG\Sepa\Transaction\Exception as TransactionException;
use \MG\Sepa\Validator\Factory as ValidatorFactory;
use \ufozone\phpsepa\Sepa\Transaction\Exception as TransactionException;
use \ufozone\phpsepa\Sepa\Validator\Factory as ValidatorFactory;

/**
* Transaction Class
5 changes: 2 additions & 3 deletions vendor/lib/Sepa/Transaction/Exception.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?php
// $Id: Exception.php 7657 2019-04-12 21:26:58Z markus $
declare(strict_types=1);

namespace MG\Sepa\Transaction;
namespace ufozone\phpsepa\Sepa\Transaction;

/**
* Extension of base exception to define transaction related errors
@@ -11,7 +10,7 @@
* @since 2017-06-13
* @uses \Exception
*/
class Exception extends \MG\Exception
class Exception extends \ufozone\phpsepa\Sepa\Exception
{
const INSTRUCTION_ID_EMPTY = 3101;
const INSTRUCTION_ID_INVALID = 3102;
Loading