adorsys / xs2a

Open Source NextGenPSD2 XS2A Implementation from adorsys.
https://adorsys.com/en/products/
GNU Affero General Public License v3.0
130 stars 62 forks source link

aspspId not passed down to AccountSpi #70

Closed yves-bussard closed 4 years ago

yves-bussard commented 4 years ago

Place where bug appeared

Current behavior

Expected behavior

Steps to reproduce

When the TPP calls the resource /v1/accounts/{account-id} then we end up in AccountSpiImpl.requestAccountDetailForAccount(). The argument SpiAccountReference is created in the mapper Xs2aToSpiAccountReferenceMapper and then passed along to the method AccountSpiImpl.requestAccountDetailForAccount(). Unfortunately, the mapper creates the SpiAccountReference using the constructor WITHOUT the aspspId argument. Therefore this field is never set.

SCA approach

XS2A version(s):

Log files or other additional info

My understanding of the documentation is that the TPP never knows about the aspspId and the banking backend never knows about the resourceId. Therefore it should be the XS2A Server which maps a resourceId to an aspspId and the other way around. Since the framework does not pass along the aspspId from the AccountReference to the SpiAccountReference how can I get to the aspspId in the AccountSpiImpl? And if it is not supposed to be set in the SpiAccountReference, why is there even this field?

The only way I can make this work now is to set the resourceId and aspspId to the same value (the id from the backend) and use whatever field is not null. But that's probably not the idea.

BTW in the example connectors I saw that you call the ledger using the resourceId. Shouldn't you call the ledger (the banking backend) with the aspspId?

yves-bussard commented 4 years ago

The link to the connector example. AccountSpiImpl calls the ledger with the resourceId: https://github.com/adorsys/xs2a-connector-examples/blob/develop/xs2a-connector/src/main/java/de/adorsys/aspsp/xs2a/connector/spi/impl/AccountSpiImpl.java

ViraHavrylenko commented 4 years ago

@yves-bussard Thanks for your comment. Bug will be fixed in v.7.5

ViraHavrylenko commented 4 years ago

Fixed in v.7.5 (17.06.2020)