Skip to content

Create Login Action in separate function call #475

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions lib/Fhp/FinTs.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,16 @@ public function setTimeouts(int $connectTimeout, int $responseTimeout)
$this->options->timeoutResponse = $responseTimeout;
}

public function createLoginAction(): DialogInitialization
{
$this->requireTanMode();
$this->ensureSynchronized();
$this->messageNumber = 1;

return new DialogInitialization($this->options, $this->requireCredentials(), $this->getSelectedTanMode(),
$this->selectedTanMedium, $this->kundensystemId);
}

/**
* Executes a strongly authenticated login action and returns it. With some banks, this requires a TAN.
* @return DialogInitialization A {@link BaseAction} for the outcome of the login. You should check whether a TAN is
Expand All @@ -254,12 +264,10 @@ public function setTimeouts(int $connectTimeout, int $responseTimeout)
*/
public function login(): DialogInitialization
{
$this->requireTanMode();
$this->ensureSynchronized();
$this->messageNumber = 1;
$login = new DialogInitialization($this->options, $this->requireCredentials(), $this->getSelectedTanMode(),
$this->selectedTanMedium, $this->kundensystemId);
$login = $this->createLoginAction();

$this->execute($login);

return $login;
}

Expand Down