Stripe API中Transfer返回的destination_payment对象检索修改及报错解决
Stripe API 对接实操问题
基础操作流程
- 基于Python语言开发对接逻辑,核心规则为Stripe通用API端点逻辑,不受开发语言限制
- 调用Transfer创建接口为关联账户生成程序化转账,基础调用代码:
import stripe stripe.api_key = 'rk_test_xxxxxxx' acct_id = 'acct_xxxxx' resp = stripe.Transfer.create( amount=100, currency='usd', destination=acct_id, description='Test Transfer 1' )
- 接口返回结果中可提取
destination_payment对象,该对象对应关联账户Payments feed页面中实际展示的条目:
dest_pmt = resp['destination_payment']
待实现需求
- 调整
destination_payment对象的description字段与metadata字段:当前该对象的description直接继承自对应Transfer的描述值,且无关联metadata信息 - 目标对象ID为
py_xxxxx格式,暂不清楚对应的可检索、可修改接口端点 - 按照官方支持给出的操作指引,尝试调用PaymentIntent接口检索目标对象,调用代码:
resp_2 = stripe.PaymentIntent.retrieve( dest_pmt, stripe_account=acct_id )
报错现象
执行上述检索代码后,系统抛出错误:
InvalidRequestError: Request req_xxxxxx: No such payment_intent: 'py_xxxxxxxxx'
补充说明:当前使用的是Standard Connected Account,已确认账户类型不会对该问题造成本质规则影响
内容的提问来源于stack exchange,提问作者Lle.4
相关产品推荐
相关产品推荐

