public void Broadcast(GxUserType message) { if (_ws != null) { _ws.Broadcast(message.ToJSonString()); } }
public int GetPurchase(GxUserType gxStoreConfig, string productId, GxUserType gxPurchaseResult, GxUserType gxStorePurchase) { PurchaseResult purchase = JSONHelper.Deserialize <PurchaseResult>(gxPurchaseResult.ToJSonString()); StorePurchase sp = null; int errCode = GetPurchaseImpl(gxStoreConfig, productId, purchase, out sp); if (errCode == 0) { gxStorePurchase.FromJSonString(sp.ToJson()); } return(errCode); }
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { GxUserType sdt = value as GxUserType; if (sdt != null) { writer.WriteRawValue(sdt.ToJSonString()); } else { serializer.Serialize(writer, value); } }
public short NotifyClient(string clientId, GxUserType message) { return(NotifyImpl(clientId, message.ToJSonString())); }
public bool AcknowledgePurchase(GxUserType gxStoreConfig, string productId, GxUserType gxPurchaseResult) { IStoreManager storeMgr = null; int errCode = GetManager(gxStoreConfig, 2, out storeMgr); GooglePlayStoreManager mgr = (GooglePlayStoreManager)storeMgr; PurchaseResult purchase = JSONHelper.Deserialize <PurchaseResult>(gxPurchaseResult.ToJSonString()); try { return(mgr.AcknowledgePurchase(productId, purchase)); } catch (StoreConfigurationException e) { errCode = 3; ErrDescription = e.Message; } catch (StoreInvalidPurchaseException e) { errCode = 2; ErrDescription = e.Message; } catch (StoreServerException e) { errCode = 4; ErrDescription = e.Message; } catch (StoreException e) { errCode = 10; ErrDescription = e.Message; } return(false); }
public String GetPurchases(GxUserType gxStoreConfig, GxUserType purchasesInformation) { GxSimpleCollection <GxUserType> gxStorePurchases = new GxSimpleCollection <GxUserType>(); PurchasesInformation pInformation = JSONHelper.Deserialize <PurchasesInformation>(purchasesInformation.ToJSonString());; IStoreManager storeMgr; ErrCode = GetManager(gxStoreConfig, pInformation.PurchasePlatform, out storeMgr); if (storeMgr != null) { Type type = Type.GetType("GeneXus.Core.genexus.sd.store.SdtStorePurchase, GeneXus.Core.Common", true); List <StorePurchase> purchases = storeMgr.GetPurchases(pInformation); foreach (StorePurchase p in purchases) { GxUserType storePurchase = (GxUserType)Activator.CreateInstance(type); storePurchase.FromJSonString(p.ToJson()); gxStorePurchases.Add(storePurchase); } } return(gxStorePurchases.ToJSonString(false)); }