Skip to content

Display Refund reason #680

@SarahSync

Description

@SarahSync

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

  1. 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.

  2. 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.

  3. 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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions