def save(self, options={}): """Save the updated product attributes. Keyword argument: options -- Options for the request""" self.fill_with_data(options) request = Request(self._client) path = "/products/" + quote_plus(self.id) + "" data = { 'name': self.name, 'amount': self.amount, 'currency': self.currency, 'metadata': self.metadata, 'return_url': self.return_url, 'cancel_url': self.cancel_url } response = Response(request.put(path, data, options)) return_values = [] body = response.body body = body["product"] return_values.append(self.fill_with_data(body)) return return_values[0]
def save(self, options = {}): """Save the updated coupon attributes. Keyword argument: options -- Options for the request""" self.fill_with_data(options) request = Request(self._client) path = "/coupons/" + quote_plus(self.id) + "" data = { 'metadata': self.metadata } response = Response(request.put(path, data, options)) return_values = [] body = response.body body = body["coupon"] return_values.append(self.fill_with_data(body)) return return_values[0]
def save(self, options={}): """Save the updated plan attributes. This action won't affect subscriptions already linked to this plan. Keyword argument: options -- Options for the request""" self.fill_with_data(options) request = Request(self._client) path = "/plans/" + quote_plus(self.id) + "" data = { 'name': self.name, 'trial_period': self.trial_period, 'metadata': self.metadata, 'return_url': self.return_url, 'cancel_url': self.cancel_url } response = Response(request.put(path, data, options)) return_values = [] body = response.body body = body["plan"] return_values.append(self.fill_with_data(body)) return return_values[0]
def save(self, options={}): """Save the updated subscription attributes. Keyword argument: options -- Options for the request""" self.fill_with_data(options) request = Request(self._client) path = "/subscriptions/" + quote_plus(self.id) + "" data = { 'plan_id': self.plan_id, 'name': self.name, 'amount': self.amount, 'interval': self.interval, 'trial_end_at': self.trial_end_at, 'metadata': self.metadata, 'coupon_id': options.get("coupon_id"), 'source': options.get("source"), 'prorate': options.get("prorate"), 'proration_date': options.get("proration_date"), 'preview': options.get("preview") } response = Response(request.put(path, data, options)) return_values = [] body = response.body body = body["subscription"] return_values.append(self.fill_with_data(body)) return return_values[0]
def save(self, options={}): """Save the updated addon attributes. Keyword argument: options -- Options for the request""" self.fill_with_data(options) request = Request(self._client) path = "/subscriptions/" + quote_plus( self.subscription_id) + "/addons/" + quote_plus(self.id) + "" data = { 'plan_id': self.plan_id, 'type': self.type, 'name': self.name, 'amount': self.amount, 'quantity': self.quantity, 'metadata': self.metadata, 'prorate': options.get("prorate"), 'proration_date': options.get("proration_date"), 'preview': options.get("preview"), 'increment_quantity_by': options.get("increment_quantity_by") } response = Response(request.put(path, data, options)) return_values = [] body = response.body body = body["addon"] return_values.append(self.fill_with_data(body)) return return_values[0]
def save(self, options = {}): """Save the updated gateway configuration attributes and settings. Keyword argument: options -- Options for the request""" self.fill_with_data(options) request = Request(self._client) path = "/gateway-configurations/" + quote_plus(self.id) + "" data = { 'id': self.id, 'name': self.name, 'enabled': self.enabled, 'fee_fixed': self.fee_fixed, 'fee_percentage': self.fee_percentage, 'default_currency': self.default_currency, 'settings': options.get("settings") } response = Response(request.put(path, data, options)) return_values = [] body = response.body body = body["gateway_configuration"] return_values.append(self.fill_with_data(body)) return return_values[0]
def save(self, options={}): """Save the updated customer attributes. Keyword argument: options -- Options for the request""" self.fill_with_data(options) request = Request(self._client) path = "/customers/" + quote_plus(self.id) + "" data = { 'balance': self.balance, 'default_token_id': self.default_token_id, 'email': self.email, 'first_name': self.first_name, 'last_name': self.last_name, 'address1': self.address1, 'address2': self.address2, 'city': self.city, 'state': self.state, 'zip': self.zip, 'country_code': self.country_code, 'ip_address': self.ip_address, 'phone_number': self.phone_number, 'legal_document': self.legal_document, 'metadata': self.metadata } response = Response(request.put(path, data, options)) return_values = [] body = response.body body = body["customer"] return_values.append(self.fill_with_data(body)) return return_values[0]