Skip to content

Handle more refund failure reason codes in Refund notes #10645

@mgascam

Description

@mgascam
          I think there's an opportunity to handle more `failure_reason` codes as listed in the Stripe [docs](https://docs.stripe.com/api/refunds/object#refund_object-failure_reason) (i.e. `expired_or_canceled_card`). IMO it will be useful for the merchant. But I think we can tackle it on a follow up issue, since we will probably need to refactor how we are handling the failed refund failure codes to use a holistic approach.

Originally posted by @mgascam in #10600 (comment)

Description

Currently, WooPayments only handles a limited set of refund failure reason codes from Stripe, with special handling for insufficient_funds. However, Stripe's API provides more detailed failure reasons that could be valuable for merchants to understand why refunds fail.

Current Implementation

  • Only handles insufficient_funds failure reason with special handling
  • Some failure reasons like expired_or_canceled_card are already visible in the timeline view
  • Other failure reasons are not explicitly handled or displayed in a merchant-friendly way

Acceptance criteria

  1. Implement a more comprehensive handling of refund failure reasons as listed in the Stripe docs

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions