diff --git a/passerelle_imio_extra_fees/models.py b/passerelle_imio_extra_fees/models.py index a63582f..668df2f 100644 --- a/passerelle_imio_extra_fees/models.py +++ b/passerelle_imio_extra_fees/models.py @@ -63,10 +63,10 @@ class ExtraFees(BaseResource): for basket_item in data['data']: try: nb_documents += int(basket_item['request_data']['nb_documents']) - # Check if the item in send by mail and if so there is no postage_fee - destination = basket_item["request_data"]["form_var_destinations_raw"] - if destination and "mail" in destination: - postage_fee = 0 + destination = basket_item['request_data']['destination'] # Passed in the workflow webservice + # No postage fees if send by mail + if destination and 'mail' in destination: + postage_fee = Decimal(0) if Decimal(basket_item['request_data']['postage_fee']) > postage_fee: postage_fee = Decimal(basket_item['request_data']['postage_fee']) except KeyError: