ucp-php-sdk/core
Composer 安装命令:
composer require ucp-php-sdk/core
包简介
Core library for the UCP PHP SDK
README 文档
README
This package is the framework-free heart of the SDK.
Package name: ucp-php-sdk/core
It contains:
- immutable UCP models and enums
- capability, payment handler, and adapter contracts
- request context, security, negotiation, validation, and webhook service interfaces
- repository interfaces for SDK infrastructure state
- optional adapter-backed capability implementations for platform integrations
- committed schema artifacts for UCP
2026-04-08
How To Use It
Use this package when you want to build UCP support without taking a dependency on Symfony HTTP wiring.
Install:
composer require ucp-php-sdk/core:^0.0.1
Recommended integration pattern:
- Either implement capability interfaces directly, or implement platform adapters such as
CatalogAdapterInterfaceorCheckoutAdapterInterface. - If you use adapters, return the public SDK DTOs from those adapters.
- Wrap the adapters with the provided adapter-backed capabilities only if you want to keep descriptor wiring separate from your platform code.
- Expose those capabilities through the Symfony bundle or your own transport layer.
Example:
$capability = new AdapterBackedOrderCapability( new CapabilityDescriptor('dev.ucp.shopping.order', '2026-04-08', 'https://ucp.dev/specification/order/', 'https://ucp.dev/schemas/shopping/order.json'), $orderAdapter, );
This package must stay shop-agnostic. Do not put Shopware or other platform entity classes here.
Use ManagedSigningKey, PublicSigningKey, and ManagedSigningKeyRepositoryInterface for signing-key lifecycle work.
SDK-local canonical JSON is exposed through DeterministicJsonInterface.
Schema layout notes:
resources/schema/pinnedcontains the committed upstream schema snapshot with its original folder layout.resources/schema/generatedcontains the flattened request and response validator files the runtime loads directly.- See resources/schema/README.md for the exact split.
Internal runtime code under src/Internal is covered by the dead-code and coverage QA gates. Public contracts and DTOs are not treated as dead code just because the repo does not instantiate them directly.
For technical structure, stable API notes, and agent examples, see AGENTS.md.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 6
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-07-13