Skip to content

Commit

Permalink
Changed namespace to match package
Browse files Browse the repository at this point in the history
  • Loading branch information
ufozone committed Aug 25, 2024
1 parent 4bf9749 commit 4a413ac
Show file tree
Hide file tree
Showing 36 changed files with 103 additions and 103 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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')
Expand All @@ -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
Expand All @@ -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');
```

Expand Down
12 changes: 6 additions & 6 deletions examples/credit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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')
Expand All @@ -42,7 +42,7 @@
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 (Exception $e)
Expand Down
10 changes: 5 additions & 5 deletions examples/debit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -36,7 +36,7 @@
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 (Exception $e)
Expand Down
14 changes: 7 additions & 7 deletions examples/exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -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\Sepa\Exception $e)
catch (\ufozone\phpsepa\Sepa\Exception $e)
{
// Sonstiger Fehler
}
16 changes: 8 additions & 8 deletions tests/SepaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@ 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 = new \ufozone\phpsepa\Sepa\CreditTransfer($validatorFactory);
$sepa->setInitiator("Markus Görnhardt");

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

// first transaction
$transaction = new \MG\Sepa\Transaction($validatorFactory);
$transaction = new \ufozone\phpsepa\Sepa\Transaction($validatorFactory);
$transaction->setName("Karl Kümmel")
->setIban("DE87200500001234567890")
->setBic("BANKDEZZXXX")
Expand All @@ -79,7 +79,7 @@ private function getSepaObject($validatorFactoryMock = false)
$payment->addTransaction($transaction);

// second transaction
$transaction = new \MG\Sepa\Transaction($validatorFactory);
$transaction = new \ufozone\phpsepa\Sepa\Transaction($validatorFactory);
$transaction->setName("Doris Dose")
->setIban("DE87200500001234567890")
->setAmount(234.56)
Expand All @@ -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;
}
Expand All @@ -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();
}
};
}
Expand Down
2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions vendor/lib/Sepa.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
// $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
Expand Down
6 changes: 3 additions & 3 deletions vendor/lib/Sepa/CreditTransfer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// $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
Expand Down
6 changes: 3 additions & 3 deletions vendor/lib/Sepa/DirectDebit.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// $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
Expand Down
2 changes: 1 addition & 1 deletion vendor/lib/Sepa/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// $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
Expand Down
6 changes: 3 additions & 3 deletions vendor/lib/Sepa/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// $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
Expand Down
4 changes: 2 additions & 2 deletions vendor/lib/Sepa/Payment/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// $Id: Exception.php 8836 2024-08-25 14:58:41Z markus $
declare(strict_types=1);

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

/**
* Extension of base exception to define payment related errors
Expand All @@ -11,7 +11,7 @@
* @since 2017-06-13
* @uses \Exception
*/
class Exception extends \MG\Sepa\Exception
class Exception extends \ufozone\phpsepa\Sepa\Exception
{
const PAYMENT_INFORMATION_ID_EMPTY = 2101;
const PAYMENT_INFORMATION_ID_INVALID = 2102;
Expand Down
6 changes: 3 additions & 3 deletions vendor/lib/Sepa/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// $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
Expand Down
4 changes: 2 additions & 2 deletions vendor/lib/Sepa/Transaction/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// $Id: Exception.php 8836 2024-08-25 14:58:41Z markus $
declare(strict_types=1);

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

/**
* Extension of base exception to define transaction related errors
Expand All @@ -11,7 +11,7 @@
* @since 2017-06-13
* @uses \Exception
*/
class Exception extends \MG\Sepa\Exception
class Exception extends \ufozone\phpsepa\Sepa\Exception
{
const INSTRUCTION_ID_EMPTY = 3101;
const INSTRUCTION_ID_INVALID = 3102;
Expand Down
2 changes: 1 addition & 1 deletion vendor/lib/Sepa/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// $Id: Validator.php 7657 2019-04-12 21:26:58Z markus $
declare(strict_types=1);

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

/**
* Validator Interface
Expand Down
4 changes: 2 additions & 2 deletions vendor/lib/Sepa/Validator/Amount.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
// $Id: Amount.php 7657 2019-04-12 21:26:58Z markus $
declare(strict_types=1);

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

/**
* Class to validate amount
*
* @author Markus
* @since 2017-06-15
*/
class Amount implements \MG\Sepa\Validator
class Amount implements \ufozone\phpsepa\Sepa\Validator
{
public function isValid($subject) : bool
{
Expand Down
Loading

0 comments on commit 4a413ac

Please sign in to comment.