The payment service should be integrated with the other services. This should be done carefully such that we eliminate getting in to an inconsistent state.
According to the assignment specification this means that:
We should call the orders/totalCost/{order_id}/ to retrieve the total cost of the order.
We should try to subtract this amount from the user service /users/credit/subtract/{user_id}/{amount}, if this fails I should cascade the failure, otherwise the payment succeeds.
The payment service should be integrated with the other services. This should be done carefully such that we eliminate getting in to an inconsistent state.
According to the assignment specification this means that:
orders/totalCost/{order_id}/
to retrieve the total cost of the order./users/credit/subtract/{user_id}/{amount}
, if this fails I should cascade the failure, otherwise the payment succeeds.