Skip to content

[Gift Cards] Can't refund an order where a gift card was applied/redeemed #10336

Open
@rachelmcr

Description

@rachelmcr

If a gift card was applied to an order (redeemed), it can't be refunded in the app. Trying to issue a refund displays a generic error.

The problem: The refund is created for the full product price (before the gift card was applied), but that amount needs to be split between refunding the amount paid and refunding (adding credit to) the gift card.

Related discussion for supporting refunds on the web (internal ref): pdqkbG-6O-p2

Proposed solution

In the short term, it would be better to prevent the merchant from trying to issue a refund if a gift card was applied to the order. Instead of the refund UI, we could display a message that the order must be refunded from the web. (This could be e.g. in place of the "Issue Refund" button or displayed when "Issue Refund" is tapped.)

In the longer term, it would be good to support refunding these orders within the app.

App logs

2023/01/13 15:29:44:729  🔵 Tracked refund_create, properties: [AnyHashable("is_full"): "false", AnyHashable("method"): "ITEMS", AnyHashable("gateway"): "", AnyHashable("order_id"): "73", AnyHashable("amount"): "90", AnyHashable("blog_id"): 214253715, AnyHashable("is_wpcom_store"): true]
2023/01/13 15:29:45:429  <> Mapping Error: Dotcom Error: [woocommerce_rest_cannot_create_order_refund] Invalid refund amount.
2023/01/13 15:29:45:435  Error creating refund: Refund(refundID: -9223372036854775808, orderID: -9223372036854775808, siteID: -9223372036854775808, dateCreated: 0001-01-01 00:00:00 +0000, amount: "90", reason: "", refundedByUserID: -9223372036854775808, isAutomated: nil, createAutomated: Optional(false), items: [Networking.OrderItemRefund(itemID: 3, name: "", productID: -9223372036854775808, variationID: -9223372036854775808, refundedItemID: nil, quantity: 1, price: 0, sku: nil, subtotal: "", subtotalTax: "", taxClass: "", taxes: [], total: "90", totalTax: "")], shippingLines: Optional([]))
With Error: Dotcom Error: [woocommerce_rest_cannot_create_order_refund] Invalid refund amount.

Related Android issue: woocommerce/woocommerce-android#9484

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