Skip to content

fix(ack-pay): accept DID URIs for serviceCallback - #208

Open
kutluhaneth46 wants to merge 1 commit into
agentcommercekit:mainfrom
kutluhaneth46:cursor/fix-service-callback-did-uri-88c1
Open

fix(ack-pay): accept DID URIs for serviceCallback#208
kutluhaneth46 wants to merge 1 commit into
agentcommercekit:mainfrom
kutluhaneth46:cursor/fix-service-callback-did-uri-88c1

Conversation

@kutluhaneth46

@kutluhaneth46 kutluhaneth46 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Reuse urlOrDidUri for paymentRequest.serviceCallback in Valibot and Zod.
  • Matches the documented URL-or-DID contract and sibling paymentService / receiptService fields.
  • Add schema parity tests for DID acceptance and invalid rejection.

Testing

  • pnpm --filter @agentcommercekit/ack-pay exec vitest run src/schemas/schemas.test.ts

AI usage disclosure

Assisted by Cursor. I verified the docs/schema mismatch, implemented the dual-schema change, and ran the focused tests myself.

Fixes #205

Summary by CodeRabbit

  • Bug Fixes

    • Payment request service callbacks now accept DID URIs in addition to HTTPS URLs.
    • Invalid callback values continue to be rejected during validation.
  • Tests

    • Added coverage for valid URLs, valid DID URIs, and invalid callback values across supported validation implementations.

Align paymentRequest.serviceCallback with paymentService/receiptService
and the documented URL-or-DID contract by reusing urlOrDidUri in both
Valibot and Zod schemas.

Fixes agentcommercekit#205
@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 93dd4d3c-3932-46ef-a920-2364f803167a

📥 Commits

Reviewing files that changed from the base of the PR and between 7d23f83 and ac37a58.

📒 Files selected for processing (4)
  • .changeset/ack-pay-service-callback-did-uri.md
  • packages/ack-pay/src/schemas/schemas.test.ts
  • packages/ack-pay/src/schemas/valibot.ts
  • packages/ack-pay/src/schemas/zod.ts

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


Walkthrough

paymentRequest.serviceCallback now accepts HTTPS URLs and DID URIs in both Valibot and Zod schemas. Tests cover valid and invalid values. A patch changeset documents the schema update.

Changes

Payment request callback validation

Layer / File(s) Summary
Accept DID URIs in payment request schemas
packages/ack-pay/src/schemas/valibot.ts, packages/ack-pay/src/schemas/zod.ts
Both schemas use urlOrDidUri for the optional serviceCallback field.
Validate the expanded callback contract
packages/ack-pay/src/schemas/schemas.test.ts, .changeset/ack-pay-service-callback-did-uri.md
Tests cover HTTPS URLs, DID URIs, and invalid values. The changeset declares a patch release.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to ac37a

Payment request callbacks now consistently accept documented DID URIs alongside URLs across both schema implementations, with coverage for valid and invalid inputs. No current merge-blocking risk remains.

Suggested reviewers: efedurmaz16

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: allowing DID URIs for ack-pay serviceCallback.
Linked Issues check ✅ Passed The changes satisfy issue #205. Both Valibot and Zod now reuse urlOrDidUri for paymentRequest.serviceCallback, and parity tests cover valid DID URIs, HTTPS URLs, and invalid values.
Out of Scope Changes check ✅ Passed All changes support the linked issue. The schema updates, parity tests, and patch changeset are directly related to accepting DID URIs for serviceCallback.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

bug(ack-pay): paymentRequest.serviceCallback rejects DID URIs despite docs and sibling fields

1 participant