2017-01-03 13 views
1

有効なユーザーのビューで次の操作を実行しようとすると、エラーが発生します。 RecurringApplicationChargeはどのように使用しますか?Shopify Python APIの使用方法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))を行いますが、私はこれで何をすべきかわからない方法のカスタマイズを持っていることがわかります。

.customizeが私を与える作成()予期しないキーワード引数「名前」を得た:TypeError例外を:

.createは私に与えます(代わりに何も持っていない)が結合方法のカスタマイズを()最初の引数としてRecurringApplicationChargeインスタンスで呼び出さなければなりません

最後は私を与える:recurring_application_charge(None)

は、私が最初に使用料を作成し、事前に修正オプションとして追加する必要がありますか?

答えて

2

私は次のようにして電荷を作成するように見えます:

@login_required 
def confirm(request, *args, **kwargs): 
    with request.user.session: 
     # Tried this: 
     charge = shopify.RecurringApplicationCharge() 
     charge.test = True 
     charge.return_url = [... my return url ...] 
     charge.price = 10.00 
     charge.name = "Test name" 
関連する問題