Source code for worldline.connect.sdk.v1.domain.refund_customer
# -*- coding: utf-8 -*-
#
# This class was auto-generated from the API references found at
# https://apireference.connect.worldline-solutions.com/
#
from worldline.connect.sdk.domain.data_object import DataObject
from worldline.connect.sdk.v1.domain.address_personal import AddressPersonal
from worldline.connect.sdk.v1.domain.company_information import CompanyInformation
from worldline.connect.sdk.v1.domain.contact_details_base import ContactDetailsBase
[docs]class RefundCustomer(DataObject):
__address = None
__company_information = None
__contact_details = None
__fiscal_number = None
@property
def address(self):
"""
| Object containing address details
Type: :class:`worldline.connect.sdk.v1.domain.address_personal.AddressPersonal`
"""
return self.__address
@address.setter
def address(self, value):
self.__address = value
@property
def company_information(self):
"""
| Object containing company information
Type: :class:`worldline.connect.sdk.v1.domain.company_information.CompanyInformation`
"""
return self.__company_information
@company_information.setter
def company_information(self, value):
self.__company_information = value
@property
def contact_details(self):
"""
| Object containing contact details like email address and phone number
Type: :class:`worldline.connect.sdk.v1.domain.contact_details_base.ContactDetailsBase`
"""
return self.__contact_details
@contact_details.setter
def contact_details(self, value):
self.__contact_details = value
@property
def fiscal_number(self):
"""
| The fiscal registration number of the customer or the tax registration number of the company in case of a business customer. Please find below specifics per country:
* Argentina - Consumer (DNI) with a length of 7 or 8 digits
* Argentina - Company (CUIT) with a length of 11 digits
* Brazil - Individual (CPF): 11 digits. May include dots and a hyphen; maximum length is 14 characters
* Brazil - Company (CNPJ): 14 characters, numeric or alphanumeric. May include dots, a hyphen and a slash; maximum length is 18 characters
* Brazil - Formatted CPF and CNPJ values are accepted and normalized before validation when customer.address.countryCode is BR. For other country codes, fiscal numbers are validated without Brazilian normalization. For alphanumeric CNPJ, check digits are validated after converting each character to a numeric value (ASCII code - 48)
* Chile - Consumer (RUT) with a length of 9 digits
* Colombia - Consumer (NIT) with a length of 8, 9 or 10 digits
* Denmark - Consumer (CPR-nummer or personnummer) with a length of 10 digits
* Dominican Republic - Consumer (RNC) with a length of 11 digits
* Finland - Consumer (Finnish: henkilötunnus (abbreviated as HETU)) with a length of 11 characters
* India - Consumer (PAN) with a length of 10 characters
* Mexico - Consumer (RFC) with a length of 13 digits
* Mexico - Company (RFC) with a length of 12 digits
* Norway - Consumer (fødselsnummer) with a length of 11 digits
* Peru - Consumer (RUC) with a length of 11 digits
* Sweden - Consumer (personnummer) with a length of 10 or 12 digits
* Uruguay - Consumer (CI) with a length of 8 digits
* Uruguay - Consumer (NIE) with a length of 9 digits
* Uruguay - Company (RUT) with a length of 12 digits
Type: str
"""
return self.__fiscal_number
@fiscal_number.setter
def fiscal_number(self, value):
self.__fiscal_number = value
[docs] def to_dictionary(self):
dictionary = super(RefundCustomer, self).to_dictionary()
if self.address is not None:
dictionary['address'] = self.address.to_dictionary()
if self.company_information is not None:
dictionary['companyInformation'] = self.company_information.to_dictionary()
if self.contact_details is not None:
dictionary['contactDetails'] = self.contact_details.to_dictionary()
if self.fiscal_number is not None:
dictionary['fiscalNumber'] = self.fiscal_number
return dictionary
[docs] def from_dictionary(self, dictionary):
super(RefundCustomer, self).from_dictionary(dictionary)
if 'address' in dictionary:
if not isinstance(dictionary['address'], dict):
raise TypeError('value \'{}\' is not a dictionary'.format(dictionary['address']))
value = AddressPersonal()
self.address = value.from_dictionary(dictionary['address'])
if 'companyInformation' in dictionary:
if not isinstance(dictionary['companyInformation'], dict):
raise TypeError('value \'{}\' is not a dictionary'.format(dictionary['companyInformation']))
value = CompanyInformation()
self.company_information = value.from_dictionary(dictionary['companyInformation'])
if 'contactDetails' in dictionary:
if not isinstance(dictionary['contactDetails'], dict):
raise TypeError('value \'{}\' is not a dictionary'.format(dictionary['contactDetails']))
value = ContactDetailsBase()
self.contact_details = value.from_dictionary(dictionary['contactDetails'])
if 'fiscalNumber' in dictionary:
self.fiscal_number = dictionary['fiscalNumber']
return self