Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def _build_params_EU(self, sender, adresse, product_code='CORE'):
- self.request_return_params = self._get_request_params_EU(
- sender, adresse, product_code
- )
- self._set_weight(self.request_params)
- def get_return_params(self, country_code):
- return {
- country_code in ['FR'] + DOMTOM_CODES: lambda: self._build_params_EU(),
- country_code in EU_RETURN_CODES: lambda: self._build_params_EU(self._get_shipping_adresse(), SENDER_INFOS_EU, product_code='CORI'),
- country_code not in EU_CODES + DOMTOM_CODES: lambda: self._build_return_params_INT()
- }
- def get_sending_params(self, country_code):
- return {
- country_code in EU_CODES: lambda: self._build_params_EU(),
- country_code in DOMTOM_CODES: lambda: self._build_params_EU(SENDER_INFOS_EU, self._get_shipping_adresse(), product_code='COM'),
- country_code not in EU_CODES + DOMTOM_CODES: lambda: self._build_sending_params_INT()
- }
- def build_params(self, param_building_functions):
- country_code = self.order['shippingAddress']['countryCode']
- params = param_building_functions(country_code)
- for key, func in filter(lambda x: x[0], params.items()):
- func()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement