Skip to content

Expose the gateway factory name as QuickpayGatewayFactory::NAME - #55

Merged
loevgaard merged 1 commit into
2.xfrom
feature/factory-name-constant
Aug 10, 2026
Merged

Expose the gateway factory name as QuickpayGatewayFactory::NAME#55
loevgaard merged 1 commit into
2.xfrom
feature/factory-name-constant

Conversation

@loevgaard

Copy link
Copy Markdown
Member

Closes #54. Upstream half of Setono/SyliusQuickpayPlugin#103.

use Setono\Payum\Quickpay\QuickpayGatewayFactory;

QuickpayGatewayFactory::NAME;   // 'quickpay'

This package sets payum.factory_name, so it is the authority on the value — but it exposed no
constant, leaving every consumer to repeat the literal. The factory now uses the constant in its own
default config, so the two cannot drift, and the README documents it where the gateway options are
described.

On the test

It asserts the literal 'quickpay' directly rather than only through the constant. The value, not
the symbol, is the contract: consumers store it as factoryName on their gateway configurations, so
changing it would orphan every one of them. Asserting the constant against itself would prove nothing
and let a rename through unnoticed.

Two things I did not do

Verified

226 tests, PHPStan level 8, ECS. No behaviour change — the constant resolves to the same string the
factory already published.

This package sets payum.factory_name, so it is the authority on the value — but it
exposed no constant, leaving every consumer to repeat the literal. Setono/
SyliusQuickpayPlugin#103 counts four PHP call sites there already, with more
coming from the RefundPlugin integration and the "is this a Quickpay payment?"
guards.

The factory now uses the constant in its own default config, so the two cannot
drift.

The test asserts the literal 'quickpay' directly rather than only through the
constant. The value, not the symbol, is the contract: consumers store it as
factoryName on their gateway configurations, so changing it would orphan every one
of them — asserting the constant against itself would prove nothing and let a
rename through unnoticed.

Closes #54
@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.43%. Comparing base (a4619b7) to head (87eb2b7).

Additional details and impacted files
@@            Coverage Diff            @@
##                2.x      #55   +/-   ##
=========================================
  Coverage     97.43%   97.43%           
  Complexity      126      126           
=========================================
  Files            14       14           
  Lines           351      351           
=========================================
  Hits            342      342           
  Misses            9        9           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@loevgaard
loevgaard merged commit 994de38 into 2.x Aug 10, 2026
21 checks passed
@loevgaard
loevgaard deleted the feature/factory-name-constant branch August 10, 2026 13:11
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.

Expose the gateway factory name as a constant (QuickpayGatewayFactory::NAME)

1 participant