def upcoming(cls, api_key=None, stripe_version=None, stripe_account=None, **params): if "subscription_items" in params: items = util.convert_array_to_dict(params["subscription_items"]) params["subscription_items"] = items requestor = api_requestor.APIRequestor(api_key, api_version=stripe_version, account=stripe_account) url = cls.class_url() + '/upcoming' response, api_key = requestor.request('get', url, params) return util.convert_to_stripe_object(response, api_key, stripe_version, stripe_account)
def upcoming(cls, api_key=None, stripe_version=None, stripe_account=None, **params): if "subscription_items" in params: items = util.convert_array_to_dict(params["subscription_items"]) params["subscription_items"] = items requestor = api_requestor.APIRequestor(api_key, api_version=stripe_version, account=stripe_account) url = cls.class_url() + '/upcoming' response, api_key = requestor.request('get', url, params) return util.convert_to_stripe_object(response, api_key, stripe_version, stripe_account)
def serialize(self, previous): updated_params = super(UpdateableAPIResource, self).serialize(previous) if "items" in updated_params: updated_params["items"] = util.convert_array_to_dict( updated_params["items"]) return updated_params
def create(cls, **params): if "items" in params: params["items"] = util.convert_array_to_dict(params["items"]) return super(Subscription, cls).create(**params)
def modify(cls, sid, **params): if "items" in params: params["items"] = util.convert_array_to_dict(params["items"]) return super(Subscription, cls).modify(sid, **params)
def return_order(self, idempotency_key=None, **params): if "items" in params: params["items"] = util.convert_array_to_dict(params["items"]) headers = util.populate_headers(idempotency_key) return self.request( 'post', self.instance_url() + '/returns', params, headers)
def create(cls, **params): if "items" in params: params["items"] = util.convert_array_to_dict(params["items"]) return super(Order, cls).create(**params)
def serialize(self, previous): updated_params = super(UpdateableAPIResource, self).serialize(previous) if "items" in updated_params: updated_params["items"] = util.convert_array_to_dict( updated_params["items"]) return updated_params
def modify(cls, sid, **params): if "items" in params: params["items"] = util.convert_array_to_dict(params["items"]) return super(Subscription, cls).modify(sid, **params)
def return_order(self, idempotency_key=None, **params): if "items" in params: params["items"] = util.convert_array_to_dict(params["items"]) headers = util.populate_headers(idempotency_key) return self.request('post', self.instance_url() + '/returns', params, headers)