我目前正在尝试通过解析stripe客户列表并在每个客户中搜索元数据是否匹配来取消订阅。在
目前这不起作用。在
customers = stripe.Customer.list(limit=100)
for c in customers.auto_paging_iter():
if bool(c.metadata):
try:
if user.username == c.metadata.username:
for s in c.subscriptions.data:
subscription = stripe.Subscription.retrieve(s['id'])
subscription.delete(at_period_end=True)
commit()
return jsonify(status=True)
except:
continue
我错过什么了吗?在
很明显,我刚刚想好了
不起作用
一定是的
^{pr2}$相关问题 更多 >
编程相关推荐