//Buy Shop public int BuyShop(int itemId, int paymentType = 0, string invoiceId = "", int playerId = 0, string token = "", string otp = "") { if (ParseToken(playerId, token)) { ShopParam param = new ShopParam(); param.player_id = apiPlayerId; param.token = apiToken; param.item_id = itemId; param.item_type = paymentType; param.invoice_id = invoiceId; param.device_id = SystemInfo.deviceUniqueIdentifier; param.device_type = (int)Application.platform; string paramJson = JsonUtility.ToJson(param); if (otp.Length > 0) { apiOtp = otp; } API api = new API("buyshop.php", "RBuyShop", paramJson, 1, (param.item_type == 0 ? apiOtp : "")); param = null; paramJson = ""; if (paymentType == 0 && apiOtp.Length == 0) { api.errorCode = 502; ParseError(api); } else { StartCoroutine(Congest.SendPOST(this, api)); } return(api.seed); } return(0); }
public int GetShop(int itemType = 0, int playerId = 0, string token = "") { if (ParseToken(playerId, token)) { ShopParam param = new ShopParam(); param.player_id = apiPlayerId; param.token = apiToken; param.item_type = itemType; string paramJson = JsonUtility.ToJson(param); API api = new API("getshop.php", "RGetShop", paramJson, 1); param = null; paramJson = ""; StartCoroutine(Congest.SendPOST(this, api)); return(api.seed); } return(0); }