Module: Endicia

Includes:
HTTParty
Defined in:
lib/endicia.rb

Defined Under Namespace

Classes: Label

Class Method Summary collapse

Class Method Details

.get_label(opts = {}) ⇒ Object

example XML <LabelRequest><ReturnAddress1>884 Railroad Street, Suite C</ReturnAddress1><ReturnCity>Ypsilanti</ReturnCity><ReturnState>MI</ReturnState><FromPostalCode>48197</FromPostalCode><FromCity>Ypsilanti</FromCity><FromState>MI</FromState><FromCompany>VGKids</FromCompany><ToPostalCode>48197</ToPostalCode><ToAddress1>1237 Elbridge St</ToAddress1><ToCity>Ypsilanti</ToCity><ToState>MI</ToState><PartnerTransactionID>123</PartnerTransactionID><PartnerCustomerID>71212</PartnerCustomerID><MailClass>MediaMail</MailClass><Test>YES</Test><RequesterID>poopants</RequesterID><AccountID>792190</AccountID><PassPhrase>whiplash1</PassPhrase><WeightOz>10</WeightOz></LabelRequest>



28
29
30
31
32
# File 'lib/endicia.rb', line 28

def self.get_label(opts={})
  body = "labelRequestXML=" + @defaults.merge(opts).to_xml(:skip_instruct => true, :skip_types => true, :root => 'LabelRequest', :indent => 0)
  result = self.post("https://www.envmgr.com/LabelService/EwsLabelService.asmx/GetPostageLabelXML", :body => body)
  return Endicia::Label.new(result["LabelRequestResponse"])
end