All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.kushkipagos.android.SiftScienceObject.kt Maven / Gradle / Ivy

package com.kushkipagos.android

import com.google.gson.JsonObject
import org.json.JSONException
import org.json.JSONObject

class   SiftScienceObject(responseBody:String) {
    var userId: String =""
    var sessionId:String=""
    var code: String = ""
    var message: String = ""
    val jsonResponse: JSONObject=JSONObject(responseBody)

    init{
        try{
            userId=jsonResponse.getString("userId")
            sessionId=jsonResponse.getString("sessionId")
        }catch (jsonException: JSONException){
            code = try {
                jsonResponse.getString("code")
            } catch (jsonException: JSONException) {
                ""
            }
            message = try {
                jsonResponse.getString("message")
            } catch (jsonException: JSONException) {
                ""
            }
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy