예제 #1
0
 public ActionResult clearToken()
 {
     try
     {
         var ebay = new NetworksEbay(subdomainid.Value);
         ebay.ClearSynchronisation();
     }
     catch (Exception ex)
     {
         Syslog.Write(ex);
         return(Json(false.ToJsonOKData()));
     }
     return(Json(true.ToJsonOKData()));
 }
예제 #2
0
        public void PollForEbayOrders()
        {
            var service = new OrderService(token);

            try
            {
                // get completed orders from a month before
                var completed = service.GetOrders(OrderStatusCodeType.Completed, DateTime.Now.AddMonths(-1),
                                                  DateTime.Now);

                SaveEbayOrders(completed);

                // exclude active orders for now because buyer email is not shown

                /*
                 * // get all orders from last day
                 * var all = service.GetOrders(OrderStatusCodeType.All, DateTime.Now.AddDays(-1), DateTime.Now);
                 *
                 * SaveEbayOrders(all);
                 * */
            }
            catch (ApiException ex)
            {
                if (ex.Message.Contains("Validation of the authentication token in API request failed"))
                {
                    // delete auth token
                    var ebay = new NetworksEbay(sd.id);
                    ebay.ClearSynchronisation();
                }
            }
            catch (Exception ex)
            {
                Syslog.Write(ex);
                Syslog.Write(service.responseXML);
            }
        }