Php ShopifAPI-什么是向商户收取付费应用费用的正确方法?

Php ShopifAPI-什么是向商户收取付费应用费用的正确方法?,php,python-2.7,shopify,shopify-app,shopify-activemerchant,Php,Python 2.7,Shopify,Shopify App,Shopify Activemerchant,我正在使用Shopify API来制作应用程序,应用程序需要收取费用,在14天试用期后需要收取经常性费用。 为了实现这一点,在安装步骤完成后,重定向应用程序url以创建我使用的位置 charge = shopify.RecurringApplicationCharge({ 'name': "tested 123123 123", 'return_url': return_url, 'test': True, 'price': 0.02,

我正在使用Shopify API来制作应用程序,应用程序需要收取费用,在14天试用期后需要收取经常性费用。 为了实现这一点,在安装步骤完成后,重定向应用程序url以创建我使用的位置

charge = shopify.RecurringApplicationCharge({
       'name': "tested 123123 123",
       'return_url': return_url,
       'test': True,
       'price': 0.02,
   })
charge.save()
pprint.pprint(charge)
作为响应,我得到了重复的应用程序,根据RESTAPI,它应该是json作为响应,带有修饰的返回url和确认url


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

据我所知,你得到的是一件物品作为回报。此对象有to_dict、to_json等可用方法

转换为dict:

c = charge.to_dict()
print c
如果要查看所有可用的方法

print dir(charge)

我正在使用pprint。因此,我认为它可以打开任何对象和相关方法。谢谢你澄清这个概念。