Android Open Source - android_sdk Message Response Code






From Project

Back to project page android_sdk.

License

The source code is released under:

GNU Lesser General Public License

If you think the Android project android_sdk listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * Copyright (C) 2013  Spunk Media Pvt Ltd (www.qubecell.com)
 *///from  w w  w .j  av a  2  s . c o  m

package com.qubecell.constants;

import android.content.Context;

public class MessageResponseCode {
  
  public static final String SUCCESS = "101";
  public static final String AUTHENTICATION_FALIURE = "102";
  public static final String OPERATOR_NOT_SUPPORTED = "103";
  public static final String DUPLICATE_REQUEST_ID = "104";
  public static final String CHARGE_FAILED = "105";
  public static final String UNDETERMINED_ERROR = "106";
  public static final String INVALID_KEY = "107";
  public static final String FALIURE = "108";
  public static final String INVALID_MSISDN = "109";
  public static final String INVALID_PRODUCT_ID = "110";
  
  private static String eventcharge_authentication_faliure = "Sorry, this transaction cannot be processed now. Please try again later.";
  private static String eventcharge_operator_not_found = "Sorry, your mobile operator is not supported as yet.";
  private static String eventcharge_duplicate_req_id = "Sorry, this transaction cannot be processed now. Please try again later.";
  private static String eventcharge_charge_failed ="Sorry, this transaction cannot be processed now. Please try again later.";
  private static String eventcharge_undetermined_error = "Sorry, this transaction cannot be processed now. Please try again later.";
  private static String eventcharge_invalid_key = "Sorry, this transaction cannot be processed now. Please try again later.";
  private static String eventcharge_failed = "Sorry, this transaction cannot be processed now. Please try again later.";
  private static String eventcharge_invalid_msisdn = "Sorry, this transaction cannot be processed now. Please try again later.";
  private static String eventcharge_invalid_productid = "Sorry, this transaction cannot be processed now. Please try again later.";

  /**
   * This method is used to return the server error strings as per given error code.
   * @param appContext
   * @param responseCode
   * @return
   */
  public static String getResponseString(Context appContext, String responseCode)
  {
    String errorString = null;

    if(responseCode.contains(AUTHENTICATION_FALIURE))
    {
      errorString = eventcharge_authentication_faliure;
    }
    else if(responseCode.contains(OPERATOR_NOT_SUPPORTED))
    {
      errorString = eventcharge_operator_not_found;
    }
    else if(responseCode.contains(DUPLICATE_REQUEST_ID))
    {
      errorString = eventcharge_duplicate_req_id;
    }
    else if(responseCode.contains(CHARGE_FAILED))
    {
      errorString = eventcharge_charge_failed;
    }
    else if(responseCode.contains(UNDETERMINED_ERROR))
    {
      errorString = eventcharge_undetermined_error;
    }
    else if(responseCode.contains(INVALID_KEY))
    {
      errorString = eventcharge_invalid_key;
    }
    else if(responseCode.contains(FALIURE))
    {
      errorString = eventcharge_failed;
    }
    else if(responseCode.contains(INVALID_MSISDN))
    {
      errorString = eventcharge_invalid_msisdn;
    }
    else if(responseCode.contains(INVALID_PRODUCT_ID))
    {
      errorString = eventcharge_invalid_productid;
    }
    return errorString;
  }
}




Java Source Code List

com.qubecell.beans.BaseBean.java
com.qubecell.beans.CheckStatusRespBean.java
com.qubecell.beans.EventChargeRespBean.java
com.qubecell.beans.MsisdnRespBean.java
com.qubecell.beans.OperatorDetails.java
com.qubecell.beans.OperatorsRespBean.java
com.qubecell.beans.ResponseBaseBean.java
com.qubecell.beans.SendOTPRespBean.java
com.qubecell.beans.ValidateOTPRespBean.java
com.qubecell.constants.ApplicationActivities.java
com.qubecell.constants.CheckstatusServerRespCode.java
com.qubecell.constants.ConstantStrings.java
com.qubecell.constants.EventChargeServerRespCode.java
com.qubecell.constants.HttpConstant.java
com.qubecell.constants.IntentConstant.java
com.qubecell.constants.MerchantData.java
com.qubecell.constants.MessageResponseCode.java
com.qubecell.constants.MobileOperators.java
com.qubecell.constants.MsisdnServerRespCode.java
com.qubecell.constants.NetworkResponseCode.java
com.qubecell.constants.NetworkResponse.java
com.qubecell.constants.NetworkURL.java
com.qubecell.constants.PaymentResult.java
com.qubecell.constants.ProductIds.java
com.qubecell.constants.QubecellResult.java
com.qubecell.constants.SendOTPServerRespCode.java
com.qubecell.constants.ServerCommand.java
com.qubecell.constants.ThemeConfigurationVariables.java
com.qubecell.constants.ValidateOTPServerRespCode.java
com.qubecell.constants.WidgetsTagName.java
com.qubecell.elogger.ELogger.java
com.qubecell.network.AsyncClient.java
com.qubecell.network.NetworkController.java
com.qubecell.receivers.SMSReceiver.java
com.qubecell.smsmgr.QubecellSMSManager.java
com.qubecell.ui.BaseActivity.java
com.qubecell.ui.QubecellActivity.java
com.qubecell.ui.ResultActivity.java
com.qubecell.ui.SelectOperatorActivity.java
com.qubecell.ui.ValidateOTPActivity.java
com.qubecell.utility.CommonUtility.java
com.qubecell.utility.ImageBase64.java
com.qubecell.xmlparser.XMLParser.java
com.qubecell.xmlparser.XMLfunctions.java
com.qubecelltestapp.ui.MerchantActivity.java