Closed dorshay6 closed 7 months ago
who should call this method? /api/v1/users/:userId/rides/:rideId/billing locomotion app? or proxy service?
who should call this method? /api/v1/users/:userId/rides/:rideId/billing locomotion app? or proxy service?
This will be a call from EBS to locomotion, I will make it clear
Thanks for this explanation. This helps us a lot. Anyway we have a few questions regarding the API communication with the planned MOD Payment Service:
What is HBS?
Where is the price of a ride calculated? Does this happen in the EBS?
What is the charing type? Is that meant to seperate the transport of persons or goods?
Is there always one transaction per ride?
Are all the calls on the MoD Paymentservice from the locomotion service or are there direct calls from the app?
Will the price of the ride be in the body of "Ride has final state" ? It has to be, because our payment service will get the final price at least when the final state (= charging) of the ride is reached
Thanks for your help! Theresia
Thanks for this explanation. This helps us a lot. Anyway we have a few questions regarding the API communication with the planned MOD Payment Service:
- What is HBS?
Mistype, fixed.
- Where is the price of a ride calculated? Does this happen in the EBS?
The price will be calculated in autofleet as it is right now.
- What is the charing type? Is that meant to seperate the transport of persons or goods?
Charge type will be one of credit-card, Paypal, apple pay...
- Is there always one transaction per ride?
Yes, in case of refunds or changes the transaction should be updated in locomotion with the relevant docs.
- Are all the calls on the MoD Paymentservice from the locomotion service or are there direct calls from the app?
No requests will be sent from app for security reasons.
- Will the price of the ride be in the body of "Ride has final state" ? It has to be, because our payment service will get the final price at least when the final state (= charging) of the ride is reached That's right, the final price will available on the ride end.
Thanks for your help! Theresia
Thanks for your reply. This leads us to two more questions:
"Ride reached a final state" = For us this is the point in the ride, where the user is charged, when he can't cancel anymore. Did we get this right?
Where is the account balance of the customer stored? We want the account balance to be only stored in our payment service. The response of "Check user ability to book a ride" contains the "balance". But it should contain just the price of the ride, because the balance is checked in the MoD Payment Service?
Hi there,
I'm Max, currently working on the implementation of the payment service (EBS) here at MoD.
I got a few questions regarding the proposal you describes here:
[Post] /api/v1/users
[Patch] /api/v1/users/:userId/rides/:rideId
[Patch] /api/v1/users/:userId/webview
window.location.href
in JavaScript. Navigate to a main payment overview page as a patch request looks a bit complicated to me due to the fact that I think it is not really necessary to have a patch method with no body information.
Billing Integration
Context:
In some cases Locomotion based apps need the ability to manage payments and charging transactions automatically. As there is significant variability in how charging and billing flows are implemented, the approach is to define a specification that Locomotion app developers would be able to implement against. This specification is called: External Billing Server API (EBS) and will be provided through a pull request on the public repo.
Requirements
API Security Note
A secret will be defined in both Locomotion and EBS, each request will contain a header - Authorization (JWT bearer token) that will include a secret containing the user id.
EBS API Methods Suggested (Locomotion -> EBS):
User Created / Updated (Upsert)
[Post] /api/v1/users
Body:
Response:
Check user ability to book a ride
[Get] /api/v1/users/:userId/current-balance
Response:
bookingLimitation can be of
charingType can be of
Ride reached a final state
[Patch] /api/v1/users/:userId/rides/:rideId
This method can be called more then one time.
Body:
Response:
User billing management page
[Patch] /api/v1/users/:userId/webview
This url should return an HTML to be showed to the user in app after clinking "Billing" from the main menu.
Locomotion API (EBS -> Locomotion)
Update billing status per ride
[Patch] /api/v1/users/:userId/rides/:rideId/billing
This method can be called more then one time, every call will replace the last data saved.
Body:
Response: