数据截至 (上游 commit 7fdd78df677a)
04 — 3D Secure 认证(两条路径)
银行有时要求买家「再证明一次你是你」(3D Secure 强认证)。在 agent 流程里,这一步谁来弹、怎么弹、结果怎么回填?ACP 给了两条路。源头:
rfcs/rfc.agentic_checkout.md(内联)与rfcs/rfc.delegate_authentication.md(独立 API)。
4.1 背景:3DS 是什么,为什么是 agent 的痛点
3D Secure 2(3DS2)是发卡行对一笔交易做的额外验证:有时无感(frictionless)——风控通过就放行;有时要挑战(challenge)——弹个窗让用户输 OTP/做生物识别。问题是:agent 跑在一个不一定有完整浏览器/UI 的环境里,这个「弹窗」怎么处理?这正是 03 章 interventions 协商里 3ds 那一项的现实落地。
4.2 路径一:checkout 内联认证
最轻的方式——认证嵌在 checkout 主线里(rfcs/rfc.agentic_checkout.md:158-164):
agent → POST /complete(不带 authentication_result)
◀── status: authentication_required
+ authentication_metadata(做认证要的信息)
agent 用 metadata 做 3DS 认证(无论成败)
agent → POST /complete(这次带上 authentication_result)
◀── status: completed + order
硬规则:
- 商家在需要认证时必须把
session.status置为authentication_required,且响应必须含authentication_metadata(rfcs/rfc.agentic_checkout.md:159、校验:339)。 - 处于该状态时,agent 必须做认证并把
authentication_result带回 complete——无论认证成败都要带(:160)。 - 若 agent 在该状态下不带
authentication_result就调 complete → 商家必须回 4XX,且type: invalid_request、code: requires_3ds、param: $.authentication_result(:162-164,错误实例:717-724)。
两个关键数据结构(rfcs/rfc.agentic_checkout.md:221-226):
AuthenticationMetadata:acquirer_details、directory_server(amex/mastercard/visa)、可选flow_preference(challenge/frictionless)。AuthenticationResult:outcome+outcome_details,后者含three_ds_cryptogram、electronic_commerce_indicator(ECI)、transaction_id、version——这些就是认证产出的、要随授权一起送给发卡行的「凭据」。complete 请求实例见:573-612。
注意区分两个相似的错误码(rfcs/rfc.agentic_checkout.md:200-201):requires_3ds 是「该带 authentication_result 没带」;intervention_required 是「这单需要某种 agent 根本不支持的介入」(由 03 章的能力协商决定)。别混。
4.3 路径二:独立的 delegate_authentication API
当认证逻辑复杂、需要 agent 直接和认证提供方对话(而不绕经商家)时,用这套独立 API(rfcs/rfc.delegate_authentication.md)。它的范围很窄但很明确:只做 3DS2、只做浏览器渠道、只做原生集成(非重定向)(:18-21)。
三步生命周期,会话化(返回 authentication_session_id,后续放进 URL path,rfcs/rfc.delegate_authentication.md:36):
① POST /delegate_authentication (建会话:商家+卡+金额)
◀── status: action_required(给 fingerprint 动作)
| pending(不需指纹)
| not_supported(卡未登记 → 可不走 3DS)
│
② POST /delegate_authentication/{id}/authenticate (提交指纹结果,触发认证)
◀── status: authenticated(无感成功)
| action_required(需 challenge)
| attempted / not_authenticated / rejected / ...
│
③ GET /delegate_authentication/{id} (取最终结果)
◀── authentication_result{ cryptogram, ECI, trans_status, ... }
端点与状态枚举见 rfcs/rfc.delegate_authentication.md:97-162。