Skip to content

Add v3 support for order refunds - #813

Open
ArnoutPullen wants to merge 3 commits into
XiaoFaye:masterfrom
ArnoutPullen:feature/order-refund-v3-support
Open

ArnoutPullen wants to merge 3 commits into
XiaoFaye:masterfrom
ArnoutPullen:feature/order-refund-v3-support

Conversation

@ArnoutPullen

Copy link
Copy Markdown

Added support for the WooCommerce REST API v3 order refund fields. See the WooCommerce REST API documentation

Changes

  • Added missing v3 properties to OrderRefund.
  • Added support for tax, shipping, and fee refund lines.
  • Added support for metadata and taxes on refund line items.

This brings the OrderRefund model in line with the WooCommerce REST API v3.

Copilot AI lite review requested due to automatic review settings September 9, 2026 13:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Two newly added refund line model classes use the JsonObject “*Value” conversion pattern but don’t inherit from WooCommerceNET.Base.JsonObject, which breaks total/total_tax deserialization.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates the WooCommerceNET.WooCommerce.v3.OrderRefund model to better match the WooCommerce REST API v3 order refund schema by adding v3-specific refund fields and line item structures.

Changes:

  • Added v3 refund flags (refunded_payment, api_restock, compute_totals) to OrderRefund.
  • Added v3 refund line collections for taxes, shipping, and fees (tax_lines, shipping_lines, fee_lines).
  • Introduced new refund line models (OrderRefundTaxLine, OrderRefundShippingLine, OrderRefundFeeLine) including taxes and metadata where applicable.
File summaries
File Description
WooCommerce/v3/OrderRefund.cs Expands the v3 OrderRefund model with v3 refund fields and new refund line item types (tax/shipping/fee).
Review details

Suppressed comments (1)

WooCommerce/v3/OrderRefund.cs:162

  • OrderRefundFeeLine uses the JsonObject "Value" pattern (totalValue/total_taxValue) but does not inherit from WooCommerceNET.Base.JsonObject, so the reflection-based conversion in JsonObject won't populate total/total_tax on deserialization.
    public class OrderRefundFeeLine
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread WooCommerce/v3/OrderRefund.cs Outdated
}

[DataContract]
public class OrderRefundShippingLine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants