You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Stripe Python Connect品牌设置报错:创建账户链接失败求助

解决Stripe Connect创建Account Link时的品牌图标错误

可能的解决步骤:

  • 确认品牌设置已生效:检查Stripe控制面板的Connect品牌设置,确保图标已上传并保存,刷新页面后再尝试测试。注意区分测试模式和Live模式,确保代码使用的API密钥与设置的模式匹配。

  • 代码中显式指定品牌配置:在创建Express账户时,直接传入settings.branding参数,强制设置品牌信息,避免依赖后台默认设置的同步问题。修改后的代码如下:

account = stripe.Account.create(
    country="US",
    type="express",
    capabilities={
        "card_payments": {"requested": True},
        "transfers": {"requested": True},
    },
    business_type="individual",
    settings={
        "branding": {
            "icon": "file_xxxxxx",  # 替换为你在Stripe上传的图标File ID
            "name": "你的品牌名称",
            "primary_color": "#333333"  # 可选,设置品牌主色调
        }
    }
)

return stripe.AccountLink.create(
    account=account['id'],
    refresh_url='https://localhost:3000/',
    return_url='https://localhost:3000/',
    type="account_onboarding",
)

注:file_xxxxxx是上传图标到Stripe后获得的文件ID,可在文件详情页查看。

  • 验证账户的品牌配置:使用Stripe CLI或API查询已创建账户的品牌设置,确认是否已正确同步:
stripe accounts retrieve acct_你的账户ID --expand "settings.branding"

如果返回结果中settings.branding.icon不存在,说明配置未生效,需要重新上传图标或在代码中显式设置。

内容的提问来源于stack exchange,提问作者help for me

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.25 20:06:22