getLinkedUpiAccounts method

void getLinkedUpiAccounts({
  1. required String? customerMobile,
  2. required OnSuccess<List<UpiAccount>> onSuccess,
  3. required OnFailure<Error> onFailure,
})

Implementation

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