Example #1
0
 public override Gateway.GetTripStatusResponse GetTripStatus(Gateway.GetTripStatusRequest request)
 {
     Logger.BeginRequest("GetTripStatus sent to " + server.name, request);
     Gateway.GetTripStatusResponse response = server.GetTripStatus(request);
     Logger.EndRequest(response);
     return(response);
 }
Example #2
0
 public override Gateway.GetTripStatusResponse GetTripStatus(Gateway.GetTripStatusRequest request)
 {
     Logger.BeginRequest("GetTripStatus received from " + gateway.GetName(request.clientID), request);
     Gateway.GetTripStatusResponse response = gateway.GetTripStatus(request);
     Logger.EndRequest(response);
     return(response);
 }
 // speed is miles per hour
 public void GetTripStatusFromForeignServiceProvider(PartnerTrip trip, bool force = false)
 {
     if (force || DateTime.UtcNow > trip.lastUpdate + updateInterval && trip.status != Status.Complete)
     {
         Logger.Log("Getting (Foreign) status of " + trip);
         Logger.Tab();
         Gateway.GetTripStatusRequest request = new Gateway.GetTripStatusRequest(clientID: ID, tripID: trip.ID);
         Gateway.GetTripStatusResponse response = tripthru.GetTripStatus(request);
         if (response.status != null)
             trip.UpdateTripStatus(notifyPartner: false, status: (Status)response.status, driverLocation: response.driverLocation, eta: response.ETA); // todo: not good -- fix this.
         if (response.driverName != null)
             trip.driver = new Driver(name: response.driverName, location: response.driverLocation);
         if (response.dropoffTime != null)
             trip.dropoffTime = response.dropoffTime;
         if (response.vehicleType != null)
             trip.vehicleType = response.vehicleType;
         if (response.distance != null)
             trip.distance = response.distance;
         Logger.Untab();
         trip.lastUpdate = DateTime.UtcNow;
     }
 }