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) companyGateway.gatewayId == kGatewayStripeConnect)
AppButton( AppButton(
label: localization.stripeConnect.toUpperCase(), label: localization.stripeConnect.toUpperCase(),
onPressed: () { onPressed: viewModel.state.isSaving
viewModel.onStripeConnectPressed(); ? null
}, : () {
viewModel.onStripeConnectPressed();
},
) )
else else
GatewayConfigSettings( GatewayConfigSettings(

View File

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