onNextJob method

dynamic onNextJob(
  1. NextJob data
)

Implementation

onNextJob(NextJob data) async {
  // BootpayPrint("onNextJob: ${data.toJson()}");

  if(data.initToken) {
    setPasswordToken("");
    widget.payload?.token = "";
  } else if(data.token.isNotEmpty) {
    setPasswordToken(data.token.replaceAll("\"", ""));
    widget.payload?.token = data.token;
  }

  if(data.biometricDeviceUuid.isNotEmpty && data.biometricSecretKey.isNotEmpty) {
    final prefs = await SharedPreferences.getInstance();
    prefs.setString("biometric_device_uuid", data.biometricDeviceUuid);
    prefs.setString("biometric_secret_key", data.biometricSecretKey);
    prefs.setInt("server_unixtime", data.serverUnixtime);
  }

  if(data.nextType == BioConstants.NEXT_JOB_RETRY_PAY) {
    startPayWithSelectedCard();
  } else if(data.nextType == BioConstants.NEXT_JOB_ADD_NEW_CARD) {
    addNewCard();
  } else if(data.nextType == BioConstants.NEXT_JOB_ADD_DELETE_CARD) {
    requestDeleteCard();
  } else if(data.nextType == BioConstants.REQUEST_PASSWORD_FOR_PAY) {
    requestPasswordForPay();
  } else if(data.nextType == BioConstants.REQUEST_DELETE_CARD) {
    requestDeleteCard(); //토큰 받아왔으니 재시도
  } else if(data.nextType == BioConstants.NEXT_JOB_GET_WALLET_LIST) {
    if(data.type == BioConstants.REQUEST_ADD_BIOMETRIC_FOR_PAY) {
      getWalletList(true);
    } else {
      getWalletList(false);
    }
  }
  // else if()
}