-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update example script to version stable ^2.0 #34
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,8 @@ | |
use AbcAeffchen\SepaUtilities\SepaUtilities; | ||
use AbcAeffchen\Sephpa\SephpaDirectDebit; | ||
|
||
require_once '../src/Sephpa.php'; | ||
chdir(dirname(__DIR__)); | ||
require __DIR__ . '/../vendor/autoload.php'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The vendor folder is not part of the repository. There should be a note, that is requires composer. Additionally a comment with instructions to use this without composer would be nice. This is basically using src/autoloader.php and SepaUtilities.php that needs to be downloaded separately. |
||
|
||
$collectionData = [ | ||
// needed information about the payer | ||
|
@@ -36,11 +37,13 @@ | |
|
||
// generate a SepaCreditTransfer object (pain.001.002.03). | ||
$creditTransferFile = new SephpaCreditTransfer('Initiator Name', 'MessageID-1234', | ||
SephpaCreditTransfer::SEPA_PAIN_001_003_03, | ||
$collectionData); | ||
SephpaCreditTransfer::SEPA_PAIN_001_003_03); | ||
|
||
// generate and add SephpaCreditTransfer* collection object | ||
$creditTransferCollection = $creditTransferFile->addCollection($collectionData); | ||
|
||
// at least one in every CreditTransferCollection | ||
$creditTransferFile->addPayment([ | ||
$creditTransferCollection->addPayment([ | ||
// needed information about the one who gets payed | ||
'pmtId' => 'TransferID-1234-1', // ID of the payment (EndToEndId) | ||
'instdAmt' => 1.14, // amount, | ||
|
@@ -74,13 +77,15 @@ | |
]; | ||
|
||
$directDebitFile = new SephpaDirectDebit('Initiator Name', 'MessageID-1235', | ||
SephpaDirectDebit::SEPA_PAIN_008_003_02, | ||
$collectionData); | ||
SephpaDirectDebit::SEPA_PAIN_008_003_02); | ||
|
||
// at least one in every SEPA file. No limit. | ||
|
||
// generate and add SephpaDirectDebit* collection object | ||
$directDebitCollection = $directDebitFile->addCollection($collectionData); | ||
|
||
// at least one in every DirectDebitCollection. No limit. | ||
$directDebitFile->addPayment([ | ||
$directDebitCollection->addPayment([ | ||
// needed information about the | ||
'pmtId' => 'TransferID-1235-1', // ID of the payment (EndToEndId) | ||
'instdAmt' => 2.34, // amount | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line seems to be unnecessary.