Example #1
0
 public override Gateway.DispatchTripResponse DispatchTrip(Gateway.DispatchTripRequest request)
 {
     Logger.BeginRequest("DispatchTrip received from " + gateway.GetName(request.clientID), request);
     Gateway.DispatchTripResponse response = gateway.DispatchTrip(request);
     Logger.EndRequest(response);
     return(response);
 }
Example #2
0
 public override Gateway.DispatchTripResponse DispatchTrip(Gateway.DispatchTripRequest request)
 {
     Logger.BeginRequest("DispatchTrip sent to " + server.name, request);
     Gateway.DispatchTripResponse response = server.DispatchTrip(request);
     Logger.EndRequest(response);
     return(response);
 }
        private void TryToDispatchToForeignProvider(PartnerTrip t)
        {
            Logger.Tab();
            Gateway.DispatchTripRequest request = new Gateway.DispatchTripRequest(
                clientID: partner.ID,
                tripID: t.ID,
                pickupLocation: t.pickupLocation,
                pickupTime: t.pickupTime,
                passengerID: t.passengerID,
                passengerName: t.passengerName,
                luggage: t.luggage,
                persons: t.persons,
                dropoffLocation: t.dropoffLocation,
                waypoints: t.waypoints,
                paymentMethod: t.paymentMethod,
                vehicleType: t.vehicleType,
                maxPrice: t.maxPrice,
                minRating: t.minRating,
                partnerID: partner.preferedPartnerId
                );
            Gateway.DispatchTripResponse response = partner.tripthru.DispatchTrip(request);
            if (response.result == Gateway.Result.OK)
            {
                // Actually, at this point its just in the partner's queue, until its dispatch to the partner's drivers -- so no status update.
                t.service = PartnerTrip.Origination.Foreign;
                Logger.Log("Trip was successfully dispatched through TripThru");

            }
            else
                Logger.Log("Trip was rejected by TripThru");
            Logger.Untab();
        }
Example #4
0
        public bool TryToDispatchToForeignProvider(PartnerTrip trip, string partnerID = null)
        {
            Logger.Log("TryToDispatchToForeignProvider: partnerID = " + partnerID);
            Logger.Tab();
            Gateway.DispatchTripRequest request = new Gateway.DispatchTripRequest(
                clientID: ID,
                tripID: trip.ID,
                pickupLocation: trip.pickupLocation,
                pickupTime: trip.pickupTime,
                passengerID: trip.passengerID,
                passengerName: trip.passengerName,
                luggage: trip.luggage,
                persons: trip.persons,
                dropoffLocation: trip.dropoffLocation,
                waypoints: trip.waypoints,
                paymentMethod: trip.paymentMethod,
                vehicleType: trip.vehicleType,
                maxPrice: trip.maxPrice,
                minRating: trip.minRating,
                partnerID: partnerID == null ? preferedPartnerId : partnerID
                );
            Gateway.DispatchTripResponse response = tripthru.DispatchTrip(request);
            if (response.result == Gateway.Result.OK)
            {
                if (partnerID == this.ID)
                    Logger.Log("Local trip was successfully created in TripThru");
                else
                {
                    // Actually, at this point its just in the partner's queue, until its dispatch to the partner's drivers -- so no status update.
                    trip.service = PartnerTrip.Origination.Foreign;
                    Logger.Log("Trip was successfully dispatched through TripThru");
                }

            }
            else
                Logger.Log("Trip was rejected by TripThru");
            Logger.Untab();
            return response.result == Gateway.Result.OK;
        }