Code Monkey home page Code Monkey logo

nordigen-php's People

Contributors

aled2305 avatar cihansenturk avatar ekatvars-gc avatar lanort avatar mikolajkaminski avatar pierrebnjl avatar safriks avatar victory-sokolov avatar zhavoronkov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

nordigen-php's Issues

Improve documentation on redirectUri

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

Request to Institution returned an error. CreateTransactionConsent error.

Describe the bug
I was able to link my bank account in Nordigen backend and see its transactions.

I tried to obtain the same result using the Laravel application included in the example folder.
I selected the country and the bank, authenticated with the bank but got the following redirect url with no transactions:

http://localhost:8000/results?ref={some id }&error=Request%20to%20Institution%20returned%20an%20error.%20CreateTransactionConsent%20error.&details={some data}

What am I missing?

To Reproduce
Steps to reproduce the behavior:

  1. Clone the package
  2. cd example
  3. composer update (the composer.lock isn't up to date with the composer.json)
  4. configure the enviromnet variables with ID and KEY created in Nordigen backend
  5. php artisan serve
  6. visit http://localhost:8000 and follow the instructions

Expected behavior
I was expecting to obtain a JSON with the account data

Tokens not being set on the request handler

Describe the bug
Currently this package seems to have the ability to store the access and refresh tokens on both the NordigenClient and RequestHandler classes. The functions on the NordigenClient class only set the tokens for itself and not the RequestHandler making it impossible to switch out the tokens, or load them in from cache to avoid re-authenticating unnecessarily. As the RequestHandler instance is private it is impossible to circumvent this.

To Reproduce
Steps to reproduce the behavior:

  1. Set access (or refresh) token using the functions on the NordigenClient class
  2. Call any request function

Expected behavior
The request is performed successfully

Screenshots
N/A

Additional context
It seems like there was an intention to store the tokens on the NordigenClient itself, but the way this is all setup now that wont work.
I would argue the best solution is to not store the tokens on the NordigenClient, and make the setters and getters proxy to the RequestHandler.

If you're having general trouble with your Nordigen integration or bank related issue, please reach out to our support via email [email protected]

Add Timeout Support to NordigenClient

The NordigenClient library does not currently support setting a timeout for HTTP requests. This can lead to long delays in case of network issues or unresponsive endpoints, affecting the overall performance and user experience of applications using this library.

To Reproduce

  1. Attempt to make an API request, like create access token, to the Nordigen service using NordigenClient while service is down.
  2. Experience a long delay or no response when the service is slow or unresponsive.

Expected behavior
The NordigenClient should support configurable timeout settings for HTTP requests, allowing developers to set a maximum wait time for responses. If the timeout is reached, the request should fail gracefully, allowing the application to handle the error appropriately.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Integrating a timeout setting will improve the robustness and reliability of applications using the Nordigen PHP library by preventing long waits and enabling better error handling. This is particularly important for applications that require high availability and responsiveness.

Nordigen\NordigenPHP\Exceptions\InstitutionExceptions\RateLimitError

Describe the bug
Reaching the bank API rate limits doesn't throw Exceptions\InstitutionExceptions\RateLimitError (but Exceptions\NordigenExceptions\NordigenException)

To Reproduce
Steps to reproduce the behavior:
Reach the rate limit on ->account()->getAccountDetails()
Received a NordigenException exception.

Expected behavior
Expected a RateLimitError exception.

Additional context
Sample code

try {
	$NordigenClient->account($account_id)->getAccountDetails();
	}
catch (Exception $e) {
	echo get_class($e);
	}

Output

Nordigen\NordigenPHP\Exceptions\NordigenExceptions\NordigenException

As far as I can tell, it should be Nordigen\NordigenPHP\Exceptions\InstitutionExceptions\RateLimitError

RequestHandler overwrites Client when access token is set

Describe the bug
When setAccessToken is called on the RequestHandler, it stores the token and instantiates a new Client.

If Client has been configured elsewhere and passed to the NordigenClient, the custom config is lost when this happens.

The RequestHandleTrait should instead pass an Authorization header to each request, if one is present

To Reproduce

$client = new GuzzleHttp\Client();
$nordigen = new Nordigen\NordigenPHP\API\NordigenClient($id, $key, $client);
$nordigen->setAccessToken('stored-token');
// now, $nordigen->requestHandler->httpClient is no longer the $client we passed

Expected behavior
$requestHandler->httpClient should be preserved and have an extra Authorization header passed if accessToken is set.

Additional context
I have a PR ready, I'll submit it shortl.

non-json errors from REST api cause Fatal Errors

Hi,

related to recent servers error and one currently going on https://status.nordigen.com/incidents/w000r4t5mry6.

src/Http/RequestHandlerTrait.php handle BadResponseException which can be Client or Server side error.
In src/Http/RequestHandlerTrait.php#L41 api response is always processed as JSON and passed to getExceptionType which expects array.

 $json = json_decode($content, true);
 $errorType = self::getExceptionType($json);

private static function getExceptionType(array $response)

in case of 502 from load balancer or any other layer not handled by backend django rest framework . it can be NULL because Accept headers are not handled properly. that lead to php errors in sdk and Nordigen API errors are hidden and applications cannot properly handle outages.

Our Sentry is full of php errors instead of nordigen api errors that service return.

Still maintained?

What is the status of this project? Is it still maintained?
Is this project still the official PHP implementation for Nordigen?
Nordigen has been taken over by GoCardLess.
PHP7.4 is very old and GoCardLess has a different project that supports PHP>8.1.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.