定制 ucp-php-sdk/core 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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:

  1. Either implement capability interfaces directly, or implement platform adapters such as CatalogAdapterInterface or CheckoutAdapterInterface.
  2. If you use adapters, return the public SDK DTOs from those adapters.
  3. Wrap the adapters with the provided adapter-backed capabilities only if you want to keep descriptor wiring separate from your platform code.
  4. 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/pinned contains the committed upstream schema snapshot with its original folder layout.
  • resources/schema/generated contains 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
  • 点击次数: 7
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-07-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固