步骤4 — 减少PHP占用的空间

当前PHP模块处理必须保持处于进程中的五个事项(请参阅拆分付款POC:架构和设计决策)。 随着Adobe Commerce的API表面日渐成熟,其中某些功能可能会变得可移动:

将来可能可以移动:

  • 商店积分REST API正在不断发展 — 未来的版本可能支持在订单后应用积分或将其应用到非活动的购物车
  • 随着更多Commerce操作变得非同步安全,阈值保护可以移动到预排序的API Mesh解析器

不可移动(架构约束):

  • 除非Commerce通过API优先扩展点公开干净的挂接,否则placeOrder()之前的报价操作将始终需要进程内代码
  • REST端点(/V1/split-payment/*)特定于此功能;它们驻留在Commerce中,因为它们调用Commerce内部服务

步骤5 — 向App Builder添加更多工作流

当前的PoC执行一项操作:侦听订单下达,然后启用“接受/拒绝”。 自然扩展:

接受前​欺诈得分:
在payment-orchestrator中,在记录待处理现金后,先调用欺诈评分API,然后再将编排结果视为最终结果。 如果分数超过阈值,则自动拒绝而不是等待操作员操作。

通知电子邮件:
当payment-accept成功时,会触发一封电子邮件(通过Adobe Campaign、SendGrid或任何HTTPS API),通知客户其现金付款已确认。

忠诚度积分奖励:
确认现金后,调用忠诚度API以奖励积分。 这是纯粹的App Builder — 不需要PHP。

超时处理:
添加一个计划的App Builder操作(使用app.config.yaml中的cron),该操作扫描超过X天的split_cash_status = 'pending'订单并自动拒绝它们。

步骤6 — 部署到生产

已为Stage工作区配置PoC。 移至生产环境:

# Switch to production workspace
aio app use
# Select Production workspace

# Update .env for production
# (same credentials, but production Commerce base URL)

# Deploy
aio app deploy

生产准备清单:

  • [ 已设置] DEMO_UI_SECRET(或已使用Experience Cloud UI替换演示仪表板)
  • [ 生产环境中的] LOG_LEVEL=warn或error (不是debug)
  • [ ] PAYMENT_THRESHOLD与Commerce生产配置匹配
  • [ .env中的]个Commerce集成凭据用于专用生产集成(非暂存)
  • [ ] Fastly IP已使用App Builder生产出口IP (Commerce Cloud)更新
  • [ 已在生产工作区中确认]个I/O事件注册

架构演变图

PoC (this tutorial)
┌─────────────────────────────────────────────────┐
│  Commerce                 App Builder            │
│  ┌─────────────┐         ┌──────────────────┐   │
│  │  PHP Module │◄────────│ payment-orchestr │   │
│  │  REST API   │────────►│ payment-accept   │   │
│  │  Checkout UI│         │ payment-decline  │   │
│  └─────────────┘         │ demo-dashboard   │   │
└─────────────────────────────────────────────────┘

Phase 2: Experience Cloud UI
┌─────────────────────────────────────────────────┐
│  Commerce                 App Builder            │
│  ┌─────────────┐         ┌──────────────────┐   │
│  │  PHP Module │◄────────│ payment-orchestr │   │
│  │  REST API   │────────►│ payment-accept   │   │
│  │  Checkout UI│         │ payment-decline  │   │
│  │             │         │ Admin UI ext.    │   │
│  └─────────────┘         └──────────────────┘   │
└─────────────────────────────────────────────────┘

Phase 3: Real ERP + API Mesh
┌──────────────────────────────────────────────────────────┐
│  ERP  ──►  App Builder  ──►  API Mesh  ──►  Commerce     │
│            (orchestrator)   (gateway)    (PHP module      │
│            (accept)                      REST surface)    │
└──────────────────────────────────────────────────────────┘
已自动翻译
使用语言选择器查看此页面的英文版本。
翻译有帮助吗?

Ask AI

Not sure where to start?
Ask me anything about Adobe products.

Type your question or pick a suggestion below.

Use of this AI chatbot is subject to Adobe's Privacy Policy. Don't share sensitive data. AI responses are not your Content, may be inaccurate, and any offers provided are non-binding. Generative AI Terms.