Source code for worldline.connect.sdk.v1.domain.card_essentials

# -*- coding: utf-8 -*-
#
# This class was auto-generated from the API references found at
# https://apireference.connect.worldline-solutions.com/
#
from typing import Optional

from worldline.connect.sdk.domain.data_object import DataObject


[docs] class CardEssentials(DataObject): __card_number: Optional[str] = None __cardholder_name: Optional[str] = None __expiry_date: Optional[str] = None @property def card_number(self) -> Optional[str]: """ | The complete credit/debit card number Type: str """ return self.__card_number @card_number.setter def card_number(self, value: Optional[str]) -> None: self.__card_number = value @property def cardholder_name(self) -> Optional[str]: """ | The card holder's name on the card. Minimum length of 2, maximum length of 51 characters. Type: str """ return self.__cardholder_name @cardholder_name.setter def cardholder_name(self, value: Optional[str]) -> None: self.__cardholder_name = value @property def expiry_date(self) -> Optional[str]: """ | Expiry date of the card | Format: MMYY Type: str """ return self.__expiry_date @expiry_date.setter def expiry_date(self, value: Optional[str]) -> None: self.__expiry_date = value
[docs] def to_dictionary(self) -> dict: dictionary = super(CardEssentials, self).to_dictionary() if self.card_number is not None: dictionary['cardNumber'] = self.card_number if self.cardholder_name is not None: dictionary['cardholderName'] = self.cardholder_name if self.expiry_date is not None: dictionary['expiryDate'] = self.expiry_date return dictionary
[docs] def from_dictionary(self, dictionary: dict) -> 'CardEssentials': super(CardEssentials, self).from_dictionary(dictionary) if 'cardNumber' in dictionary: self.card_number = dictionary['cardNumber'] if 'cardholderName' in dictionary: self.cardholder_name = dictionary['cardholderName'] if 'expiryDate' in dictionary: self.expiry_date = dictionary['expiryDate'] return self