0

我正在使用 Shopify API 来制作应用程序shopify_python_api,应用程序需要在 14 天试用期后收取经常性费用。为了使这项工作,在安装步骤后将应用程序 url 重定向到create_charge我使用的位置

charge = shopify.RecurringApplicationCharge({
       'name': "tested 123123 123",
       'return_url': return_url,
       'test': True,
       'price': 0.02,
   })
charge.save()
pprint.pprint(charge)

作为我得到的响应recurring_application_charge(4182835270),根据 Rest-Api文档,它应该是 json 作为decorated_return_url和的响应confirmation_url

向商家收费的正确方法是什么?

4

1 回答 1

1

根据我的理解,你得到了一个对象作为回报。此对象有 to_dict()、to_json() 等方法可用。

转换为字典:

c = charge.to_dict()
print c

如果您想查看所有可用的方法

print dir(charge)
于 2018-11-01T07:33:34.397 回答