diff --git a/lib/ui/company_gateway/edit/company_gateway_edit_vm.dart b/lib/ui/company_gateway/edit/company_gateway_edit_vm.dart index 49360f48a..c941a6e56 100644 --- a/lib/ui/company_gateway/edit/company_gateway_edit_vm.dart +++ b/lib/ui/company_gateway/edit/company_gateway_edit_vm.dart @@ -4,11 +4,13 @@ import 'package:flutter/material.dart'; import 'package:flutter_redux/flutter_redux.dart'; import 'package:flutter_styled_toast/flutter_styled_toast.dart'; import 'package:invoiceninja_flutter/constants.dart'; +import 'package:invoiceninja_flutter/data/web_client.dart'; import 'package:invoiceninja_flutter/main_app.dart'; import 'package:invoiceninja_flutter/redux/app/app_actions.dart'; import 'package:invoiceninja_flutter/redux/ui/ui_actions.dart'; import 'package:invoiceninja_flutter/utils/completers.dart'; import 'package:invoiceninja_flutter/utils/app_context.dart'; +import 'package:invoiceninja_flutter/utils/dialogs.dart'; import 'package:redux/redux.dart'; import 'package:invoiceninja_flutter/data/models/models.dart'; import 'package:invoiceninja_flutter/ui/app/dialogs/error_dialog.dart'; @@ -110,8 +112,17 @@ class CompanyGatewayEditVM { }); }); }, - onStripeConnectPressed: () { - // + onStripeConnectPressed: () async { + final webClient = WebClient(); + final credentials = state.credentials; + final url = '${credentials.url}/one_time_token'; + + webClient.post(url, credentials.token).then((dynamic response) { + print('## RESPONSE: $response'); + }).catchError((dynamic error) { + showErrorDialog( + context: navigatorKey.currentContext, message: '$error'); + }); }); }