Package 

Class ParkingCommerce

  • All Implemented Interfaces:
    com.telenav.commerce.parkingservice.api.IParkingCommerceApi

    
    public final class ParkingCommerce
     implements IParkingCommerceApi
                        

    Class responsible for retrieving the needed data in order to make a parking flow.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      ParkingCommerce(IHttpApi retrofitApi)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      Unit setConfiguration(SdkConfiguration configuration) Updates the IHttpApi instance with the given configuration to be used in the communication with commerce service.
      List<Brand> getParkingBrands() Returns a list of brands available for parking.
      List<ParkingStore> getParkingStores(String startTime, String endTime, GeoLocation location) Searches for a parking place based on the given start time, end time and location and returns a list of ParkingStore.
      List<ParkingStore> getParkingStoresForBrand(String brandId, String startTime, String endTime, GeoLocation location) Searches for a parking place based on the given brand id, start time, end time and location and returns a list of ParkingStore.
      CommerceResponse<Quote> getQuoteForParking(String parkingId, ParkingTime parkingTime) Returns the quote for the parking place with the given id in the time interval between the given start time and end time.
      CommerceResponse<Status> cancelParkingReservationById(String orderId) This method will cancel the parking reservation with the given order id.
      CommerceResponse<StatusResponse> addParkingReservation(String parkingId, ParkingTime parkingTime, String quoteReference) Adds a parking reservation to your shopping cart
      CommerceResponse<ParkingOrderResponse> placeOrder(PaymentRequest paymentRequest) Place the order that was previously added in the shopping cart
      CommerceResponse<StatusResponse> emptyCart() Clears the current shopping cart
      CommerceResponse<List<ParkingOrderInformation>> getParkingHistory(String sorting, Integer limit) This method will return all the parking orders satisfying the given conditions
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ParkingCommerce

        ParkingCommerce(IHttpApi retrofitApi)
    • Method Detail

      • setConfiguration

         Unit setConfiguration(SdkConfiguration configuration)

        Updates the IHttpApi instance with the given configuration to be used in the communication with commerce service.

        Parameters:
        configuration - to be used
      • getParkingStores

         List<ParkingStore> getParkingStores(String startTime, String endTime, GeoLocation location)

        Searches for a parking place based on the given start time, end time and location and returns a list of ParkingStore.

        Parameters:
        startTime - the enter date and time for parking reservation as destination timezone, in ISO 8601 format: 'yyyy-mm-ddThh:mm:ss'
        endTime - the end date and time for parking reservation as destination timezone, in ISO 8601 format: 'yyyy-mm-ddThh:mm:ss'
        location - the coordinates around which the search should be done.
      • getParkingStoresForBrand

         List<ParkingStore> getParkingStoresForBrand(String brandId, String startTime, String endTime, GeoLocation location)

        Searches for a parking place based on the given brand id, start time, end time and location and returns a list of ParkingStore.

        Parameters:
        brandId - the id of the Brand for which the search should be done.
        startTime - the enter date and time for parking reservation as destination timezone, in ISO 8601 format: 'yyyy-mm-ddThh:mm:ss'
        endTime - the end date and time for parking reservation as destination timezone, in ISO 8601 format: 'yyyy-mm-ddThh:mm:ss'
        location - the coordinates around which the search should be done.
      • getQuoteForParking

         CommerceResponse<Quote> getQuoteForParking(String parkingId, ParkingTime parkingTime)

        Returns the quote for the parking place with the given id in the time interval between the given start time and end time.

        Parameters:
        parkingId - the id of the parking place for which the price info should be returned.
        parkingTime - contains the enter date and time for parking reservation as destination timezone, in ISO 8601 format: 'yyyy-mm-ddThh:mm:ss' and the end date and time for parking reservation as destination timezone, in ISO 8601 format: 'yyyy-mm-ddThh:mm:ss'
      • cancelParkingReservationById

         CommerceResponse<Status> cancelParkingReservationById(String orderId)

        This method will cancel the parking reservation with the given order id.

        Parameters:
        orderId - the id of the parking reservation that should be canceled.
      • addParkingReservation

         CommerceResponse<StatusResponse> addParkingReservation(String parkingId, ParkingTime parkingTime, String quoteReference)

        Adds a parking reservation to your shopping cart

        Parameters:
        parkingId - The id of the parking where you want to book a parking spot
        parkingTime - An object containing the start time and end time of the parking together with the timezone
        quoteReference - The quote reference id retrieved from the getQuoteForParking call
      • placeOrder

         CommerceResponse<ParkingOrderResponse> placeOrder(PaymentRequest paymentRequest)

        Place the order that was previously added in the shopping cart

        Parameters:
        paymentRequest - An object containing the payment method
      • getParkingHistory

         CommerceResponse<List<ParkingOrderInformation>> getParkingHistory(String sorting, Integer limit)

        This method will return all the parking orders satisfying the given conditions

        Parameters:
        sorting - the way the results should be sorted; values in Sorting default is Sorting.