fix: complete mobile payment workflow end-to-end#337
Merged
Conversation
- AssignmentDto: add BalanceDue and InvoiceId fields - AssignmentService: pre-fetch latest invoice per job, populate BalanceDue on assignments - IPaymentProcessor: add CreateOneTimeCheckoutSessionAsync - StripePaymentProcessor: implement CreateOneTimeCheckoutSessionAsync using Stripe Checkout Sessions (hosted page with redirect URL) instead of PaymentIntents (client secret only) - SquarePaymentProcessor: implement CreateOneTimeCheckoutSessionAsync (delegates to existing hosted checkout flow) - PaymentSessionRequest: add JobId field - PaymentController.Checkout: route one-time payments through CreateOneTimeCheckoutSessionAsync; when JobId provided without InvoiceId, call EnsureInvoiceForPaymentAsync to auto-resolve - IInvoiceService / InvoiceService: add EnsureInvoiceForPaymentAsync - finds existing invoice, falls back to creating from accepted estimate (Option A), falls back to quick single-line-item draft invoice from provided amount (Option B) - StripeWebhookService: fix HandleCheckoutSessionAsync to handle mode=payment sessions (previously bailed immediately on missing SubscriptionId); on success calls MarkPaidAsync, fires client and org payment notifications, marks onboarding step complete
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
Closes the loop on mobile payments — Stripe now returns a hosted checkout URL, invoices are auto-created when missing, and the webhook correctly marks invoices paid after the customer pays.
Changes
Invoice auto-resolution (\EnsureInvoiceForPaymentAsync)
When a mobile worker taps Collect Payment, the API runs this waterfall:
Stripe checkout URL fix
Stripe webhook fix
\HandleCheckoutSessionAsync\ previously returned immediately for any session without a \SubscriptionId\ (i.e. every one-time payment). Now:
Assignment BalanceDue surfacing
Related
Pair PR in JobFlow-Mobile: fix: wire mobile payment flow end-to-end