要禁用已连接的 Stripe 帐户的手动付款,可以使用 Stripe Connect 的 OAuth 应用程序流,这需要 Stripe 顶级帐户的支持。 接下来,可以使用 Stripe Connect API 在已连接的 Stripe 帐户上创建权限和支付限制,以禁用手动付款。
这里提供一个使用 Stripe Python SDK 的示例代码:
import stripe
stripe.api_key = "sk_test_*********************"
# Connect to account
stripe_account_id = "acct_*********************"
# Disable manual payments
stripe.Account.modify(
stripe_account_id,
settings={
"payments": {
"manual": False
}
}
)
在上述代码示例中,我们使用 Stripe 的 Python SDK 连接到 Stripe Connect,并使用修改帐户方法在已连接的 Stripe 帐户上禁用手动付款。请注意,在此示例中,您需要将 sk_test_*********************
替换为您的 Stripe 私钥,将 acct_*********************
替换为已连接 Stripe 帐户的 ID。