Source code for ingenico.connect.sdk.domain.token.create_token_response

# -*- coding: utf-8 -*-
#
# This class was auto-generated from the API references found at
# https://epayments-api.developer-ingenico.com/
#
from ingenico.connect.sdk.data_object import DataObject


[docs]class CreateTokenResponse(DataObject): __is_new_token = None __original_payment_id = None __token = None @property def is_new_token(self): """ | Indicates if a new token was created * true - A new token was created * false - A token with the same card number already exists and is returned. Please note that the existing token has not been updated. When you want to update other data then the card number, you need to use the update API call, as data is never updated during the creation of a token. Type: bool """ return self.__is_new_token @is_new_token.setter def is_new_token(self, value): self.__is_new_token = value @property def original_payment_id(self): """ | The initial Payment ID of the transaction from which the token has been created Type: str """ return self.__original_payment_id @original_payment_id.setter def original_payment_id(self, value): self.__original_payment_id = value @property def token(self): """ | ID of the token Type: str """ return self.__token @token.setter def token(self, value): self.__token = value
[docs] def to_dictionary(self): dictionary = super(CreateTokenResponse, self).to_dictionary() if self.is_new_token is not None: dictionary['isNewToken'] = self.is_new_token if self.original_payment_id is not None: dictionary['originalPaymentId'] = self.original_payment_id if self.token is not None: dictionary['token'] = self.token return dictionary
[docs] def from_dictionary(self, dictionary): super(CreateTokenResponse, self).from_dictionary(dictionary) if 'isNewToken' in dictionary: self.is_new_token = dictionary['isNewToken'] if 'originalPaymentId' in dictionary: self.original_payment_id = dictionary['originalPaymentId'] if 'token' in dictionary: self.token = dictionary['token'] return self