This commit is contained in:
Hillel Coren 2023-12-27 14:00:37 +02:00
parent 69398d0c29
commit c8f18df96b
1 changed files with 13 additions and 3 deletions

View File

@ -127,12 +127,22 @@ class BankAccountScreen extends StatelessWidget {
webClient
.post(url, credentials.token,
data: jsonEncode({
'context': {'return_url': ''}
'context':
integrationType == BankAccountEntity.INTEGRATION_TYPE_YODLEE
? {'return_url': ''}
: 'nordigen',
}))
.then((dynamic response) {
store.dispatch(StopSaving());
launchUrl(Uri.parse(
'${cleanApiUrl(credentials.url)}/yodlee/onboard/${response['hash']}'));
String connectUrl = cleanApiUrl(credentials.url);
if (integrationType == BankAccountEntity.INTEGRATION_TYPE_YODLEE) {
connectUrl += '/yodlee/onboard/${response['hash']}';
} else {
connectUrl += '/nordigen/connect/${response['hash']}';
}
launchUrl(Uri.parse(connectUrl));
}).catchError((dynamic error) {
store.dispatch(StopSaving());
showErrorDialog(message: '$error');