Created
March 21, 2020 08:30
-
-
Save ArsalRaza/43e1d1d154294935cee89f161fdd18d5 to your computer and use it in GitHub Desktop.
Bykea - Create Trip API (Mobile Wallet Cash Collection Booking)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* request body for Bykea Trip Creation API | |
* | |
**/ | |
data class TripRequest( | |
val bookings: Booking | |
) | |
data class Booking( | |
val booking: BookingDetail, | |
val pickup: Pickup, | |
val details: Detail | |
) | |
data class BookingDetail( | |
val service_code: String? | |
) | |
data class Detail( | |
val vendor_name: String?, | |
val phone: String?, | |
val cnic: String?, | |
val amount: String? | |
) | |
data class Pickup( | |
val lat: Double?, | |
val lng: Double?, | |
val number: String?, | |
val address: String?, | |
val gps_address: String?, | |
val name: String? | |
) | |
/** | |
* response body for Bykea Authentication API | |
* | |
**/ | |
data class TripResponse( | |
val code: Int?, | |
val success: Boolean?, | |
val message: String?, | |
val data: Result? | |
) | |
data class Result ( | |
val trip_id: String?, | |
val trip_no: String?, | |
val passenger_id: String? | |
) | |
/** | |
* Retrofit Interface declaration to execute API: | |
* | |
**/ | |
@POST("/api/v1/create/trip/{service_code}") | |
fun performAuth(@Header("x-bb-user-token") token: String, @Path("service_code") serviceCode: String, @Body tripRequest: TripRequest): Call<TripResponse> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment