Skip to content

Commit e2e2905

Browse files
authored
Merge pull request #522 from Philipp91/ensuredone
Add missing BaseAction::ensureDone() calls to SEPA transfer samples
2 parents 6914c81 + ae1080c commit e2e2905

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

Samples/directDebit_Sephpa.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,6 @@
4949
if ($sendSEPADirectDebit->needsTan()) {
5050
handleStrongAuthentication($sendSEPADirectDebit); // See login.php for the implementation.
5151
}
52+
53+
// Debit requests don't produce any result we could receive through a getter, but we still need to make sure it's done.
54+
$sendSEPADirectDebit->ensureDone();

Samples/directDebit_phpSepaXml.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,6 @@
6565
if ($sendSEPADirectDebit->needsTan()) {
6666
handleStrongAuthentication($sendSEPADirectDebit); // See login.php for the implementation.
6767
}
68+
69+
// Debit requests don't produce any result we could receive through a getter, but we still need to make sure it's done.
70+
$sendSEPADirectDebit->ensureDone();

Samples/transfer.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@
2121
/** @var \Fhp\FinTs $fints */
2222
$fints = require_once 'login.php';
2323

24+
// Just pick the first account, for demonstration purposes. You could also have the user choose, or have SEPAAccount
25+
// hard-coded and not call getSEPAAccounts() at all.
26+
$getSepaAccounts = \Fhp\Action\GetSEPAAccounts::create();
27+
$fints->execute($getSepaAccounts);
28+
if ($getSepaAccounts->needsTan()) {
29+
handleStrongAuthentication($getSepaAccounts); // See login.php for the implementation.
30+
}
31+
$oneAccount = $getSepaAccounts->getAccounts()[0];
32+
2433
$dt = new \DateTime();
2534
$dt->add(new \DateInterval('P1D'));
2635

@@ -52,3 +61,6 @@
5261
if ($sendSEPATransfer->needsTan()) {
5362
handleStrongAuthentication($sendSEPATransfer); // See login.php for the implementation.
5463
}
64+
65+
// SEPA transfers don't produce any result we could receive through a getter, but we still need to make sure it's done.
66+
$sendSEPATransfer->ensureDone();

0 commit comments

Comments
 (0)