Skip to content

Parking Service APIs

You can find below the APIs, the exposed functionality of the payment service.

pay

The pay method makes the payment for the given orderId parking reservation.

The priceInfo parameter gets information about the value that has to be retrieved from the card.

The clientSecret represents a temporary token which facilitates the validation of the user in the P97 database.

The orderId parameter represents the id of the parking order.

It returns a CommerceResponse holding the payment response in a json format as String.

1
2
3
4
5
    suspend fun pay(
        priceInfo: PriceInfo,
        clientSecret: String,
        orderId: String
    ): CommerceResponse<String>

addCard

The addCard method registers a new card based on the given cardData.

The cardData parameter provides the necessary data in order to register a card.

It returns a CommerceResponse holding a boolean for the register status. If it's successful, then returns "true". Otherwise, it returns "false".

1
   suspend fun addCard(cardData: ExternalCard): CommerceResponse<Boolean>

deleteCard

The deleteCard method deletes the card based on its id.

The cardId parameter represents the id of the card to be deleted.

It returns a CommerceResponse holding a boolean. If the request is successful then it returns "true". Otherwise, it returns "false".

1
   suspend fun deleteCard(cardId: String): CommerceResponse<Boolean>

getCards

The getCards method gets the cards form the payment provider.

The ExternalCards are contained inside a Wallet object.

The deviceId parameter represents the id of the device being used to make te request.

The storeId parameter is optional.

It returns a list of Wallets, each wallet containing a list of cards as ExternalCard.

1
2
3
4
   suspend fun getCards(
       deviceId: String = "",
       storeId: String = ""
   ): CommerceResponse<List<Wallet>>