Skip to content

fix(provider-auth): send ppPublicKey in SEP-10 verify - #42

Merged
AquiGorka merged 2 commits into
mainfrom
fix/provider-auth-pp-public-key
Jun 17, 2026
Merged

fix(provider-auth): send ppPublicKey in SEP-10 verify#42
AquiGorka merged 2 commits into
mainfrom
fix/provider-auth-pp-public-key

Conversation

@AquiGorka

Copy link
Copy Markdown
Contributor

Problem

Every instant payment failed at the provider auth step — POS hung on "Processing payment…" — with the backend logging:

pay-platform ERR [executeInstant] Provider auth verify failed: 400 HTTP_PRO_001
             "Invalid payload … - [ppPublicKey] Required"

provider-platform #110 ("PP-aware SEP-10 verify") made POST /api/v1/stellar/auth require ppPublicKey in the body (it scopes the issued JWT + entityStatus to that PP). getProviderJwt still posted only { signedChallenge }, so the provider rejected it. Pre-existing — the provider has required this since #110; pay-platform was never updated.

Fix

  • getProviderJwt(ppUrl, ppPublicKey, deps) — thread the PP key through and include it in the verify body.
  • JWTs are now PP-scoped → cache key changed from ppUrl to ${ppUrl}|${ppPublicKey} (a token minted for one PP must not be reused for another served by the same provider URL).
  • Both callers (instant-execute, instant-submit) pass pp.publicKey, already in scope for the entity/bundles URL.

Verification

  • deno fmt --check / deno lint / deno check src/main.ts / deno task test:unit27 passed, 0 failed.
  • End-to-end against the local stack (playwright full-flow, restarted pay-platform on this code): Step 12 POS instant payment passes (15.6s), full flow 16/16 green — previously hung 60s and failed at Step 12.
  • version: 0.5.23 → 0.5.24.

provider-platform #110 made SEP-10 verify PP-aware: POST /api/v1/stellar/auth
now requires `ppPublicKey` and returns per-PP entityStatus. getProviderJwt
posted only { signedChallenge }, so the provider rejected every call with
400 'Invalid payload - [ppPublicKey] Required' — instant payments never
settled (POS hung on 'Processing payment...').

- getProviderJwt(ppUrl, ppPublicKey, deps): thread the PP key through and
  include it in the verify body.
- JWTs are now PP-scoped, so cache by `${ppUrl}|${ppPublicKey}` instead of
  ppUrl alone.
- callers (instant-execute, instant-submit) pass pp.publicKey (already in
  scope for the entity/bundles URL).

version: 0.5.23 -> 0.5.24
@AquiGorka
AquiGorka merged commit 12bd3cb into main Jun 17, 2026
7 checks passed
@AquiGorka
AquiGorka deleted the fix/provider-auth-pp-public-key branch June 17, 2026 17:18
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