-
Notifications
You must be signed in to change notification settings - Fork 21
Description
User story
As a user viewing a refunded transaction, I want to see the reason for the refund directly on my receipt, so that I don't have to contact support to find out what went wrong with my order.
Acceptance criteria
-
GIVEN an aggregator initiates a refund
WHEN the refund process is completed
THEN the aggregator must send a webhook containing the specific refund reason to the sender/backend for storage. -
GIVEN a transaction has the status "refunded"
WHEN the user opens the transaction details/receipt
THEN a new row labeled "Refund Reason" must be visible and it must display the reason fetched from the database. -
GIVEN a transaction has a status of "pending," "settled," or "failed" (not refunded)
WHEN the user opens the transaction receipt
THEN the "Refund Reason" row must NOT be visible in the UI.
Technical details
- Webhook Update: Update the Aggregator's refund webhook listener to parse and store the refund_reason field in the transactions table.
- API Enhancement: Modify the transaction details endpoint to include the refund_reason field in the response payload when the status is "refunded."
- Frontend Logic: Implement conditional rendering in the receipt component to show the "Refund Reason" row only if status === 'refunded' and the reason string is not empty.
Notes/Assumptions
- Data Availability: It is assumed the Aggregator has access to the specific failure or refund trigger reason to send in the webhook.