docs: document refund reason codes and their usage in request_refund … - #515
Merged
fati-Onchain merged 2 commits intoJul 30, 2026
Merged
Conversation
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.
#Closes
#440
PR Description
📌 Title
docs(refund): add description table for RefundReasonCode variants
📝 Summary
This PR updates the refund contract documentation to include a comprehensive breakdown of all canonical RefundReasonCode variants (ProductDefect, NonDelivery, DuplicateCharge, Unauthorized, CustomerRequest, Other). It explains the description and intended scenario for each variant used in request_refund(), structured analytics (get_reason_code_analytics()), and reason filtering (get_refunds_by_reason_code()).
🎯 Acceptance Criteria Addressed
Added a table of RefundReasonCode variants with descriptions and target scenarios to
contracts/refund/README.md
.
🛠️ Key Changes
contracts/refund/README.md
Added the ## 🏷️ Refund Reason Codes section containing a reference table for all RefundReasonCode enum variants:
ProductDefect: Items delivered broken, malfunctioning, or not as described.
NonDelivery: Unfulfilled items, lost packages, or failed service delivery.
DuplicateCharge: Multiple debits caused by double-submit or payment gateway errors.
Unauthorized: Fraudulent charges or account takeover without consent.
CustomerRequest: Voluntary return or cancellation within allowed merchant policies.
Other: Fallback for custom merchant flows, uncategorized reasons, or historical backfills.
🔗 Related Resources
Branch: docs/refund-reason-code-guide
Documentation:
contracts/refund/README.md