Skip to content

fix(config): drop the demo fallback for the channel setting - #107

Merged
jfrosorio merged 1 commit into
masterfrom
fix-106
Oct 30, 2026
Merged

jfrosorio merged 1 commit into
masterfrom
fix-106

Conversation

@jfrosorio

Copy link
Copy Markdown
Contributor

Closes #106.

The channel setting fell back to demo when EUPAGO_CHANNEL was 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.php no longer has a fallback for channel.
  • A new CodeTech\EuPago\Exceptions\MissingConfiguration exception is thrown by CallbackRequest when a callback arrives while the channel or the API key is blank, instead of the callback being rejected as forged.
  • UPGRADE.md has a v3.11.0 entry for apps that relied on the demo fallback or published the config; README and docs/configuration.md / docs/callbacks.md describe the new behaviour.
  • Feature tests cover the exception for both blank settings.

Copilot AI lite review requested due to automatic review settings October 30, 2026 08:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 demo fallback for config('eupago.channel') and document the new “no default” behavior.
  • Throw CodeTech\EuPago\Exceptions\MissingConfiguration when a callback arrives while eupago.channel or eupago.api_key is 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

@jfrosorio jfrosorio self-assigned this Oct 30, 2026
@jfrosorio
jfrosorio merged commit 54e2aa2 into master Oct 30, 2026
18 checks passed
@jfrosorio
jfrosorio deleted the fix-106 branch October 30, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drop the 'demo' fallback for the channel setting

2 participants