PRE-3442: Fix Oauth when acc is unboarded and redirect#303
Open
adumont-payplug wants to merge 1 commit into
Open
PRE-3442: Fix Oauth when acc is unboarded and redirect#303adumont-payplug wants to merge 1 commit into
adumont-payplug wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to improve the admin OAuth flow for PayPlug payment methods by fixing the “Back” navigation in the payment method UI and making the OAuth callback more resilient when the PayPlug account isn’t fully onboarded.
Changes:
- Adds an admin “Back” button (cancel action) to payment method create/update headers via Twig hooks.
- Adjusts OAuth callback credential persistence to avoid undefined index errors when SDK responses don’t include
httpResponse. - Updates Composer metadata/scripts (but currently introduces a Composer configuration regression).
1. What's Good
- The admin back-navigation is implemented via Twig hooks (low-impact, avoids controller changes).
- The OAuth callback change prevents PHP notices when the SDK response doesn’t contain
httpResponse.
2. Summary table
| Dimension | Rating |
|---|---|
| Security | ✅ Fine |
| Correctness | ❌ High (Composer config regression; misleading OAuth success flash on partial failure) |
| Performance | ✅ Fine |
| Maintainability |
3. Closing one-liner
Fix the Composer.json regression (restore extra and remove hardcoded version) and adjust OAuth callback flash messaging so failures don’t still report success.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| templates/admin/payment_method/actions/cancel.html.twig | Adds an admin “Back” button action template for payment method screens. |
| config/twig_hooks/admin.yaml | Hooks the new cancel action into create/update payment method header actions. |
| src/Action/Admin/Auth/UnifiedAuthenticationController.php | Makes OAuth callback credential assignment null-safe (but needs better success/error feedback). |
| src/Controller/CompleteInfoController.php | Adds a PHPStan suppression for dynamic form field types (can be made type-safe instead). |
| composer.json | Adds a hardcoded version and rewrites script/extra config (currently breaks expected Symfony Flex extra config). |
Comment on lines
113
to
116
| $config = $gatewayConfig->getConfig(); | ||
| $config['live_client'] = $liveClientDataResult['httpResponse']; | ||
| $config['test_client'] = $testClientDataResult['httpResponse']; | ||
| $config['live_client'] = $liveClientDataResult['httpResponse'] ?? null; | ||
| $config['test_client'] = $testClientDataResult['httpResponse'] ?? null; | ||
| $gatewayConfig->setConfig($config); |
3188a03 to
4a25b70
Compare
jhoaraupp
approved these changes
Jun 22, 2026
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.
Description
PRE-3442: Fix Oauth when acc is unboarded and redirect
Motivation:
Related issue(s): Closes # PRE-3442
Type of Change
Checklist
Code Quality
Testing
Security & Ops