Skip to content

ADR-001 Phase 3.5 PR-5 — Disable tenant-side Gateway_Manager confirmations + status AJAX #1255

@superdav42

Description

@superdav42

ADR-001 Phase 3.5 PR-5 — Disable tenant-side Gateway_Manager in sovereign mode

For #1250. Cross-repo parent: Ultimate-Multisite/ultimate-multisite-multi-tenancy#43. Sibling: PR-4 (Checkout disable — same reasoning).

Goal

Since checkout runs on the main site (PR-4), gateway return URLs and payment-status polling also land on the main site. The tenant-side Gateway_Manager::process_gateway_confirmations and ajax_check_payment_status should not fire in sovereign tenants.

File

inc/managers/class-gateway-manager.php.

Changes

Method:line Action
process_gateway_confirmations() :105 Early-return when defined( 'WU_MT_SOVEREIGN_TENANT' ). Hook still registers but does nothing.
ajax_check_payment_status() :122 Same.
maybe_process_webhooks() :111 No change — already is_main_site()-gated per audit §1 row 25. Verify the gate still applies.

Reference pattern

public function process_gateway_confirmations() {

    if ( defined( 'WU_MT_SOVEREIGN_TENANT' ) && WU_MT_SOVEREIGN_TENANT ) {
        return;
    }

    // ...existing body...
}

Verification

  1. Non-sovereign tenant: gateway confirmations and payment-status AJAX behave exactly as before.
  2. Sovereign tenant: template_redirect priority -99999 hook fires but process_gateway_confirmations returns immediately. Confirm via WP_DEBUG log that no wu_payments read happens in sovereign context.
  3. Main site: gateway return URLs (e.g. Stripe /?wu-stripe-confirmation=...) work unchanged — they land on the main site, which is non-sovereign, so the disable doesn't apply.
  4. Webhook handler: confirm maybe_process_webhooks still fires correctly on the main site for inbound webhook URLs.

Branch

dev-main integration branch.

LOC estimate

~10 lines (2 guards).

Tier

tier:1 — trivial.


aidevops.sh v3.17.27 plugin for OpenCode v1.15.7 with claude-haiku-4-5 spent 5h 48m and 38 tokens on this as a headless worker.

Metadata

Metadata

Assignees

Labels

adr-001ADR-001 sovereign tenant isolation workenhancementNew feature or requeststatus:in-reviewPR open, awaiting review/mergetier:1~½ day, single-file or trivially-scoped work

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions