Beispiel #1
0
        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);
        }
Beispiel #2
0
        internal static bool VerifySecureSignedSDTToken(string cmpCtx, GxUserType value, string signedToken, IGxContext context)
        {
            WebSecureToken Token = SecureTokenHelper.getWebSecureToken(signedToken, GetSecretKey(context));

            if (Token == null)
            {
                return(false);
            }
            GxUserType PayloadObject = (GxUserType)value.Clone();

            PayloadObject.FromJSonString(Token.Value);
            return(GxUserType.IsEqual(value, PayloadObject));
        }
Beispiel #3
0
        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));
        }