Method: ActiveShipping::ExternalReturnLabelRequest#to_xml

Defined in:
lib/active_shipping/external_return_label_request.rb

#to_xmlObject



313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
# File 'lib/active_shipping/external_return_label_request.rb', line 313

def to_xml
  xml_builder = Nokogiri::XML::Builder.new do |xml|
    xml.ExternalReturnLabelRequest do
      xml.CustomerName { xml.text(customer_name) }
      xml.CustomerAddress1 { xml.text(customer_address1) }
      xml.CustomerAddress2 { xml.text(customer_address2) } if customer_address2
      xml.CustomerCity { xml.text(customer_city) }
      xml.CustomerState { xml.text(customer_state) }
      xml.CustomerZipCode { xml.text(customer_zipcode) } if customer_zipcode
      xml.CustomerUrbanization { xml.text(customer_urbanization) } if customer_urbanization

      xml.MerchantAccountID { xml.text() }
      xml.MID { xml.text(mid) }

      xml.SenderName { xml.text(sender_name) } if sender_name
      xml.SenderEmail { xml.text(sender_email) } if sender_email

      xml.RecipientName { xml.text(recipient_name) } if recipient_name
      xml.RecipientEmail { xml.text(recipient_email) } if recipient_email
      xml.RecipientBcc { xml.text(recipient_bcc) } if recipient_bcc

      xml.LabelFormat { xml.text(label_format) } if label_format
      xml.LabelDefinition { xml.text(label_definition) } if label_definition
      xml.ServiceTypeCode { xml.text(service_type_code) } if service_type_code

      xml.CompanyName { xml.text(company_name) } if company_name
      xml.Attention { xml.text(attention) } if attention

      xml.CallCenterOrSelfService { xml.text(call_center_or_self_service) }

      xml.MerchandiseDescription { xml.text(merchandise_description) } if merchandise_description
      xml.InsuranceAmount { xml.text(insurance_amount) } if insurance_amount

      xml.AddressOverrideNotification { xml.text(!!address_override_notification) }

      xml.PackageInformation { xml.text(packaging_information) } if packaging_information
      xml.PackageInformation2 { xml.text(packaging_information2) } if packaging_information2

      xml.ImageType { xml.text(image_type) } if image_type
      xml.AddressValidation { xml.text(!!address_validation) }

    end
  end
  xml_builder.to_xml
end