Repository navigation
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The change replaces a risky silent demo fallback with an explicit missing-configuration exception during callbacks, updates documentation accordingly, and adds feature tests covering the new failure behavior without noting any outstanding issues.
No open issues 🎉
What changed in this PR
This PR removes the implicit demo default for the channel configuration to prevent production apps from silently rejecting all payment callbacks when EUPAGO_CHANNEL is missing, and instead makes missing callback-critical configuration fail loudly via a dedicated exception.
Changes:
- Remove the
demofallback forconfig('eupago.channel')and document the new “no default” behavior. - Throw
CodeTech\EuPago\Exceptions\MissingConfigurationwhen a callback arrives whileeupago.channeloreupago.api_keyis blank. - Add feature coverage ensuring callbacks surface missing configuration as an exception.
| File | Description |
|---|---|
config/eupago.php |
Drops the demo fallback for channel and documents the rationale directly in the config comments. |
src/Http/Requests/CallbackRequest.php |
Adds a pre-validation guard that throws on blank channel/api_key during callbacks. |
src/Exceptions/MissingConfiguration.php |
Introduces a dedicated exception for missing/blank required settings during callback handling. |
tests/Feature/CallbackTest.php |
Adds feature coverage asserting missing config is reported via MissingConfiguration rather than a forged-callback rejection. |
tests/Feature/PackageBootTest.php |
Updates boot/merge expectations to no longer rely on a demo channel default. |
UPGRADE.md |
Documents the breaking behavior change and how to migrate apps that relied on the implicit demo fallback. |
README.md |
Clarifies that the configured channel must match the backoffice channel name exactly. |
docs/configuration.md |
Explains that neither EUPAGO_CHANNEL nor EUPAGO_API_KEY has a default and that missing values surface via exception on callback. |
docs/callbacks.md |
Documents the new exception behavior when callback-critical settings are blank. |
Review effort: Lite
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.
Closes #106.
The
channelsetting fell back todemowhenEUPAGO_CHANNELwas unset. Since every callback is rejected unless its channel matches the setting, an app that forgot the variable booted normally and silently confirmed no payment.config/eupago.phpno longer has a fallback forchannel.CodeTech\EuPago\Exceptions\MissingConfigurationexception is thrown byCallbackRequestwhen a callback arrives while the channel or the API key is blank, instead of the callback being rejected as forged.demofallback or published the config; README and docs/configuration.md / docs/callbacks.md describe the new behaviour.