Stripe connect

This commit is contained in:
Hillel Coren 2021-04-20 18:07:19 +03:00
parent 981536ffba
commit 2aed755724
2 changed files with 9 additions and 3 deletions

View File

@ -134,9 +134,11 @@ class _CompanyGatewayEditState extends State<CompanyGatewayEdit>
companyGateway.gatewayId == kGatewayStripeConnect)
AppButton(
label: localization.stripeConnect.toUpperCase(),
onPressed: () {
viewModel.onStripeConnectPressed();
},
onPressed: viewModel.state.isSaving
? null
: () {
viewModel.onStripeConnectPressed();
},
)
else
GatewayConfigSettings(

View File

@ -118,11 +118,15 @@ class CompanyGatewayEditVM {
final credentials = state.credentials;
final url = '${credentials.url}/one_time_token';
store.dispatch(StartSaving());
webClient.post(url, credentials.token).then((dynamic response) {
store.dispatch(StopSaving());
print('## RESPONSE: $response');
// TODO parse 'hash'
//launch('${credentials.url}/stripe-connect/');
}).catchError((dynamic error) {
store.dispatch(StopSaving());
showErrorDialog(
context: navigatorKey.currentContext, message: '$error');
});