Implementation notes
- Create use case (e.g. CapturePayPalPaymentUseCase or CapturePayPalOrderUseCase) in the payment bounded context. It should:
- Receive an OrderID (string) as parameter
- load the Order with the OrderId
- call the CaptureOrder method of the API. This will return the transaction ID
- add the transaction id to the order
- store the order
- If everything went well, return a success result object with the payment id and transaction id
- If the API call failed, or something was not found in the database, return an error result object
- Test cases may be:
- order not found
- API call failed