Skip to content

CI rehearsal only (do not merge) - #20

Open
michael-moffett wants to merge 2 commits into
mainfrom
pay-kit-166-php-gate-accepts-a1-next
Open

michael-moffett wants to merge 2 commits into
mainfrom
pay-kit-166-php-gate-accepts-a1-next

Conversation

@michael-moffett

Copy link
Copy Markdown
Member

Fork CI only. Do not merge.

michael-moffett and others added 2 commits October 5, 2026 14:43
Add `Gate::accepts(Protocol $p): bool` to the PHP SDK. This is the PHP `Gate::accepts` item from issue .

The spec (`docs/paykit-interface.md:154-158`) names `accepts(protocol)` as a Gate method in every SDK, and PHP does not have it.
@greptile-apps

greptile-apps Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

[Medium risk] Adds protocol acceptance logic to the payment gate.

The PR should not be merged until the new public predicate agrees with Config-based protocol selection.

Findings

  1. P1 Inherited protocol limits are ignored ▶

Summary

This PR adds a PHP Gate::accepts() predicate and tests, marks that interface item complete in the migration guide, and adds greptile.json.

  • The new predicate does not honor Config’s protocol allowlist when a gate inherits it.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  G["Gate: accept = null"] --> P["Gate::accepts(X402)"]
  G --> M["Middleware protocol selection"]
  P --> T["true, unless gate has fees"]
  M --> C["Config: accept = [MPP]"]
  C --> F["X402 excluded"]
Loading

Reviews (1) · Last reviewed commit: "greptile.json: review on request only"

Comment thread php/src/Gate.php
if ($p === Protocol::X402 && $this->hasFees()) {
return false;
}
return $this->accept === null || in_array($p, $this->accept, true);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Inherited protocol limits are ignored When a gate has no explicit accept list, this method returns true for any fee-free protocol without checking Config. With a configuration that accepts only MPP, gate->accepts(Protocol::X402) therefore returns true even though the middleware excludes X402. Callers of this new public method get an admission decision that contradicts the configured protocol limit.

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.

1 participant