public static void NormalPurchaseCall(LootLockerNormalPurchaseRequest[] data, Action <LootLockerPurchaseResponse> onComplete) { string json = ""; if (data == null) { return; } else { json = JsonConvert.SerializeObject(data); } EndPointClass endPoint = LootLockerEndPoints.current.normalPurchaseCall; LootLockerServerRequest.CallAPI(endPoint.endPoint, endPoint.httpMethod, json, (serverResponse) => { LootLockerPurchaseResponse response = new LootLockerPurchaseResponse(); if (string.IsNullOrEmpty(serverResponse.Error)) { response = JsonConvert.DeserializeObject <LootLockerPurchaseResponse>(serverResponse.text); response.text = serverResponse.text; onComplete?.Invoke(response); } else { response.message = serverResponse.message; response.Error = serverResponse.Error; onComplete?.Invoke(response); } }, true); }
public static void AndroidPurchaseVerification(LootLockerAndroidPurchaseVerificationRequest[] data, Action <LootLockerPurchaseResponse> onComplete) { string json = ""; if (data == null) { return; } else { json = JsonConvert.SerializeObject(data); } EndPointClass endPoint = LootLockerEndPoints.androidPurchaseVerification; LootLockerServerRequest.CallAPI(endPoint.endPoint, endPoint.httpMethod, json, (serverResponse) => { LootLockerPurchaseResponse response = new LootLockerPurchaseResponse(); if (string.IsNullOrEmpty(serverResponse.Error)) { response = JsonConvert.DeserializeObject <LootLockerPurchaseResponse>(serverResponse.text); } //LootLockerSDKManager.DebugMessage(serverResponse.text, !string.IsNullOrEmpty(serverResponse.Error)); response.text = serverResponse.text; response.success = serverResponse.success; response.Error = serverResponse.Error; response.statusCode = serverResponse.statusCode; onComplete?.Invoke(response); }, true); }