linkNewUpiAccountWithUI method
void
linkNewUpiAccountWithUI({})
Implementation
void linkNewUpiAccountWithUI({required String? customerMobile, required String? color , required OnSuccess<List<UpiAccount>> onSuccess,
required OnFailure<Error> onFailure} ) async {
try {
if(!_isTurboPluginAvailable){
_emitFailure(onFailure);
return;
}
var requestLinkNewUpiAccountWithUI = <String, dynamic>{
"customerMobile": customerMobile,
"color": color
};
final Map<dynamic, dynamic> getLinkedUpiAccountsResponse = await _channel.invokeMethod('linkNewUpiAccountWithUI', requestLinkNewUpiAccountWithUI);
if(getLinkedUpiAccountsResponse["data"]!=""){
onSuccess(_getUpiAccounts(getLinkedUpiAccountsResponse["data"]));
}else {
onFailure(Error(errorCode:"NO_ACCOUNT_FOUND" , errorDescription: "No Account Found"));
}
} on PlatformException catch (error) {
onFailure(Error(errorCode:error.code , errorDescription: error.message!));
}
}