How To Use Shopify Python API RecurringApplicationCharge
When I try to do the following in a view for a valid user, I get an error. How do I use the 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")
I can see that the RecurringApplicationCharge class has a method customize which does
load_attributes_from_response(self.put("customize", recurring_application_charge= kwargs)) but I am not sure what to do with this.
.create gives me: TypeError: create() got an unexpected keyword argument 'name'
.customize gives me: bound method customize() must be called with RecurringApplicationCharge instance as first argument (got nothing instead)
the last gives me:
Do I need to create a usage charge first and add it as pre-fix options?
It looks like I create the charge by doing the following:
@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"
- → What are the pluses/minuses of different ways to configure GPIOs on the Beaglebone Black?
- → Django, code inside <script> tag doesn't work in a template
- → React - Django webpack config with dynamic 'output'
- → GAE Python app - Does URL matter for SEO?
- → Put a Rendered Django Template in Json along with some other items
- → session disappears when request is sent from fetch
- → Python Shopify API output formatted datetime string in django template
- → Shopify app: adding a new shipping address via webhook
- → Shopify + Python library: how to create new shipping address
- → shopify python api: how do add new assets to published theme?
- → Access 'HTTP_X_SHOPIFY_SHOP_API_CALL_LIMIT' with Python Shopify Module