Exemplo n.º 1
0
        public IHttpActionResult GetStatus(Guid orderId)
        {
            OrderAccess oAccess = new OrderAccess();
            string status = oAccess.GetStatusByOrderId(orderId);

            if (!string.IsNullOrEmpty(status))
            {
                return Ok(new { orderId = orderId, status = status });
            }
            else
            {
                return BadRequest("Order not found");
            }
        }
Exemplo n.º 2
0
        public IHttpActionResult Create([FromBody]WishroundProject.API.Objects.Wish wish)
        {
            OrderAccess oAccess = new OrderAccess();
            var newOrder = oAccess.CreateForWish(wish.wishId);

            if (newOrder != null)
            {
                return Ok<WishroundProject.API.Objects.Order>(new Objects.Order { orderId = newOrder.PublicId });
            }
            else
            {
                return BadRequest("Wish not found");
            }
        }
Exemplo n.º 3
0
 public IHttpActionResult SetStatus([FromBody]Status status)
 {
     var jsonData = Base64Decode(status.data);
     BuyInfo info = JsonConvert.DeserializeObject<BuyInfo>(jsonData);
     var privateKey = Config.LiqPayPrivateKey;
     var hash = System.Convert.ToBase64String(sha1Hash(privateKey + status.data + privateKey));
     if (!hash.Equals(status.signature))
     {
         return BadRequest("Signature is'n correct");
     }
     OrderAccess oAccess = new OrderAccess();
     bool result = oAccess.SetStatusByOrderId(info.order_id, info.status);
     if (result)
     {
         return Ok("Success");
     }
     else
     {
         return BadRequest("Data is'n correct");
     }
 }