[QRD-7899] feat(configuration-webhook): add affiliate config topic#64
Open
javigutierrezfer wants to merge 1 commit into
Open
[QRD-7899] feat(configuration-webhook): add affiliate config topic#64javigutierrezfer wants to merge 1 commit into
javigutierrezfer wants to merge 1 commit into
Conversation
Add a reusable "affiliate" configuration topic to ConfigurationWebhookAPI so payment plugins receive affiliate (Prime) config (enabled, offerId, securityToken) through the existing signed config-push mechanism, with no manual UI (Option A, autoconfig). Mirrors the AdvancedSettings vertical slice: domain model/service, per-store persistence (entity + repository), get/save topic handlers, and wiring in the Topics enum and BootstrapComponent. Signature validation and topic dispatch are reused as-is. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What is the goal?
Add a reusable "affiliate" configuration topic to integration-core's
ConfigurationWebhookAPI, so every seQura payment plugin can receive its affiliate (Prime) configuration — enabled, Offer ID, Security Token — through the existing signed config-push mechanism, with no manual UI. Part of the autoconfiguration-first approach (Option A) of epic QRD-7897.References
woocommerce-sequra#163 (consumer plugin, QRD-7898)How is it being implemented?
Mirrors the simplest existing topic, AdvancedSettings, as an end-to-end vertical slice:
Domain/Affiliate):AffiliateSettingsmodel (isEnabled,offerId,securityToken),AffiliateSettingsRepositoryInterface, andAffiliateSettingsService— the reusable read service plugins use to obtain the resolved config.DataAccess/Affiliate):AffiliateSettingsentity (indexed bystoreId) + repository.SaveAffiliateSettingsRequest,AffiliateSettingsResponse, andGet/Savetopic handlers.get-affiliate-settings/save-affiliate-settingsadded to theTopicsenum (andALL_TOPICS), and registered inBootstrapComponent(repository, service, topics, handler services).Signature validation and the topic dispatch are reused as-is; no new signing logic is introduced.
Caveats
isEnabled/offerId/securityToken) are the proposed config contract and may be adjusted once the cross-team contract is confirmed (decision D5 in the epic); the structure won't change.Does it affect (changes or update) any sensitive data?
The Security Token is a credential-like value. It is persisted per store like the other settings and only delivered through the existing signed config-push. It is not logged.
How is it tested?
Automatic tests (PHPUnit):
AffiliateSettingsentity test, repository test (get/set/update/delete + multistore isolation), and service test.ConfigurationWebhookAPITest: save persists, get returns the persisted config, get with no settings returns empty.Full suite: 819 tests OK (16 new), 0 regressions. PHPCS (PSR12) clean. PHPStan level 6: no errors.
How is it going to be deployed?
Standard deployment (library release/tag, consumed by the payment plugins).
🤖 Generated with Claude Code