定制 stellarsecurity/stellarsecurity-commerce-laravel 二次开发

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

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

stellarsecurity/stellarsecurity-commerce-laravel

最新稳定版本:v1.0.1

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

STELLAR_COMMERCE_CORE_TIMEOUT_SECONDS=10
STELLAR_COMMERCE_CORE_CONNECT_TIMEOUT_SECONDS=5
STELLAR_COMMERCE_CORE_RETRY_TIMES=2
STELLAR_COMMERCE_CORE_RETRY_SLEEP_MS=200

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\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);

统计信息

  • 总下载量: 83
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2025-12-22