【发布时间】:2017-01-03 02:12:37
【问题描述】:
当我尝试在有效用户的视图中执行以下操作时,出现错误。如何使用 RecurringApplicationCharge?
@login_required
def confirm(request, *args, **kwargs):
with request.user.session:
# Tried this:
charge = shopify.RecurringApplicationCharge.create(name="Test", test="true")
# Tried this:
charge = shopify.RecurringApplicationCharge.customize(name="Test", test="true")
# Tried this:
charge = shopify.RecurringApplicationCharge(name="Test", test="true")
我可以看到 RecurringApplicationCharge 类有一个自定义方法,它执行load_attributes_from_response(self.put("customize", recurring_application_charge= kwargs)),但我不知道该怎么做。
.create 给我:TypeError: create() got an unexpected keyword argument 'name'
.customize 告诉我:绑定方法 customize() 必须以 RecurringApplicationCharge 实例作为第一个参数调用(什么都没有)
最后一个给了我:recurring_application_charge(None)
我是否需要先创建使用费并将其添加为前缀选项?
【问题讨论】: