Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Update delivery/sginature confirmation for new API

  • Loading branch information...
commit 39dc8352d21e6c5199b9b03ce71fef17196221c9 1 parent 10d424f
Rohan Deshpande authored June 22, 2010
3  init.rb
... ...
@@ -1,4 +1,5 @@
1 1
 require 'nokogiri'
  2
+require 'hpricot'
2 3
 require 'net/https'
3 4
 
4  
-require File.join(File.dirname(__FILE__), 'lib', 'awesome_usps')
  5
+require File.join(File.dirname(__FILE__), 'lib', 'awesome_usps')
10  lib/foto_verite/usps/delivery_and_signature_confirmation.rb
@@ -17,8 +17,8 @@ def signature_confirmation_label(origin, destination, service_type, image_type,
17 17
 
18 18
 
19 19
       def canned_delivery_confirmation_label_test
20  
-        origin = Location.new( :name=> "John Smith",  :address2 => "6406 Ivy Lane",  :state => 'MD', :city => 'Greenbelt', :zip5 => '20770')
21  
-        destination =Location.new( :name=> "Joe Customer",  :address2 =>"136 Linwood Plz",  :state => 'NJ', :city => 'Fort Lee', :zip5 => "07024")
  20
+        origin = Location.new(:first_name=> 'John', :last_name => "Smith",  :address2 => "6406 Ivy Lane",  :state => 'MD', :city => 'Greenbelt', :zip5 => '20770')
  21
+        destination =Location.new(:first_name => "John", :last_name => "Customer",  :address2 =>"136 Linwood Plz",  :state => 'NJ', :city => 'Fort Lee', :zip5 => "07024")
22 22
         service_type = "Priority"
23 23
         image_type ="PDF"
24 24
         label_type = 1
@@ -46,7 +46,7 @@ def confirmation_xml(api_request, origin, destination, service_type, image_type,
46 46
         xm.tag!(api_request, "USERID"=>"#{@username}") do
47 47
           xm.Option(label_type)
48 48
           xm.ImageParameters #Will be used in the future. Is a required tag.
49  
-          xm.FromName(origin.name)
  49
+          xm.FromName(origin.full_name)
50 50
           xm.FromFirm(origin.firm_name)
51 51
           xm.FromAddress1(origin.address1) #Used for an apartment or suite number. Yes the API is a bit fucked.
52 52
           xm.FromAddress2(origin.address2)
@@ -54,7 +54,7 @@ def confirmation_xml(api_request, origin, destination, service_type, image_type,
54 54
           xm.FromState(origin.state)
55 55
           xm.FromZip5(origin.zip5)
56 56
           xm.FromZip4(origin.zip4)
57  
-          xm.ToName(destination.name)
  57
+          xm.ToName(destination.full_name)
58 58
           xm.ToFirm(destination.firm_name)
59 59
           xm.ToAddress1(destination.address1)
60 60
           xm.ToAddress2(destination.address2)
@@ -100,4 +100,4 @@ def parse_confirmation_label(action, xml, image_type)
100 100
 
101 101
     end # DeliveryAndSignatureConfirmation
102 102
   end # USPS
103  
-end # FotoVerite
  103
+end # FotoVerite

0 notes on commit 39dc835

Please sign in to comment.
Something went wrong with that request. Please try again.