fix payment not moving process froward#4152
Conversation
Co-authored-by: Copilot <copilot@github.com>
📝 WalkthroughWalkthroughThe payment processing flow is enhanced with a new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
/publish |
PR release:
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/features/payment/PaymentProvider.tsx`:
- Around line 90-97: The effect in useEffect that calls skipPayment() can run
repeatedly; add a one-time guard (e.g., a ref or state like hasAutoSkippedRef or
autoSkipAttempted) used inside the effect so skipPayment() is only invoked once
per mount/flow when isPaymentProcess && paymentCompleted && !isPdf &&
!appSupportsPaymentWebhooks(altinnNugetVersion) is true; update the dependency
list to include the guard if needed and set the guard immediately after calling
skipPayment() to deduplicate further calls from remounts or dependency updates.
In `@src/layout/Payment/PaymentComponent.tsx`:
- Around line 39-40: The isChecking flag was made constant false, removing the
in-flight guard; restore a React state pair (e.g., const [isChecking,
setIsChecking] = React.useState(false)), use setIsChecking(true) before calling
navigateBasedOnProcess(true) and setIsChecking(false) in finally (or after
await) to ensure the async check is single-flight, and keep the existing
disabled = isAnyProcessing || isConfirming || isRejecting || isChecking so the
Next button is disabled while the check runs.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 7539152f-1c0b-47cc-a2f1-9cc0adbc2dd1
📒 Files selected for processing (2)
src/features/payment/PaymentProvider.tsxsrc/layout/Payment/PaymentComponent.tsx
|


Description
Some users were confused by needing to use the Next button when not on the latest backend version after the update that let the backends webhook move the process forward.
https://digdir-samarbeid.slack.com/archives/C095TR6HD3J/p1777533515700489?thread_ts=1777452750.636159&cid=C095TR6HD3J
Related Issue(s)
Verification/QA
kind/*andbackport*label to this PR for proper release notes groupingSummary by CodeRabbit
New Features
Bug Fixes