跳到主要内容

设置 Stripe 网关 (v2)

重要提示:本文涉及 Ultimate Multisite 2.x 版本。

您可以在我们的支付设置页面激活多达四种支付方式:Stripe、Stripe Checkout、PayPal 和 Manual。在本文中,我们将了解如何与 Stripe 集成。

启用 Stripe

要在您的网络上启用 Stripe 作为可用支付网关,请转到 Ultimate Multisite > Settings > Payments 并在“Active Payment Gateways”部分勾选 StripeStripe Checkout 旁边的切换开关。

Enabling Stripe in active payment gateways

Stripe 与 Stripe Checkout 对比:

Stripe: 该方法将在结账时显示一个输入信用卡号码的空间。

Stripe inline credit card field during checkout

Stripe Checkout: 该方法将在结账时将客户重定向到 Stripe Checkout 页面。

Stripe Checkout redirect page during checkout

获取您的 Stripe API 密钥

一旦 Stripe 被启用为支付网关,您需要填写 Stripe Publishable KeyStripe Secret Key 字段。您可以通过登录 Stripe 账户获取这些信息。

注意: 您可以激活 Sandbox mode 来测试支付方式是否正常工作。

Stripe API key fields and sandbox mode toggle

在您的 Stripe 仪表盘中,点击右上角的 Developers,然后在左侧菜单中选择 API Keys

Stripe dashboard Developers section with API Keys

您可以使用 Test Data(以测试集成是否在您的生产站点上正常工作)或不使用。要更改此设置,请切换 Viewing test data 开关。

Stripe Viewing test data toggle

复制 Publishable keySecret key(来自 Token 列)的值,并粘贴到 Ultimate Multisite Stripe Gateway 字段中。然后点击 Save Changes

Stripe publishable and secret key values

Pasting Stripe keys in Ultimate Multisite settings

设置 Stripe Webhook

Stripe 发送 webhook 事件,任何在 您的 Stripe 账户 上发生的事件都会通知 Ultimate Multisite。

点击 Developers,然后在左侧菜单中选择 Webhooks 项。随后在右侧点击 Add endpoint

Stripe Webhooks page with Add endpoint button

您需要一个 Endpoint URL。Ultimate Multisite 会自动生成该 URL,您可以在 Ultimate Multisite Stripe Gateway 部分的 Webhook Listener URL 字段下方找到。section_._

Webhook Listener URL field in Stripe gateway settings

复制 端点 URL 并 粘贴 到 Stripe 的 Endpoint URL 字段。

Pasting endpoint URL in Stripe webhook setup

接下来选择一个 Event。在此选项下,您只需勾选 Select all events 框并点击 Add events。然后点击 Add Endpoint 保存更改。

Selecting all events and adding the Stripe endpoint

就这样,您的 Stripe 支付集成完成!