Module: AwesomeUsps::OpenDistrubutePriority

Included in:
USPS
Defined in:
lib/awesome_usps/open_distrubute_priority.rb

Instance Method Summary collapse

Instance Method Details

#canned_open_distrubute_priority_label_testObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/awesome_usps/open_distrubute_priority.rb', line 9

def canned_open_distrubute_priority_label_test
  origin = Location.new( :name=> "John Smith",  :address2 => "6406 Ivy Lane",  :state => 'MD', :city => 'Greenbelt', :zip5 => '20770')
  destination =Location.new( :name=> "Fairfax Post Office",  :address2 =>"10660 Page Ave",  :state => 'VA', :city => 'Fairfax', :zip5 => "22030", :facility_type => "DDU")
  mail_type = "Letters"
  image_type = "PDF"
  package_weight_in_ounces = 1
  options = {:address_service => true, :permit_number => "21718", :permit_zip => "07204"}
  api_requst = "OpenDistributePriorityCertifyRequest"
  label_type=1
  request= open_distrubute_priority_xml(api_requst, origin, destination, package_weight_in_ounces,  mail_type, image_type, label_type, options)
  gateway_commit(:open_distribute_priority_certify, 'OpenDistributePriorityCertify', request, :ssl, image_type)
end

#open_distrubute_priority_label(origin, destination, package_weight_in_ounces, mail_type, image_type, label_type = 1, api_requst = "OpenDistributePriorityRequest", options = {}) ⇒ Object



3
4
5
6
7
# File 'lib/awesome_usps/open_distrubute_priority.rb', line 3

def open_distrubute_priority_label(origin, destination, package_weight_in_ounces,  mail_type, image_type, label_type=1, api_requst = "OpenDistributePriorityRequest", options={})
  request = open_distrubute_priority_xml(api_requst, origin, destination, package_weight_in_ounces,  mail_type, image_type, label_type, options)
  #YES THE API IS THAT STUPID THAT WE MUST PASS WHAT TYPE OF MIME TYPE!
  gateway_commit(:open_distrubute_priority, 'OpenDistributePriority', request, :ssl, image_type)
end