Source code for ingenico.connect.sdk.domain.installments.get_installment_request

# -*- 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
from ingenico.connect.sdk.domain.definitions.amount_of_money import AmountOfMoney


[docs]class GetInstallmentRequest(DataObject): """ | Using the Installment Service API you can ask us to provide you with information related to the available installment options, based on the country, amount and optionally payment productId and bin number. """ __amount_of_money = None __bin = None __country_code = None __payment_product_id = None @property def amount_of_money(self): """ | Object containing amount and ISO currency code attributes Type: :class:`ingenico.connect.sdk.domain.definitions.amount_of_money.AmountOfMoney` """ return self.__amount_of_money @amount_of_money.setter def amount_of_money(self, value): self.__amount_of_money = value @property def bin(self): """ | The first digits of the card number from left to right with a minimum of 6 digits Type: str """ return self.__bin @bin.setter def bin(self, value): self.__bin = value @property def country_code(self): """ | ISO 3166-1 alpha-2 country code Type: str """ return self.__country_code @country_code.setter def country_code(self, value): self.__country_code = value @property def payment_product_id(self): """ | Payment product identifier | Please see payment products <https://epayments-api.developer-ingenico.com/s2sapi/v1/en_US/python/paymentproducts.html> for a full overview of possible values. Type: int """ return self.__payment_product_id @payment_product_id.setter def payment_product_id(self, value): self.__payment_product_id = value
[docs] def to_dictionary(self): dictionary = super(GetInstallmentRequest, self).to_dictionary() if self.amount_of_money is not None: dictionary['amountOfMoney'] = self.amount_of_money.to_dictionary() if self.bin is not None: dictionary['bin'] = self.bin if self.country_code is not None: dictionary['countryCode'] = self.country_code if self.payment_product_id is not None: dictionary['paymentProductId'] = self.payment_product_id return dictionary
[docs] def from_dictionary(self, dictionary): super(GetInstallmentRequest, self).from_dictionary(dictionary) if 'amountOfMoney' in dictionary: if not isinstance(dictionary['amountOfMoney'], dict): raise TypeError('value \'{}\' is not a dictionary'.format(dictionary['amountOfMoney'])) value = AmountOfMoney() self.amount_of_money = value.from_dictionary(dictionary['amountOfMoney']) if 'bin' in dictionary: self.bin = dictionary['bin'] if 'countryCode' in dictionary: self.country_code = dictionary['countryCode'] if 'paymentProductId' in dictionary: self.payment_product_id = dictionary['paymentProductId'] return self