The RefundAuthorisation Service is responsible for orchestrating the refund authorization process. It ensures that refunds are handled efficiently and that all necessary conditions are met before finalizing any refund action.
Initial Workflow:
- The service listens for Refund and Refund Fee events.
- It interacts with the Accounting Service to attempt creating a reservation.
Event Handling:
- If the reservation is successfully created (balance is sufficient), it produces an Authorised event.
- If the reservation cannot be created (insufficient balance), it produces a Pending event.
Pending State Handling:
- Refunds in the Pending state have a maximum lifespan of 120 days.
- If no further action occurs within this period, the service produces an Expired event.
Cancel Requests:
- While in the Pending state, the service listens for Cancel requests.
- Upon receiving such a request, it produces a Cancelled event.
Authorisation Confirmation:
- After authorisation, the service waits for a Confirmation Request.
- Upon receiving confirmation, it produces a Confirmed event.
This service plays a critical role in ensuring that refund transactions are processed securely and transparently while accommodating various scenarios like insufficient balance, cancellation, or expiry.