Skip to content

PRE-3603: Overload scalapay min/max amounts from API - #317

Open
adumont-payplug wants to merge 1 commit into
developfrom
feature/PRE-3603_overload_min_max_scalapay
Open

PRE-3603: Overload scalapay min/max amounts from API#317
adumont-payplug wants to merge 1 commit into
developfrom
feature/PRE-3603_overload_min_max_scalapay

Conversation

@adumont-payplug

@adumont-payplug adumont-payplug commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Description

Scalapay currently shows at checkout for any cart amount within the limits reported by the PayPlug API, with no way for the merchant to tighten that range. This adds merchant-configurable min/max amount limits for Scalapay, mirroring the existing amount-filtering mechanism already used for the other PPRO gateways.

  • Two new optional fields (min_amount, max_amount) on the Scalapay gateway admin config, rendered as MoneyType (EUR) inputs. Left blank, they fall back to whatever the PayPlug API reports for the account.
  • SupportedMethodsProvider now applies the merchant's configured bounds (when set) instead of the raw API bounds when filtering Scalapay at checkout.
  • A new save-time validator (IsScalapayAmountRangeValid) rejects configs where min > max, or where either value falls outside the live API-reported range — the merchant can only narrow the range, never widen it beyond what PayPlug authorizes.

Motivation: Merchants want to control which cart sizes see Scalapay as a payment option (UX and fee control), similar to existing carve-outs for other financing/BNPL methods.

Related issue(s): Closes [PRE-3603](https://payplug-prod.atlassian.net/browse/PRE-3603)


Type of Change

  • ✨ New feature (non-breaking change that adds functionality)

Checklist

Code Quality

  • Code is linted and formatted (ECS clean)
  • No unnecessary commented-out code or debug logs
  • No hardcoded values (bounds come from the live API, not hardcoded constants)

Testing

  • Unit tests added / updated (SupportedMethodsProviderTest, PaymentMethodValidatorTest, new ScalapayGatewayConfigurationTypeExtensionTest, new IsScalapayAmountRangeValidValidatorTest)
  • New/changed code is covered by tests

Security & Ops

  • No sensitive data or secrets introduced
  • Logging and error handling are appropriate (API failures during validation fail open — a transient PayPlug API error doesn't block saving the payment method; existing behavior for other save-time checks)

@adumont-payplug adumont-payplug self-assigned this Sep 1, 2026

@hdelaforce-payplug hdelaforce-payplug left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Automated review pass — 7 findings, most severe first. #1 is the one I'd block merge on: it's a config the admin form actively allows the merchant to save, and it silently disables Scalapay at checkout with zero diagnostic.

Comment thread src/Gateway/Validator/Constraints/IsScalapayAmountRangeValidValidator.php Outdated
Comment thread src/Provider/SupportedMethodsProvider.php Outdated
Comment thread src/Provider/SupportedMethodsProvider.php Outdated
Comment thread src/Gateway/Validator/Constraints/IsScalapayAmountRangeValidValidator.php Outdated
Comment thread src/Gateway/Validator/Constraints/IsScalapayAmountRangeValidValidator.php Outdated
@adumont-payplug
adumont-payplug force-pushed the feature/PRE-3603_overload_min_max_scalapay branch 2 times, most recently from b3e80fc to c1d700f Compare September 3, 2026 09:19

@claude claude Bot 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.

Claude Code Review

Claude Code Review is paused for this repository. To reconnect it, an admin of this repository's GitHub organization (or the account owner, for personal repositories) who can also manage your Claude organization's Code Review settings needs to re-link GitHub in Code Review settings. This is a one-time step.

Tip: disable this comment in your organization's Code Review settings.

@adumont-payplug
adumont-payplug force-pushed the feature/PRE-3603_overload_min_max_scalapay branch 3 times, most recently from 6919a97 to 85ed560 Compare September 3, 2026 12:35
@adumont-payplug
adumont-payplug force-pushed the feature/PRE-3603_overload_min_max_scalapay branch from 85ed560 to d8dcc57 Compare September 3, 2026 12:55
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.

2 participants