nordigen / nordigen-php

MIT License
40 stars 17 forks source link

Improve documentation on redirectUri #11

Closed metelidrissi closed 1 year ago

metelidrissi commented 2 years ago

Hello,

I'm not sure of what redirectUri i have to write, if it's the uri of the Institution_id, where i have to get it?

Also when i'm trying that i get response of 0 accounts.

        $institutionId = "BBVA_BBVAESMM";
         $redirectUri = "https://www.bbva.com";

        // Initialize new bank connection session
        $session = $client->initSession($institutionId, $redirectUri);

        // Get link to authorize in the bank
        // Authorize with your bank via this link, to gain access to account data
        $link = $session["link"];

        // requisition id is needed to get accountId in the next step
        $requisitionId = $session["requisition_id"];

        // Get account id after completed authorization with a bank
        $requisitionData = $client->requisition->getRequisition($requisitionId);

        var_dump($requisitionData); die();

I can see the data response, but it shows ["accounts"]=> array(0) { }, maybe something wrong?

Thanks

victory-sokolov commented 2 years ago

Hi!

redirectUri - is the url where user will be redirected after completing authorization with institution.

Regarding getting respond of 0 accounts, it means that you didn't authorized with an institution, at this line $link = $session["link"] - you are getting authorization link and you need to go throughout that process and only after that you can retrieve your accounts data. Please take a look at example directory