feat: closed-loop Square payment validation#10
Open
gudnuf wants to merge 4 commits intostrike-backendfrom
Open
feat: closed-loop Square payment validation#10gudnuf wants to merge 4 commits intostrike-backendfrom
gudnuf wants to merge 4 commits intostrike-backendfrom
Conversation
The Prefer header is used by NUT-20 for long-polling support but was being blocked by the CORS middleware. Add it to the allowed headers list for both auth and non-auth configurations.
Drop internal payment/settlement tracking and correlation ID embedding which were unused complexity. Add webhook subscription rotation to prevent hitting Strike's 50-subscription limit, and validate webhook URLs require HTTPS.
Add cdk-agicash crate that wraps Strike backend to restrict melts to invoices from a configured Square merchant. Validates by matching invoice description and timestamp against synced Square payments (polling + webhook + on-demand sync). Rejected invoices return PaymentNotAllowed (20739) with user-facing message.
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
cdk-agicashcrate that wraps the Strike backend to restrict melts to invoices from a configured Square merchantPaymentNotAllowederror code (20739) tocdk-commonso rejected invoices return a user-facing message:"This ecash can only be spent at {store_name}"cdk-mintdbehind theagicashfeature flag--features agicashTest plan
cdk-agicashandcdk-common(cargo clippy -p cdk-agicash -p cdk-common --all-features --lib --bins -- -D warnings)cargo test --lib --workspace --exclude cdk-postgres){"code": 20739, "detail": "This ecash can only be spent at ..."}🤖 Generated with Claude Code