@@ -180,11 +180,11 @@ def shipment_request(
180180 residential = shipper .residential ,
181181 ),
182182 contact = fedex .ResponsiblePartyContactType (
183- personName = shipper .contact ,
183+ personName = lib . text ( shipper .contact , max = 35 ) ,
184184 emailAddress = shipper .email ,
185185 phoneNumber = (shipper .phone_number or "000-000-0000" ),
186186 phoneExtension = None ,
187- companyName = shipper .company_name ,
187+ companyName = lib . text ( shipper .company_name , max = 35 ) ,
188188 faxNumber = None ,
189189 ),
190190 tins = lib .identity (
@@ -204,15 +204,15 @@ def shipment_request(
204204 residential = recipient .residential ,
205205 ),
206206 contact = fedex .ResponsiblePartyContactType (
207- personName = recipient .contact ,
207+ personName = lib . text ( recipient .person_name , max = 35 ) ,
208208 emailAddress = recipient .email ,
209209 phoneNumber = (
210210 recipient .phone_number
211211 or shipper .phone_number
212212 or "000-000-0000"
213213 ),
214214 phoneExtension = None ,
215- companyName = recipient .company_name ,
215+ companyName = lib . text ( recipient .company_name , max = 35 ) ,
216216 faxNumber = None ,
217217 ),
218218 tins = (
@@ -243,11 +243,11 @@ def shipment_request(
243243 residential = return_address .residential ,
244244 ),
245245 contact = fedex .ResponsiblePartyContactType (
246- personName = return_address .contact ,
246+ personName = lib . text ( return_address .contact , max = 35 ) ,
247247 emailAddress = return_address .email ,
248248 phoneNumber = return_address .phone_number ,
249249 phoneExtension = None ,
250- companyName = return_address .company_name ,
250+ companyName = lib . text ( return_address .company_name , max = 35 ) ,
251251 faxNumber = None ,
252252 ),
253253 )
@@ -277,11 +277,15 @@ def shipment_request(
277277 ),
278278 contact = (
279279 fedex .ResponsiblePartyContactType (
280- personName = billing_address .contact ,
280+ personName = lib .text (
281+ billing_address .contact , max = 35
282+ ),
281283 emailAddress = billing_address .email ,
282284 phoneNumber = billing_address .phone_number ,
283285 phoneExtension = None ,
284- companyName = billing_address .company_name ,
286+ companyName = lib .text (
287+ billing_address .company_name , max = 35
288+ ),
285289 faxNumber = None ,
286290 )
287291 if billing_address .address is not None
@@ -401,7 +405,9 @@ def shipment_request(
401405 regulatoryControls = None ,
402406 brokers = [],
403407 commercialInvoice = fedex .CommercialInvoiceType (
404- originatorName = (shipper .company_name or shipper .contact ),
408+ originatorName = lib .text (
409+ shipper .company_name or shipper .contact , max = 35
410+ ),
405411 comments = None ,
406412 customerReferences = (
407413 [
@@ -448,11 +454,15 @@ def shipment_request(
448454 ),
449455 contact = lib .identity (
450456 fedex .ResponsiblePartyContactType (
451- personName = duty_billing_address .contact ,
457+ personName = lib .text (
458+ duty_billing_address .contact , max = 35
459+ ),
452460 emailAddress = duty_billing_address .email ,
453461 phoneNumber = duty_billing_address .phone_number ,
454462 phoneExtension = None ,
455- companyName = duty_billing_address .company_name ,
463+ companyName = lib .text (
464+ duty_billing_address .company_name , max = 35
465+ ),
456466 faxNumber = None ,
457467 )
458468 if duty_billing_address
0 commit comments