stellarsecurity/stellarsecurity-commerce-laravel
Composer 安装命令:
composer require stellarsecurity/stellarsecurity-commerce-laravel
包简介
Laravel client for Stellar Commerce Core/Base API (Client -> UI API -> Base API).
README 文档
README
Laravel client package used by UI APIs to call the Stellar Commerce Core/Base API.
Install
composer require stellarsecurity/stellarsecurity-commerce-laravel
Publish config
php artisan vendor:publish --tag=stellarsecurity-commerce-laravel-config
Env
STELLAR_COMMERCE_CORE_BASE_URL=http://127.0.0.1:8000 STELLAR_COMMERCE_CORE_API_PREFIX=/api/v1 STELLAR_COMMERCE_CORE_BASIC_AUTH_ENABLED=true STELLAR_COMMERCE_CORE_BASIC_AUTH_USER=stellar STELLAR_COMMERCE_CORE_BASIC_AUTH_PASS=CHANGE_THIS # Optional. These are already the package defaults if omitted. STELLAR_COMMERCE_CORE_TIMEOUT_SECONDS=30 STELLAR_COMMERCE_CORE_CONNECT_TIMEOUT_SECONDS=10 STELLAR_COMMERCE_CORE_RETRY_TIMES=5 STELLAR_COMMERCE_CORE_RETRY_SLEEP_MS=1000 STELLAR_COMMERCE_CORE_RETRY_MULTIPLIER=2 STELLAR_COMMERCE_CORE_RETRY_MAX_SLEEP_MS=10000
Important trust boundary
The UI API must not send money amounts like shipping/tax/discount. Those must be computed by the Commerce Core API.
Send:
- items
- shipping address (if physical)
- shipping_method (optional)
- coupon_code (optional)
Usage
use StellarSecurity\CommerceLaravel\Contracts\CommerceClientContract; use StellarSecurity\CommerceLaravel\DTO\CheckCouponCodeRequest; use StellarSecurity\CommerceLaravel\DTO\CreateOrderRequest; use StellarSecurity\CommerceLaravel\DTO\OrderItem; public function __construct(private CommerceClientContract $commerce) {} $req = new CreateOrderRequest( idempotencyKey: (string) \Illuminate\Support\Str::uuid(), userId: null, buyerRef: (string) \Illuminate\Support\Str::uuid(), currency: 'EUR', items: [ new OrderItem($variantId, 1) ], shipping: null, shippingMethod: null, couponCode: null, meta: ['channel' => 'direct'] ); $result = $this->commerce->createOrder($req); // Check a coupon code (exists + discount info) $couponResult = $this->commerce->checkCouponCode( new CheckCouponCodeRequest(couponCode: 'TEST10') );
Retry configuration
The client retries transient Commerce Core failures without requiring a queue. Configure the behaviour with environment variables: If these env variables are not present, the same safe defaults are used inside the client code.
STELLAR_COMMERCE_CORE_TIMEOUT_SECONDS=30 STELLAR_COMMERCE_CORE_CONNECT_TIMEOUT_SECONDS=10 STELLAR_COMMERCE_CORE_RETRY_TIMES=5 STELLAR_COMMERCE_CORE_RETRY_SLEEP_MS=1000 STELLAR_COMMERCE_CORE_RETRY_MULTIPLIER=2 STELLAR_COMMERCE_CORE_RETRY_MAX_SLEEP_MS=10000
Retries are attempted for connection errors and HTTP 408, 429, 500, 502, 503, and 504 responses.
stellarsecurity/stellarsecurity-commerce-laravel 适用场景与选型建议
stellarsecurity/stellarsecurity-commerce-laravel 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 146 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 12 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 stellarsecurity/stellarsecurity-commerce-laravel 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 stellarsecurity/stellarsecurity-commerce-laravel 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 146
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2025-12-22