- Home /
Receipt JSON Split
Hi,
I have the following receipt:
string s = "{\"json\":\"{\"orderId\":\"12999763169054705758.1320941012470606\",\"packageName\":\"com.Lads.Test\",\"productId\":\"1rg_15\",\"purchaseTime\":1435888193617,\"purchaseState\":0,\"purchaseToken\":\"ppcmeflemkobpfiihijgamc.AO-J1OyUywJ6gZ4JH7hodhao59-rNr_vMDuoSSl26duP4dTqLMRe1GncNgnDc7am3KkXK3phLss1_HvFmi67WQaFf5eekNOS85tmXim4CpagDBnupYxQbgM\"}\",\"developerPayload\":\"\",\"signature\":\"D7pNrRvGIcGvPjefO\\/PB4r6+BhExYUXoqFIFO0\\/YRrjbcnjPoEZoGoTsrKgvVczYy5nmYKcrtJdfc25rnJUSTb1l69gx0oTF+f\\/pN5eK6OurQffjE7jMWNZ6WCWY26RcptixWH9ZG9DpvzVSXlWOuVu4c4nJt43pdf4gr+rrk+wRF\\/qj8wmpCHX3rTcmEua37tnZiI+tSY7fBTYsFr8zo00MWBxcD6JE\\/ZdjQlhICDpIoWDjR04YMYvYJI64YgIXvCHSpPF5cSF5rbBA1pmMaB\\/3+4pk\\/0JIKwry9nWkGL\\/s3ysgqnb7ifhUk8rkXOAcQEPseamgECicR2D1fc1zw==\"}";
I would like to run this through a JSON deserialzation function to get "JSON" and "SIGNATURE" properties, but this fails to work.
public static List<object> DeserializeJSONReceipt( string response )
{
var responseObject = Json.Deserialize( response ) as Dictionary<string, object>;
object data;
var profile = new List<object>();
if( responseObject.TryGetValue( "json", out data ) )
profile.AddRange( (List<object>) (((Dictionary<string, object>)data)["orderId"]) );
return profile;
}
What am I doing wrong?
Thanks
Comment
Your answer
Follow this Question
Related Questions
Saving JSON file in Android,How to save json file in android 0 Answers
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Why does JsonUtility fails miserably on Android? 1 Answer
LitJSON android problem 1 Answer