walle89 / SwedbankJson

Unofficial API client for the Swedbank's and Sparbankerna's mobile apps in Sweden.
MIT License
75 stars 14 forks source link

Upgrade to Swedbank version 5 API #32

Closed walle89 closed 3 years ago

walle89 commented 7 years ago

I have started to implement version 5 of the Swedbank API.

Even though I have known of the version 5 existences quite some time now, I have not bothered to implement it because it previously only have been in use one the beta version of the new web internet bank portal. My impression, at the time, it was still work in progress. But now that Swedbank have released the new mobile apps and the new bank portal, I think it's now time to begin migrate to the new API version. In fact, I think I'm almost done with the migration. I still need to verify that everything still works.

But while I tested the code, I discovered Swedbank's new transactions API brakes the backward compatibility to version 4. They have introduced a new (and improved) way to do transactions and payments. But this means that current way of using transactions APIs in SwedbankJson will not work in the next release of SwedbankJson with the version 5 API. Therefore I have diced that SwedbankJson with version 5 API will be released as a new major version, wich means that SwedbankJson will probably finally go version 1.0.0! Even though I think it still missing a handful major features/APIs before I would consider a 1.0.0 resale, I don't see any realistic way to solve the compatibility issue. Anyhow, not an mayor issue.

Another problem is that Swedbank have not yet updated there youth and corporate apps with the new API:s. Because I don't have the means to test either Swedbank and Sparbanken variants, I can't verify if the new API works for this type of users. Until I can make sure youth and corporate users can use the new API, I will not resale version 5 API update to avoid confutation wich version of SwedbankJson will work for what type of customer. And also avoid version conflicts.

Anyhow, besides the issues I looking forward what new opportunities the new API will give. For one thing, both the mobile apps and the web portal uses the same API. This means that, at least in theory, there will be no need for a web proxy software to debug and to figure out how the API works. Now it's possible to do it right in the browser. Hopefully this till make easier to contribute to this project (if someone is interested to send a pull request).

Please free to ask any question or leave feedback.

miclovich commented 7 years ago

This may be a totally new question. What's the API link for the official documentations? My "Google-fu" is not on point lately.

I'd like to integrate a way to retrieve bank accounts attached to a personummer (with verification through BankID). Thank you.

walle89 commented 7 years ago

The official documentation from Swedbank is not available to the public. To be honest, I don't even know if it even exists.

I had to reverse engineer the API and wrote some documentation what I think how the API works. You can find that documentation in the docs/.

About your request, you can totally do that with my library. Just read the readme file and follow the installation guide. If you are not into PHP, you can at least see my source code and see how I send requests to the Swedbank API.

If you have any questions, please read the support & feedback instructions before you create a new Github issue.

miclovich commented 7 years ago

:-( thanks @walle89 I've been reading your code cover to cover. Great job with it. Surprising version updates can be bad for production.

I can't wait for the EU psd2 regulation, maybe most of the banks will have some API publicly available for us normal humans to read.

walle89 commented 7 years ago

In my experience, Swedbank has been really good at keeping the old API working. One of my projects still is using version 3 with iOS 8.3 as user-agent without any issues so far. But as you say, this can change at anytime. Hope new regulations will change that. :)

NisseDILLIGAF commented 3 years ago

Hi Is it just me or has something changed with Swedbanks API? I use quickbalance every day, and some days ago it stopped working with this message

SERVICE_UNAVAILABLE - För närvarande är Mobil- och iPad-apparna otillgängliga. Vänligen försök igen senare. in /var/www/html/swebank/vendor/walle89/swedbank-json/src/Auth/AbstractAuth.php:305\n

I had to change to v5 API and instead of https://unauth.api.swedb.... I used https://auth.api.swedbank.se/TDE_DAP_Portal_REST_WEB/api/ for Quickbalance

I haven't tested anything else, I only use this and now its working. I would think that this change breaks some other API paths?

walle89 commented 3 years ago

Yes, version 5 of the API do some things differently and last time I checked it isn't compatible with version 4. I need to spend some time to test, add fixes and write the documentation for version 5.

walle89 commented 3 years ago

Version 1.0.0 is out with API version 5!

Note

  1. Some endpoints and methods have changed. For more info, read the change log.
  2. Even if you are using same methods or endpoints, the response may differ for version 5 compared to version 4. Please test your code and adjust your code.

If you have any issues, reply to this issue or create a new one.