【问题标题】:Unable to Sync already Existed Plans in Djstripe无法同步 Djstripe 中已存在的计划
【发布时间】:2019-09-01 00:38:57
【问题描述】:

当我使用 Stripe 仪表板添加新产品时,我可以看到 webhook 调用通过,我可以看到在 Django 中添加的事件“product.created”但是每当我对已经存在的计划和产品进行更改时,djstripe 无法更新该计划的已存在行。我已经在运行命令了

    python manage.py djstripe_sync_plans_from_stripe

每次我更新任何计划/产品或创建任何新计划/产品之后

【问题讨论】:

  • 我面临着完全相同的问题

标签: python django stripe-payments


【解决方案1】:

您可以简单地使用 plan.updated webhook 自动更新计划,例如

@webhooks.handler("plan.updated")
def update_plans_hook(event):
   upadte code..

用于 webhook 配置的 djstripe webhook 文档。 https://dj-stripe.readthedocs.io/en/stable/usage/webhooks.html

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-12-05
    • 2012-06-19
    • 1970-01-01
    • 2017-10-20
    • 2016-03-15
    • 2014-08-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多