11package com .ibanity .apis ;
22
33import com .ibanity .apis .client .models .Account ;
4- import com .ibanity .apis .client .models .AccountInformationAccessAuthorization ;
54import com .ibanity .apis .client .models .AccountInformationAccessRequest ;
65import com .ibanity .apis .client .models .CustomerAccessToken ;
76import com .ibanity .apis .client .models .FinancialInstitution ;
@@ -80,6 +79,7 @@ public void startFlow(){
8079 accountInformationAccessRequest .setRedirectUri (FAKE_TPP_ACCOUNT_INFORMATION_ACCESS_REDIRECT_URL );
8180 accountInformationAccessRequest .setFinancialInstitution (inUseFinancialInstitution .get ());
8281 AccountInformationAccessRequest resultingAccountInformationAccessRequest = accountsService .getAccountsInformationAccessRedirectUrl (generatedCustomerAccessToken , accountInformationAccessRequest );
82+ resultingAccountInformationAccessRequest .setFinancialInstitution (inUseFinancialInstitution .get ());
8383 LOGGER .info ("AccountInformationAccessRequest:" +resultingAccountInformationAccessRequest .toString ());
8484 LOGGER .warn ("#######################################" );
8585 LOGGER .warn ("Accounts Information Access Request: End-User to be redirected to :\n " +resultingAccountInformationAccessRequest .getLinks ().getRedirect ());
@@ -91,14 +91,6 @@ public void startFlow(){
9191 System .out .println ("Please use the URL provided here above (End-User to be redirected to:...) in order to authorize accounts then, once authorization done, Press ENTER to proceed......" );
9292 s .nextLine ();
9393
94- LOGGER .info ("Start : AccountInformationAccessAuthorization" );
95- AccountInformationAccessAuthorization accountInformationAccessAuthorization = new AccountInformationAccessAuthorization ();
96- AtomicReference <AccountInformationAccessAuthorization > inUseAccountInformationAccessAuthorization = new AtomicReference ();
97- List <AccountInformationAccessAuthorization > accountsAuthorizations = accountsService .getAccountsInformationAccessAuthorizations (generatedCustomerAccessToken , resultingAccountInformationAccessRequest );
98- accountsAuthorizations .stream ().forEach (authorization -> {inUseAccountInformationAccessAuthorization .set (authorization ); LOGGER .info (authorization .toString ());});
99- LOGGER .info ("END : AccountInformationAccessAuthorization" );
100-
101-
10294 AtomicReference <Account > inUseAccount = new AtomicReference ();
10395 LOGGER .info ("Start : get All Accounts" );
10496 List <Account > accounts = accountsService .getCustomerAccounts (generatedCustomerAccessToken );
@@ -138,10 +130,6 @@ public void startFlow(){
138130 transactionsList .stream ().forEach (transaction -> LOGGER .info (transaction .toString ()));
139131 LOGGER .info ("End : Transactions details" );
140132
141- LOGGER .info ("Start : Remove Account Access Authorization" );
142- accountsService .revokeAccountsAccessAuthorization (generatedCustomerAccessToken , inUseFinancialInstitution .get ().getId (), inUseAccountInformationAccessAuthorization .get ());
143- LOGGER .info ("Stop : Remove Account Access Authorization" );
144-
145133 LOGGER .info ("Start : Payment Initiation Request" );
146134 PaymentInitiationRequest paymentInitiationRequest = new PaymentInitiationRequest ();
147135 paymentInitiationRequest .setRedirectUri (FAKE_TPP_PAYMENT_INITIATION_REDIRECT_URL );
0 commit comments