feat: block refunds for past orders (refunds_blocked_until)#10120
Draft
stilla[bot] wants to merge 1 commit intomainfrom
Draft
feat: block refunds for past orders (refunds_blocked_until)#10120stilla[bot] wants to merge 1 commit intomainfrom
stilla[bot] wants to merge 1 commit intomainfrom
Conversation
Co-Authored-By: Rishi Raj Jain <rishi@polar.sh>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
OpenAPI ChangesNo changes detected in the OpenAPI schema. |
Contributor
|
Contributor
|
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
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.
Summary
Adds a more granular refund-blocking option alongside the existing
refunds_blockedflag (PR #10029).Instead of blocking ALL refunds for an org, this allows blocking refunds only for orders created up to the moment the button is clicked, leaving future orders refundable.
Changes
refunds_blocked_untilnullableTIMESTAMP(timezone=True)column toOrganizationPOST /{organization_id}/refunds-blocked-until?blocked=true|false— sets cutoff tonow()or clears itcreated_at ≤ refunds_blocked_untilHow it works
When a backoffice operator clicks "Block Past Refunds",
refunds_blocked_untilis set to the current UTC time. Any refund attempt for an order whosecreated_at ≤ refunds_blocked_untilis rejected withRefundsBlocked. Future orders remain refundable. Clicking "Clear Past Refund Block" resets the field toNone.Stilla Canvas. Ask @stilla for more context.