【问题标题】:Chargify Cancel Subscription: How to set cancellation messageChargify 取消订阅:如何设置取消消息
【发布时间】:2017-09-02 02:50:36
【问题描述】:

The doc 表示您可以在发送请求时使用cancellation_message 参数/字段。我已经尝试过 URL 参数和 JSON 正文中的字段,但这些都没有设置 cancellation_message 以响应除 null 之外的任何内容。

curl -H "authorization":"Basic somelongkeybase64=" -X DELETE https://myapp.chargify.com/subscriptions/17356012.json?cancellation_message=Application%20deleted

curl -H "authorization":"Basic somelongkeybase64=" -H Content-Type:application/json -d '{"cancellation_message":"Application deleted"}' -X DELETE https://myapp.chargify.com/subscriptions/17356169.json

我错过了什么吗?

【问题讨论】:

    标签: chargify


    【解决方案1】:

    得到了 Chargify 支持团队的答复。 cancellation_message 应该被包装到请求正文中的 subscription 中:

    {
      'subscription': {
        'cancellation_message': 'Canceling the subscription via the API'
       }
    }
    

    所以工作的curl 请求如下所示:

    curl -H "authorization":"Basic somelongkeybase64=" -H Content-Type:application/json -d '{"subscription":{"cancellation_message":"Application deleted"}}' -X DELETE https://myapp.chargify.com/subscriptions/17356169.json
    

    希望它也可以帮助某人。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-26
      • 1970-01-01
      • 2022-01-19
      • 2012-03-14
      • 1970-01-01
      • 2020-04-28
      相关资源
      最近更新 更多