Repository navigation
Conversation
Implements the PaymentDriver contract from PlaceOS/user-interfaces#748: checkout, manual capture, saved cards, refunds, products and invoices. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[Critical impact] The PR appears safe to merge; all four previous findings are addressed. SummaryAdds a Stripe payment driver for bookings and catering.
|
…artial prices - Users see only invoices with their user ID. Staff invoices get the ID of the PlaceOS user with the email. - Find a customer by user ID after an email change, then update its email. - Fail a quote when the product list is incomplete, as missing products made items free. - Refuse a product price in another currency. A new price is made when staff save it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
PlaceOS/user-interfaces#748 lets users pay for bookings and catering through a payment driver, but no driver implements its
PaymentDrivercontract. This adds one for Stripe:Stripe::Paymentsindrivers/stripe/payments.cr.How it works
invoked_by_user_idand StaffAPI. Staff methods needsys_adminor a group inprivileged_groups. Users see only their own payments, invoices and cards, matched by PlaceOS user ID and not by email.CATERING:*assets in the zone.tax_rateis a percent that the prices already include. A quote fails when a price is in another currency, or when the account has more than 1000 Stripe products, so an item is never free by mistake.capture_paymenttakes it, without the excluded rooms, when the booking saves.refund_paymentalso takes an optionalrequest_id: a retry with the same ID returns the payment and does not refund again. The UI change for this is proposed on #748.https_verify: "peer"is in the default settings, as the transport skips the certificate check without it.2024-06-20. On this version a partial capture counts the released amount as refunded, so the driver subtracts it.Known limits
send_invoicerefuses a different email.payments_spec.crhas 18 examples and passes in the harness.Created with Claude Opus 5.5 in Claude Code (T3 Code). The code was reviewed in 5 rounds by gpt-6.2-sol (Codex).
🤖 Generated with Claude Code