Repository navigation
Add v3 support for order refunds - #813
Open
ArnoutPullen wants to merge 3 commits into
Open
ArnoutPullen wants to merge 3 commits into
ArnoutPullen wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
🟡 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) toOrderRefund. - 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.
| } | ||
|
|
||
| [DataContract] | ||
| public class OrderRefundShippingLine |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added support for the WooCommerce REST API v3 order refund fields. See the WooCommerce REST API documentation
Changes
OrderRefund.This brings the
OrderRefundmodel in line with the WooCommerce REST API v3.