Exemple #1
0
        public async Task <int> Save(PayOp obj)
        {
            Dictionary <string, string> parameters = new Dictionary <string, string>();
            string method = urimainpath + "Save";

            var myContent = JsonConvert.SerializeObject(obj);

            parameters.Add("Object", myContent);
            return(await APIResult.post(method, parameters));
        }
        public async Task <int> packagePay(PackageUser obj, PayOp payobj)
        {
            Dictionary <string, string> parameters = new Dictionary <string, string>();
            string method = urimainpath + "packagePay";

            var myContent = JsonConvert.SerializeObject(obj);

            parameters.Add("Object", myContent);
            var myContentPay = JsonConvert.SerializeObject(payobj);

            parameters.Add("PayObject", myContentPay);

            return(await APIResult.post(method, parameters));
        }
Exemple #3
0
        public async Task <PayOp> getLastPayOp(int packageUserId)
        {
            PayOp item = new PayOp();

            Dictionary <string, string> parameters = new Dictionary <string, string>();

            parameters.Add("packageUserId", packageUserId.ToString());
            //#################
            IEnumerable <Claim> claims = await APIResult.getList(urimainpath + "getLastPayOp", parameters);

            foreach (Claim c in claims)
            {
                if (c.Type == "scopes")
                {
                    item = JsonConvert.DeserializeObject <PayOp>(c.Value, new IsoDateTimeConverter {
                        DateTimeFormat = "dd/MM/yyyy"
                    });
                    break;
                }
            }

            return(item);
        }