Browse Source

wpint: No more than 5 line items on the CN22 declaration allowed

Otherwise the API will generate the following error:
        "items[0].contents: size must be between 0 and 5"
master
Harald Welte 5 months ago
parent
commit
db0a0fb7ae
  1. 2
      inema/wpint.py

2
inema/wpint.py

@ -222,6 +222,8 @@ class WarenpostInt(object):
raise ValueError('Maximum item gross weight is 2000g')
if len(currency) != 3:
raise ValueError('Currency must be expressed as 3-digit ISO-4217 code')
if contents and len(contents) > 5:
raise ValueError('Custom Contents must not contain more than 5 lines')
ret = {
'product': str(product),
'serviceLevel': 'STANDARD',

Loading…
Cancel
Save