Skip to content
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

easy Laravel Implementation possible? #374

Closed
seem2810 opened this issue Jul 7, 2022 · 13 comments
Closed

easy Laravel Implementation possible? #374

seem2810 opened this issue Jul 7, 2022 · 13 comments

Comments

@seem2810
Copy link
Contributor

seem2810 commented Jul 7, 2022

Hi there,

I'm coming over https://github.com/abiturma/laravel-fints to https://github.com/abiturma/php-fints and from this https://github.com/mschindler83/fints-hbci-php to finally this project.

I've got the big problem, that my bank needs a Tan to receive the statements.
However I didn't find a solution.

Maybe some other has a possible migration?
(Gerne auf Englisch oder Deutsch)

use Abiturma\PhpFints\Fints;

class HBCI
{
    public static function init(Bank $bank, $username = null, $pin = null)
    {
        $host = $bank->server;
        $account_number = $bank->account_number;
        $bank_code = $bank->bank_code;

        $fints = Fints::host($host)->username($username)->bankCode($bank_code)->pin($pin);
        dump($fints);
        dump($fints->getAccounts());
        $account = false;
        foreach ($fints->getAccounts() as $ac) {
            if ($ac->account_number == $account_number) $account = $ac;
        }

        if ($account) {
           $statements = $fints->getStatementOfAccount($account, $startDate);
           dd($statements);

@lukas-staab
Copy link
Contributor

lukas-staab commented Jul 7, 2022

Have you had a look into Samples/statementOfAccount.php?
You will need way more User Interaction for TAN Cases than you showed here. Your provided code will only work if there is no tan needed (and I think you also forgot the $fints->login() method, which might need a seperate tan every 30(?) days as well :/ )

I did it like this in another project - in the Samples directory in this project you find some example code as well. You will need different Reqests (which sometimes will and sometimes will not be needed - depending on your bank) - therefore you need the $fints->persist() to reinitiate the $fints object in your (then new) Laravel request.

@seem2810
Copy link
Contributor Author

Thanks. I'll try.

@seem2810
Copy link
Contributor Author

I've implemented your repo and it worked well.
But If i choose pushTAN 2.0 my app ask for confirmation.
After I receive an error:

Protocol
 \ 
UnexpectedResponseException
PHP 8.1.7
9.20.0
Got neither 3956 nor HITAN with tanProzess=2

In:

if ($this->fints->checkDecoupledSubmission($action)) {

                    echo "Bestätigt.<br />";

                }

This validate the request for a few minutes and everything is fine.
But I don't know how to handle this error.

@seem2810
Copy link
Contributor Author

seem2810 commented Aug 8, 2022

any ideas?

@lukas-staab
Copy link
Contributor

I am not sure right now. Seems either like a bank issue or a wrong api call. Maybe @Philipp91 or @nemiah has an idea.

@Philipp91
Copy link
Contributor

This validate the request for a few minutes and everything is fine.

What do you mean by "everything is fine"? That you can receive the bank statements as expected as long as you just ignore that exception?

@Philipp91
Copy link
Contributor

Got neither 3956 nor HITAN with tanProzess=2

Please log the traffic and send us the last response received from the server. That's the one to which the error message refers. Please make sure it doesn't contain any sensitive information before posting it.


The library currently only supports those two aforementioned cases (3956 code to mean "still waiting for the user's confirmation" or HITAN segment to mean "confirmation successful"). But perhaps there are more cases. I suspect that this could be the issue:

Note that we only support the (B) variant here.

Which refers to section B.4.2.2.1 of the specification. So I guess based on the response you post and the further specification sections, we'd have to implement some more functionality to support this bank's login procedure.

@seem2810
Copy link
Contributor Author

This validate the request for a few minutes and everything is fine.

What do you mean by "everything is fine"? That you can receive the bank statements as expected as long as you just ignore that exception?

Yes. I can receive the statements when I ignore the error.

Got neither 3956 nor HITAN with tanProzess=2

Please log the traffic and send us the last response received from the server. That's the one to which the error message refers. Please make sure it doesn't contain any sensitive information before posting it.

The library currently only supports those two aforementioned cases (3956 code to mean "still waiting for the user's confirmation" or HITAN segment to mean "confirmation successful"). But perhaps there are more cases. I suspect that this could be the issue:

Note that we only support the (B) variant here.

Which refers to section B.4.2.2.1 of the specification. So I guess based on the response you post and the further specification sections, we'd have to implement some more functionality to support this bank's login procedure.

I'll check it this week.

@timrasche
Copy link

@Philipp91 @nemiah short information after days of working on this implementation: success in all cases except decoupled authentication request. There is a method called "isProzessvariante2" on TanMode model. This returns true in my case but throw an error on "checkDecoupledSubmission" with message "Got neither 3956 nor HITAN with tanProzess=2". I think thats not a right behaviour. Can you check this?

@Philipp91
Copy link
Contributor

Please log the traffic and send us the last response received from the server. That's the one to which the error message refers. Please make sure it doesn't contain any sensitive information before posting it.

@Handman280
Copy link

any new news about this issue?

@seem2810
Copy link
Contributor Author

seem2810 commented Mar 9, 2023

I can't test it...
My customer has changed his tan mode ..
I think we can close it

any new news about this issue?

@witschko
Copy link

Please log the traffic and send us the last response received from the server. That's the one to which the error message refers. Please make sure it doesn't contain any sensitive information before posting it.

Hi everybody...I've got the same issue "Got neither 3956 nor HITAN with tanProzess=2". The message for the getStatementOfAccount() returns the statements as it seems.

I have attached a log file with the request and a response where you can find "Freigabe erfolgreich" and the positions. But it nevertheless shows this error.
fints.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants