def update(self, credit_card_token, params={}): Resource.verify_keys(params, CreditCard.update_signature()) response = self.config.http().put("/payment_methods/" + credit_card_token, {"credit_card": params}) if "credit_card" in response: return SuccessfulResult({"credit_card": CreditCard(self.gateway, response["credit_card"])}) elif "api_error_response" in response: return ErrorResult(self.gateway, response["api_error_response"])
def tr_data_for_update(self, tr_data, redirect_url): Resource.verify_keys(tr_data, [ "payment_method_token", { "credit_card": CreditCard.update_signature() } ]) tr_data["kind"] = TransparentRedirect.Kind.UpdatePaymentMethod return self.gateway.transparent_redirect.tr_data(tr_data, redirect_url)
def update(self, credit_card_token, params={}): Resource.verify_keys(params, CreditCard.update_signature()) response = self.config.http().put( "/payment_methods/" + credit_card_token, {"credit_card": params}) if "credit_card" in response: return SuccessfulResult({ "credit_card": CreditCard(self.gateway, response["credit_card"]) }) elif "api_error_response" in response: return ErrorResult(self.gateway, response["api_error_response"])
def update(self, credit_card_token, params=None): if params is None: params = {} Resource.verify_keys(params, CreditCard.update_signature()) self.__check_for_deprecated_attributes(params) response = self.config.http().put( self.config.base_merchant_path() + "/payment_methods/credit_card/" + credit_card_token, {"credit_card": params}) if "credit_card" in response: return SuccessfulResult({ "credit_card": CreditCard(self.gateway, response["credit_card"]) }) elif "api_error_response" in response: return ErrorResult(self.gateway, response["api_error_response"])
def tr_data_for_update(self, tr_data, redirect_url): Resource.verify_keys(tr_data, ["payment_method_token", {"credit_card": CreditCard.update_signature()}]) tr_data["kind"] = TransparentRedirect.Kind.UpdatePaymentMethod return self.gateway.transparent_redirect.tr_data(tr_data, redirect_url)