public void OnSuccess(global::Java.Lang.Object result) { var str = result.JavaCast<Java.Lang.String>().ToString(); using (var helper = new OuyaEncryptionHelper()) { var response = new JSONObject(str); var id = helper.DecryptPurchaseResponse(response, _publicKey); if (id != _uniquePurchaseId) OnFailure(OuyaErrorCodes.ThrowDuringOnSuccess, "Received purchase ID does not match what we expected to receive", Bundle.Empty); _tcs.SetResult(true); } }
public void OnSuccess(global::Java.Lang.Object result) { var str = result.JavaCast<Java.Lang.String>().ToString(); // Parse gamerUuid into string string gamerUuid = string.Empty; try { gamerUuid = str; // Cache the gamerUuid to file for later use when the network may not be accessible ToCache(gamerUuid); } catch (Exception e) { OnFailure(OuyaErrorCodes.ThrowDuringOnSuccess, "Error retrieving gamerUuid: " + e.Message, Bundle.Empty); } _tcs.SetResult(gamerUuid); }
public void OnSuccess(global::Java.Lang.Object result) { var str = result.JavaCast<Java.Lang.String>().ToString(); // Parse receipts into a list IList<Receipt> receipts = null; try { receipts = ReceiptsFromResponse(str); // Cache the receipts to file for later use when the network may not be accessible ToCache(receipts); } catch (Exception e) { OnFailure(OuyaErrorCodes.ThrowDuringOnSuccess, "Error decrypting receipts: " + e.Message, Bundle.Empty); } _tcs.SetResult(receipts); }
public void OnSuccess(global::Java.Lang.Object result) { var str = result.JavaCast<Java.Lang.String>(); tcs.SetResult(str.ToString()); }
public void OnSuccess(global::Java.Lang.Object result) { var str = result.JavaCast<Java.Lang.String>(); var receipts = _purchaseUtils.CreateReceiptsFromResponse(str.ToString()); _tcs.SetResult(receipts); }
public void OnSuccess(global::Java.Lang.Object result) { var str = result.JavaCast<Java.Lang.String>(); bool purchaseSucceeded = _purchaseUtils.IsPurchaseResponseMatching(str.ToString(), _product, _uniquePurchaseId); _tcs.SetResult(purchaseSucceeded); }
public void OnSuccess(global::Java.Lang.Object result) { var list = result.JavaCast<JavaList<Product>>(); _tcs.SetResult(list); }