跳转到主要内容
This page documents a legacy SDK. Starting a new integration? Use the Yuno SDK. Already on a legacy SDK? Follow the migration guide.The new Yuno SDK (Web v2.x, iOS v3.x, Android v3.x, React Native v2.x) replaces the Full, Lite, Seamless, Render, Headless, and Secure Fields SDKs with one API across every platform. Legacy SDKs remain supported side by side during the transition and are scheduled for deprecation in 2027. Contact your Account Manager for migration planning.
如果您的 checkout 目前运行在 Stripe Elements 上,迁移到 Yuno 改变的是 checkout 层,您的 Stripe 账户保持不变。Yuno 将 Stripe 作为您启用的服务提供商之一进行连接,因此现有的 Stripe 处理会继续正常运行,同时您可以添加路由、其他服务提供商以及 Yuno 的 checkout。本页面将每个 Stripe 概念对应到您在 Yuno 上使用的内容。

概念

Checkout 组件

支付流程对比

  1. 服务器创建 PaymentIntent 并返回 client_secret。
  2. 浏览器使用该 secret 挂载 Payment Element。
  3. 浏览器调用 stripe.confirmPayment。
  4. Stripe 进行重定向或直接完成;您的服务器监听 payment_intent.succeeded。
两种路径共有的一个结构性差异:您的私钥永远不会发送到浏览器。结账会话在您的服务器上创建,对于 Lite SDK 和 Secure Fields,支付也在服务器上创建。

Webhooks

Yuno 为每个对象发送一种事件类型,并在 payload 中携带状态,因此多个 Stripe 事件会合并为一个 Yuno 事件。请参阅 Webhooks 和 配置 Webhooks。 每个 Yuno webhook 都携带 data.idempotency_key 和 x-hmac-signature 标头;请按照 验证 Webhook 签名 中的说明进行验证。

已保存的卡片

保存在 Stripe 中的卡片可以迁移到 Yuno,这样回头客无需重新输入。Yuno 支持通过 令牌迁移流程 在服务提供商之间进行经过 PGP 加密的令牌迁移。由于 Yuno 会为每个存储令牌保存网络交易 id,定期系列扣款无需重新认证即可继续;请参阅 存储凭证。

迁移顺序

1

在 Yuno 上连接 Stripe

将您的 Stripe 账户添加为连接,并将其放到一条路由上。此时购物者不会察觉任何变化。请参阅 设置支付连接。
2

替换 checkout

按照 React 和 Next.js 将 Payment Element 替换为 Seamless SDK,或将 Card Element 替换为 Lite SDK 或 Secure Fields。先在同一个 Stripe 连接上运行,以便在相同条件下比较批准率。
3

迁移 webhook

将您现有的处理程序订阅到上表中的 Yuno 事件,并将状态逻辑切换为 Yuno 的 status 和 sub_status 值。
4

迁移已保存的卡片

执行令牌迁移,并将已存储卡片的扣款切换为使用 vaulted_token。
5

添加服务提供商和路由

流量稳定后,添加其他服务提供商,并让 路由 和 Monitors 决定每笔支付的去向。