active_shipping 1.0.0.pre2 → 1.0.0.pre3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (187) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/.gitignore +12 -0
  5. data/.travis.yml +14 -0
  6. data/.yardopts +14 -0
  7. data/Gemfile +3 -0
  8. data/Gemfile.activesupport32 +4 -0
  9. data/Gemfile.activesupport40 +4 -0
  10. data/Gemfile.activesupport41 +4 -0
  11. data/Gemfile.activesupport42 +4 -0
  12. data/Rakefile +23 -0
  13. data/active_shipping.gemspec +32 -0
  14. data/lib/active_shipping.rb +1 -1
  15. data/lib/active_shipping/carrier.rb +1 -1
  16. data/lib/active_shipping/carriers/shipwire.rb +32 -35
  17. data/lib/active_shipping/carriers/ups.rb +2 -2
  18. data/lib/active_shipping/carriers/usps.rb +103 -101
  19. data/lib/active_shipping/label_response.rb +1 -1
  20. data/lib/active_shipping/rate_estimate.rb +76 -15
  21. data/lib/active_shipping/rate_response.rb +20 -0
  22. data/lib/active_shipping/response.rb +17 -0
  23. data/lib/active_shipping/shipment_packer.rb +2 -2
  24. data/lib/active_shipping/shipping_response.rb +24 -2
  25. data/lib/active_shipping/tracking_response.rb +65 -17
  26. data/lib/active_shipping/version.rb +1 -1
  27. data/shipit.rubygems.yml +1 -0
  28. data/test/credentials.yml +47 -0
  29. data/test/fixtures/files/label1.pdf +0 -0
  30. data/test/fixtures/files/ups-shipping-label.gif +0 -0
  31. data/test/fixtures/json/newzealandpost/domestic_book.json +1 -0
  32. data/test/fixtures/json/newzealandpost/domestic_default.json +1 -0
  33. data/test/fixtures/json/newzealandpost/domestic_error.json +1 -0
  34. data/test/fixtures/json/newzealandpost/domestic_poster.json +1 -0
  35. data/test/fixtures/json/newzealandpost/domestic_small_half_pound.json +1 -0
  36. data/test/fixtures/json/newzealandpost/international_book.json +1 -0
  37. data/test/fixtures/json/newzealandpost/international_new_zealand_wii.json +1 -0
  38. data/test/fixtures/json/newzealandpost/international_small_half_pound.json +1 -0
  39. data/test/fixtures/json/newzealandpost/international_wii.json +1 -0
  40. data/test/fixtures/xml/canadapost/example_request.xml +25 -0
  41. data/test/fixtures/xml/canadapost/example_response.xml +130 -0
  42. data/test/fixtures/xml/canadapost/example_response_error.xml +16 -0
  43. data/test/fixtures/xml/canadapost/example_response_french.xml +122 -0
  44. data/test/fixtures/xml/canadapost/example_response_with_nil_value.xml +164 -0
  45. data/test/fixtures/xml/canadapost/example_response_with_postal_outlet.xml +155 -0
  46. data/test/fixtures/xml/canadapost/example_response_with_postal_outlet_french.xml +274 -0
  47. data/test/fixtures/xml/canadapost/example_response_with_strange_delivery_date.xml +130 -0
  48. data/test/fixtures/xml/canadapost_pws/dnc_tracking_details_en.xml +112 -0
  49. data/test/fixtures/xml/canadapost_pws/merchant_details_error.xml +7 -0
  50. data/test/fixtures/xml/canadapost_pws/merchant_details_response.xml +7 -0
  51. data/test/fixtures/xml/canadapost_pws/option_response.xml +13 -0
  52. data/test/fixtures/xml/canadapost_pws/option_response_no_conflicts.xml +7 -0
  53. data/test/fixtures/xml/canadapost_pws/rates_info.xml +190 -0
  54. data/test/fixtures/xml/canadapost_pws/rates_info_error.xml +7 -0
  55. data/test/fixtures/xml/canadapost_pws/receipt_response.xml +42 -0
  56. data/test/fixtures/xml/canadapost_pws/receipt_response_no_priced_options.xml +36 -0
  57. data/test/fixtures/xml/canadapost_pws/register_token_error.xml +7 -0
  58. data/test/fixtures/xml/canadapost_pws/register_token_response.xml +3 -0
  59. data/test/fixtures/xml/canadapost_pws/service_options_response.xml +42 -0
  60. data/test/fixtures/xml/canadapost_pws/services_error.xml +6 -0
  61. data/test/fixtures/xml/canadapost_pws/services_response.xml +32 -0
  62. data/test/fixtures/xml/canadapost_pws/shipment_domestic.xml +69 -0
  63. data/test/fixtures/xml/canadapost_pws/shipment_response.xml +20 -0
  64. data/test/fixtures/xml/canadapost_pws/shipment_us.xml +69 -0
  65. data/test/fixtures/xml/canadapost_pws/tracking_details_en.xml +152 -0
  66. data/test/fixtures/xml/canadapost_pws/tracking_details_en_error.xml +7 -0
  67. data/test/fixtures/xml/canadapost_pws/tracking_details_en_undelivered.xml +116 -0
  68. data/test/fixtures/xml/canadapost_pws/tracking_details_fr.xml +156 -0
  69. data/test/fixtures/xml/canadapost_pws/tracking_details_no_expected_delivery_date.xml +40 -0
  70. data/test/fixtures/xml/fedex/freight_rate_request.xml +82 -0
  71. data/test/fixtures/xml/fedex/freight_rate_response.xml +506 -0
  72. data/test/fixtures/xml/fedex/invalid_fedex_reply.xml +27 -0
  73. data/test/fixtures/xml/fedex/ottawa_to_beverly_hills_commercial_rate_request.xml +79 -0
  74. data/test/fixtures/xml/fedex/ottawa_to_beverly_hills_rate_request.xml +80 -0
  75. data/test/fixtures/xml/fedex/ottawa_to_beverly_hills_rate_response.xml +214 -0
  76. data/test/fixtures/xml/fedex/raterequest_reply.xml +213 -0
  77. data/test/fixtures/xml/fedex/reply_without_notifications.xml +185 -0
  78. data/test/fixtures/xml/fedex/tracking_request.xml +27 -0
  79. data/test/fixtures/xml/fedex/tracking_response.xml +151 -0
  80. data/test/fixtures/xml/fedex/tracking_response_empty_destination.xml +76 -0
  81. data/test/fixtures/xml/fedex/tracking_response_no_destination.xml +139 -0
  82. data/test/fixtures/xml/fedex/tracking_response_no_ship_time.xml +150 -0
  83. data/test/fixtures/xml/fedex/tracking_response_with_estimated_delivery_date.xml +95 -0
  84. data/test/fixtures/xml/fedex/tracking_response_with_shipper_address.xml +71 -0
  85. data/test/fixtures/xml/fedex/unknown_fedex_document_reply.xml +3 -0
  86. data/test/fixtures/xml/kunaki/invalid_state_response.xml +3 -0
  87. data/test/fixtures/xml/kunaki/no_valid_items_response.xml +3 -0
  88. data/test/fixtures/xml/kunaki/successful_rates_response.xml +3 -0
  89. data/test/fixtures/xml/kunaki/unsuccessful_rates_response.xml +9 -0
  90. data/test/fixtures/xml/shipwire/international_rates_response.xml +17 -0
  91. data/test/fixtures/xml/shipwire/new_carrier_rate_response.xml +18 -0
  92. data/test/fixtures/xml/shipwire/no_rates_response.xml +7 -0
  93. data/test/fixtures/xml/shipwire/rates_response.xml +36 -0
  94. data/test/fixtures/xml/shipwire/rates_response_no_estimate.xml +14 -0
  95. data/test/fixtures/xml/stamps/authenticate_user_request.xml +15 -0
  96. data/test/fixtures/xml/stamps/authenticate_user_response.xml +10 -0
  97. data/test/fixtures/xml/stamps/cleanse_address_request.xml +19 -0
  98. data/test/fixtures/xml/stamps/cleanse_address_response.xml +27 -0
  99. data/test/fixtures/xml/stamps/create_indicium_request.xml +69 -0
  100. data/test/fixtures/xml/stamps/create_indicium_response.xml +40 -0
  101. data/test/fixtures/xml/stamps/expired_authenticator_response.xml +15 -0
  102. data/test/fixtures/xml/stamps/get_account_info_request.xml +11 -0
  103. data/test/fixtures/xml/stamps/get_account_info_response.xml +36 -0
  104. data/test/fixtures/xml/stamps/get_purchase_status_request.xml +12 -0
  105. data/test/fixtures/xml/stamps/get_purchase_status_response.xml +16 -0
  106. data/test/fixtures/xml/stamps/get_rates_request.xml +19 -0
  107. data/test/fixtures/xml/stamps/get_rates_response.xml +351 -0
  108. data/test/fixtures/xml/stamps/purchase_postage_request.xml +13 -0
  109. data/test/fixtures/xml/stamps/purchase_postage_response.xml +17 -0
  110. data/test/fixtures/xml/stamps/track_shipment_request.xml +12 -0
  111. data/test/fixtures/xml/stamps/track_shipment_response.xml +45 -0
  112. data/test/fixtures/xml/ups/delivered_shipment_with_refund.xml +290 -0
  113. data/test/fixtures/xml/ups/delivered_shipment_without_events_tracking_response.xml +62 -0
  114. data/test/fixtures/xml/ups/example_tracking_response.xml +53 -0
  115. data/test/fixtures/xml/ups/in_transit_shipment.xml +183 -0
  116. data/test/fixtures/xml/ups/out_for_delivery_shipment.xml +165 -0
  117. data/test/fixtures/xml/ups/shipment_accept_response.xml +42 -0
  118. data/test/fixtures/xml/ups/shipment_confirm_response.xml +33 -0
  119. data/test/fixtures/xml/ups/shipment_from_tiger_direct.xml +222 -0
  120. data/test/fixtures/xml/ups/test_real_home_as_residential_destination_response.xml +1 -0
  121. data/test/fixtures/xml/ups/test_real_home_as_residential_destination_response_with_insured.xml +289 -0
  122. data/test/fixtures/xml/ups/test_real_home_as_residential_destination_with_origin_account_response.xml +311 -0
  123. data/test/fixtures/xml/ups/triple_accept_response.xml +72 -0
  124. data/test/fixtures/xml/ups/triple_confirm_response.xml +32 -0
  125. data/test/fixtures/xml/usps/beverly_hills_to_new_york_book_commercial_base_rate_response.xml +2 -0
  126. data/test/fixtures/xml/usps/beverly_hills_to_new_york_book_commercial_plus_rate_response.xml +258 -0
  127. data/test/fixtures/xml/usps/beverly_hills_to_new_york_book_rate_response.xml +108 -0
  128. data/test/fixtures/xml/usps/beverly_hills_to_ottawa_american_wii_commercial_base_rate_response.xml +84 -0
  129. data/test/fixtures/xml/usps/beverly_hills_to_ottawa_american_wii_commercial_plus_rate_response.xml +212 -0
  130. data/test/fixtures/xml/usps/beverly_hills_to_ottawa_american_wii_rate_response.xml +230 -0
  131. data/test/fixtures/xml/usps/delivered_tracking_response.xml +11 -0
  132. data/test/fixtures/xml/usps/first_class_packages_with_invalid_mail_type_response.xml +12 -0
  133. data/test/fixtures/xml/usps/first_class_packages_with_mail_type_response.xml +16 -0
  134. data/test/fixtures/xml/usps/first_class_packages_without_mail_type_response.xml +12 -0
  135. data/test/fixtures/xml/usps/invalid_xml_tracking_response_error.xml +2 -0
  136. data/test/fixtures/xml/usps/tracking_request.xml +3 -0
  137. data/test/fixtures/xml/usps/tracking_response.xml +13 -0
  138. data/test/fixtures/xml/usps/tracking_response_failure.xml +3 -0
  139. data/test/fixtures/xml/usps/tracking_response_not_available.xml +12 -0
  140. data/test/fixtures/xml/usps/tracking_response_test_error.xml +8 -0
  141. data/test/fixtures/xml/usps/us_rate_request.xml +18 -0
  142. data/test/fixtures/xml/usps/world_rate_request_with_value.xml +20 -0
  143. data/test/fixtures/xml/usps/world_rate_request_without_value.xml +20 -0
  144. data/test/remote/canada_post_pws_platform_test.rb +246 -0
  145. data/test/remote/canada_post_pws_test.rb +171 -0
  146. data/test/remote/canada_post_test.rb +53 -0
  147. data/test/remote/fedex_test.rb +216 -0
  148. data/test/remote/kunaki_test.rb +36 -0
  149. data/test/remote/new_zealand_post_test.rb +147 -0
  150. data/test/remote/shipwire_test.rb +82 -0
  151. data/test/remote/stamps_test.rb +394 -0
  152. data/test/remote/ups_test.rb +257 -0
  153. data/test/remote/usps_test.rb +235 -0
  154. data/test/test_helper.rb +220 -0
  155. data/test/unit/carriers/benchmark_test.rb +18 -0
  156. data/test/unit/carriers/canada_post_pws_rating_test.rb +349 -0
  157. data/test/unit/carriers/canada_post_pws_register_test.rb +75 -0
  158. data/test/unit/carriers/canada_post_pws_shipping_test.rb +244 -0
  159. data/test/unit/carriers/canada_post_pws_tracking_test.rb +154 -0
  160. data/test/unit/carriers/canada_post_test.rb +145 -0
  161. data/test/unit/carriers/fedex_test.rb +408 -0
  162. data/test/unit/carriers/kunaki_test.rb +52 -0
  163. data/test/unit/carriers/new_zealand_post_test.rb +174 -0
  164. data/test/unit/carriers/shipwire_test.rb +187 -0
  165. data/test/unit/carriers/stamps_test.rb +241 -0
  166. data/test/unit/carriers/ups_test.rb +311 -0
  167. data/test/unit/carriers/usps_test.rb +484 -0
  168. data/test/unit/carriers_test.rb +17 -0
  169. data/test/unit/label_response_test.rb +15 -0
  170. data/test/unit/location_test.rb +138 -0
  171. data/test/unit/package_test.rb +68 -0
  172. data/test/unit/rate_estimate_test.rb +34 -0
  173. data/test/unit/response_test.rb +14 -0
  174. data/test/unit/shipment_packer_test.rb +174 -0
  175. metadata +331 -35
  176. metadata.gz.sig +0 -0
  177. data/lib/vendor/quantified/MIT-LICENSE +0 -22
  178. data/lib/vendor/quantified/README.markdown +0 -49
  179. data/lib/vendor/quantified/Rakefile +0 -13
  180. data/lib/vendor/quantified/init.rb +0 -0
  181. data/lib/vendor/quantified/lib/quantified.rb +0 -6
  182. data/lib/vendor/quantified/lib/quantified/attribute.rb +0 -211
  183. data/lib/vendor/quantified/lib/quantified/length.rb +0 -20
  184. data/lib/vendor/quantified/lib/quantified/mass.rb +0 -19
  185. data/lib/vendor/quantified/test/length_test.rb +0 -94
  186. data/lib/vendor/quantified/test/mass_test.rb +0 -96
  187. data/lib/vendor/quantified/test/test_helper.rb +0 -19
@@ -0,0 +1 @@
1
+ {"products":[{"group":"International Express Courier","price":"130.73","name":"Int Express Pcl Zone C 3.5kg","code":"ICPNC35","max_delivery_target":5,"signature_required":true,"min_delivery_target":1,"has_tracking":true},{"group":"International Economy Courier","price":"86.15","name":"Int Econ Cour Pcl Zn C 3.5kg","code":"IEZPC35","max_delivery_target":6,"signature_required":true,"min_delivery_target":2,"has_tracking":true},{"group":"International Air","price":"68.65","name":"Zone C AirPost Cust Pcl 3.5kg","code":"IACNC35","max_delivery_target":10,"signature_required":false,"min_delivery_target":3,"has_tracking":false},{"group":"International Economy","price":"61.79","name":"Zone C EconomyPost Pcl 3.5kg","code":"IECNC35","max_delivery_target":25,"signature_required":false,"min_delivery_target":10,"has_tracking":false}],"status":"success"}
@@ -0,0 +1,25 @@
1
+ <?xml version="1.0"?>
2
+ <!DOCTYPE eparcel SYSTEM "http://sellonline.canadapost.ca/DevelopersResources/protocolV3/eParcel.dtd">
3
+ <eparcel>
4
+ <language>en</language>
5
+ <ratesAndServicesRequest>
6
+ <merchantCPCID>CPC_DEMO_XML</merchantCPCID>
7
+ <fromPostalCode>K1N 5T2</fromPostalCode>
8
+ <itemsPrice>25.00</itemsPrice>
9
+ <lineItems>
10
+ <item>
11
+ <quantity>1</quantity>
12
+ <weight>0.5</weight>
13
+ <length>4</length>
14
+ <width>3</width>
15
+ <height>2</height>
16
+ <description>a box full of stuff</description>
17
+ <readyToShip/>
18
+ </item>
19
+ </lineItems>
20
+ <city>Beverly Hills</city>
21
+ <provOrState>CA</provOrState>
22
+ <country>United States</country>
23
+ <postalCode>90210</postalCode>
24
+ </ratesAndServicesRequest>
25
+ </eparcel>
@@ -0,0 +1,130 @@
1
+ <?xml version="1.0"?>
2
+ <!DOCTYPE eparcel [
3
+ <!-- EVERY REQUEST CONTAIN THE eparcel TAG -->
4
+ <!ELEMENT eparcel (ratesAndServicesResponse)>
5
+ <!-- ********************************************************* -->
6
+ <!-- * Standard response for request for rates and services * -->
7
+ <!-- ********************************************************* -->
8
+ <!ELEMENT ratesAndServicesResponse (statusCode , statusMessage+ , requestID , handling , language , product+ , packing* , emptySpace* , shippingOptions , comment , nearestPostalOutlet*)>
9
+ <!ELEMENT statusCode (#PCDATA)>
10
+ <!ELEMENT statusMessage (#PCDATA)>
11
+ <!ELEMENT requestID (#PCDATA)>
12
+ <!ELEMENT handling (#PCDATA)>
13
+ <!ELEMENT language (#PCDATA)>
14
+ <!ELEMENT product (name , rate , shippingDate , deliveryDate , deliveryDayOfWeek , nextDayAM? , packingID)>
15
+ <!ATTLIST product id CDATA #REQUIRED>
16
+ <!ATTLIST product sequence CDATA #REQUIRED>
17
+ <!ELEMENT name (#PCDATA)>
18
+ <!ELEMENT rate (#PCDATA)>
19
+ <!ELEMENT shippingDate (#PCDATA)>
20
+ <!ELEMENT deliveryDate (#PCDATA)>
21
+ <!ELEMENT deliveryDayOfWeek (#PCDATA)>
22
+ <!ELEMENT nextDayAM (#PCDATA)>
23
+ <!ELEMENT packingID (#PCDATA)>
24
+ <!ELEMENT packing (packingID , box+)>
25
+ <!ELEMENT box (name , weight , expediterWeight , length , width , height , packedItem+)>
26
+ <!ELEMENT weight (#PCDATA)>
27
+ <!ELEMENT expediterWeight (#PCDATA)>
28
+ <!ELEMENT length (#PCDATA)>
29
+ <!ELEMENT width (#PCDATA)>
30
+ <!ELEMENT height (#PCDATA)>
31
+ <!ELEMENT packedItem (quantity , description)>
32
+ <!ELEMENT quantity (#PCDATA)>
33
+ <!ELEMENT description (#PCDATA)>
34
+ <!ELEMENT emptySpace (length , width , height , weight)>
35
+ <!ELEMENT shippingOptions (insurance , deliveryConfirmation , signature , flexiblePaymentAvailable?)>
36
+ <!ELEMENT insurance (#PCDATA)>
37
+ <!ELEMENT deliveryConfirmation (#PCDATA)>
38
+ <!ELEMENT signature (#PCDATA)>
39
+ <!ELEMENT flexiblePaymentAvailable EMPTY>
40
+ <!ELEMENT comment (#PCDATA)>
41
+ <!-- ********************************************************* -->
42
+ <!-- * 'nearestPostalOutlet' is optional and is returned * -->
43
+ <!-- * only if the merchant profile has this option enabled * -->
44
+ <!-- ********************************************************* -->
45
+ <!ELEMENT nearestPostalOutlet (postalOutletSequenceNo , distance , outletName , businessName , postalAddress , phoneNumber , businessHours+)>
46
+ <!ELEMENT postalOutletSequenceNo (#PCDATA)>
47
+ <!ELEMENT distance (#PCDATA)>
48
+ <!ELEMENT outletName (#PCDATA)>
49
+ <!ELEMENT businessName (#PCDATA)>
50
+ <!ELEMENT postalAddress (addressLine+ , postalCode , municipality , province?)>
51
+ <!ELEMENT addressLine (#PCDATA)>
52
+ <!ELEMENT postalCode (#PCDATA)>
53
+ <!ELEMENT municipality (#PCDATA)>
54
+ <!ELEMENT province (#PCDATA)>
55
+ <!ELEMENT phoneNumber (#PCDATA)>
56
+ <!ELEMENT businessHours (dayId , dayOfWeek , time)>
57
+ <!ELEMENT dayId (#PCDATA)>
58
+ <!ELEMENT dayOfWeek (#PCDATA)>
59
+ <!ELEMENT time (#PCDATA)>
60
+ ]>
61
+ <eparcel>
62
+ <ratesAndServicesResponse>
63
+ <statusCode>1</statusCode>
64
+ <statusMessage>OK</statusMessage>
65
+ <requestID>6877575</requestID>
66
+ <handling>0.0</handling>
67
+ <language>0</language>
68
+ <product id="1040" sequence="1">
69
+ <name>Priority Courier</name>
70
+ <rate>40.28</rate>
71
+ <shippingDate>2010-08-03</shippingDate>
72
+ <deliveryDate>2010-08-04</deliveryDate>
73
+ <deliveryDayOfWeek>4</deliveryDayOfWeek>
74
+ <nextDayAM>true</nextDayAM>
75
+ <packingID>P_0</packingID>
76
+ </product>
77
+ <product id="1020" sequence="2">
78
+ <name>Expedited</name>
79
+ <rate>17.16</rate>
80
+ <shippingDate>2010-08-03</shippingDate>
81
+ <deliveryDate>2010-08-04</deliveryDate>
82
+ <deliveryDayOfWeek>4</deliveryDayOfWeek>
83
+ <nextDayAM>false</nextDayAM>
84
+ <packingID>P_0</packingID>
85
+ </product>
86
+ <product id="1010" sequence="3">
87
+ <name>Regular</name>
88
+ <rate>17.16</rate>
89
+ <shippingDate>2010-08-03</shippingDate>
90
+ <deliveryDate>2010-08-06</deliveryDate>
91
+ <deliveryDayOfWeek>6</deliveryDayOfWeek>
92
+ <nextDayAM>false</nextDayAM>
93
+ <packingID>P_0</packingID>
94
+ </product>
95
+ <packing>
96
+ <packingID>P_0</packingID>
97
+ <box>
98
+ <name>Small Box</name>
99
+ <weight>1.691</weight>
100
+ <expediterWeight>1.691</expediterWeight>
101
+ <length>25.0</length>
102
+ <width>17.0</width>
103
+ <height>16.0</height>
104
+ <packedItem>
105
+ <quantity>1</quantity>
106
+ <description>KAO Diskettes</description>
107
+ </packedItem>
108
+ </box>
109
+ <box>
110
+ <name>My Ready To Ship Item</name>
111
+ <weight>2.0</weight>
112
+ <expediterWeight>1.5</expediterWeight>
113
+ <length>30.0</length>
114
+ <width>20.0</width>
115
+ <height>20.0</height>
116
+ <packedItem>
117
+ <quantity>1</quantity>
118
+ <description>My Ready To Ship Item</description>
119
+ </packedItem>
120
+ </box>
121
+ </packing>
122
+ <shippingOptions>
123
+ <insurance>No</insurance>
124
+ <deliveryConfirmation>No</deliveryConfirmation>
125
+ <signature>No</signature>
126
+ </shippingOptions>
127
+ <comment/>
128
+ </ratesAndServicesResponse>
129
+ </eparcel>
130
+ <!--END_OF_EPARCEL-->
@@ -0,0 +1,16 @@
1
+ <?xml version="1.0" ?>
2
+ <!DOCTYPE eparcel [
3
+ <!ELEMENT eparcel (error)>
4
+ <!ELEMENT error (statusCode,statusMessage*, requestID)>
5
+ <!ELEMENT statusCode (#PCDATA)>
6
+ <!ELEMENT statusMessage (#PCDATA)>
7
+ <!ELEMENT requestID (#PCDATA)>
8
+ ]>
9
+ <eparcel>
10
+ <error>
11
+ <statusCode>-3004</statusCode>
12
+ <statusMessage>Parcel too heavy to be shipped with CPC.</statusMessage>
13
+ <requestID>3070209</requestID>
14
+ </error>
15
+ </eparcel>
16
+ <!--END_OF_EPARCEL-->
@@ -0,0 +1,122 @@
1
+ <?xml version="1.0"?>
2
+ <!DOCTYPE eparcel [
3
+ <!-- EVERY REQUEST CONTAIN THE eparcel TAG --><!ELEMENT eparcel (ratesAndServicesResponse)>
4
+ <!-- ********************************************************* --><!-- * Standard response for request for rates and services * --><!-- ********************************************************* --><!ELEMENT ratesAndServicesResponse (statusCode , statusMessage+ , requestID , handling , language , product+ , packing* , emptySpace* , shippingOptions , comment , nearestPostalOutlet*)>
5
+ <!ELEMENT statusCode (#PCDATA)>
6
+ <!ELEMENT statusMessage (#PCDATA)>
7
+ <!ELEMENT requestID (#PCDATA)>
8
+ <!ELEMENT handling (#PCDATA)>
9
+ <!ELEMENT language (#PCDATA)>
10
+ <!ELEMENT product (name , rate , shippingDate , deliveryDate , deliveryDayOfWeek , nextDayAM? , packingID)>
11
+ <!ATTLIST product id CDATA #REQUIRED>
12
+ <!ATTLIST product sequence CDATA #REQUIRED>
13
+ <!ELEMENT name (#PCDATA)>
14
+ <!ELEMENT rate (#PCDATA)>
15
+ <!ELEMENT shippingDate (#PCDATA)>
16
+ <!ELEMENT deliveryDate (#PCDATA)>
17
+ <!ELEMENT deliveryDayOfWeek (#PCDATA)>
18
+ <!ELEMENT nextDayAM (#PCDATA)>
19
+ <!ELEMENT packingID (#PCDATA)>
20
+ <!ELEMENT packing (packingID , box+)>
21
+ <!ELEMENT box (name , weight , expediterWeight , length , width , height , packedItem+)>
22
+ <!ELEMENT weight (#PCDATA)>
23
+ <!ELEMENT expediterWeight (#PCDATA)>
24
+ <!ELEMENT length (#PCDATA)>
25
+ <!ELEMENT width (#PCDATA)>
26
+ <!ELEMENT height (#PCDATA)>
27
+ <!ELEMENT packedItem (quantity , description)>
28
+ <!ELEMENT quantity (#PCDATA)>
29
+ <!ELEMENT description (#PCDATA)>
30
+ <!ELEMENT emptySpace (length , width , height , weight)>
31
+ <!ELEMENT shippingOptions (insurance , deliveryConfirmation , signature , flexiblePaymentAvailable?)>
32
+ <!ELEMENT insurance (#PCDATA)>
33
+ <!ELEMENT deliveryConfirmation (#PCDATA)>
34
+ <!ELEMENT signature (#PCDATA)>
35
+ <!ELEMENT flexiblePaymentAvailable EMPTY>
36
+ <!ELEMENT comment (#PCDATA)>
37
+ <!-- ********************************************************* --><!-- * 'nearestPostalOutlet' is optional and is returned * --><!-- * only if the merchant profile has this option enabled * --><!-- ********************************************************* --><!ELEMENT nearestPostalOutlet (postalOutletSequenceNo , distance , outletName , businessName , postalAddress , phoneNumber , businessHours+)>
38
+ <!ELEMENT postalOutletSequenceNo (#PCDATA)>
39
+ <!ELEMENT distance (#PCDATA)>
40
+ <!ELEMENT outletName (#PCDATA)>
41
+ <!ELEMENT businessName (#PCDATA)>
42
+ <!ELEMENT postalAddress (addressLine+ , postalCode , municipality , province?)>
43
+ <!ELEMENT addressLine (#PCDATA)>
44
+ <!ELEMENT postalCode (#PCDATA)>
45
+ <!ELEMENT municipality (#PCDATA)>
46
+ <!ELEMENT province (#PCDATA)>
47
+ <!ELEMENT phoneNumber (#PCDATA)>
48
+ <!ELEMENT businessHours (dayId , dayOfWeek , time)>
49
+ <!ELEMENT dayId (#PCDATA)>
50
+ <!ELEMENT dayOfWeek (#PCDATA)>
51
+ <!ELEMENT time (#PCDATA)>
52
+ ]>
53
+ <eparcel>
54
+ <ratesAndServicesResponse>
55
+ <statusCode>1</statusCode>
56
+ <statusMessage>OK</statusMessage>
57
+ <requestID>7838534</requestID>
58
+ <handling>0.0</handling>
59
+ <language>1</language>
60
+ <product id="1040" sequence="1">
61
+ <name>Messageries prioritaires</name>
62
+ <rate>40.46</rate>
63
+ <shippingDate>2010-09-07</shippingDate>
64
+ <deliveryDate>2010-09-08</deliveryDate>
65
+ <deliveryDayOfWeek>4</deliveryDayOfWeek>
66
+ <nextDayAM>true</nextDayAM>
67
+ <packingID>P_0</packingID>
68
+ </product>
69
+ <product id="1020" sequence="2">
70
+ <name>Colis acc&#xE9;l&#xE9;r&#xE9;s</name>
71
+ <rate>17.24</rate>
72
+ <shippingDate>2010-09-07</shippingDate>
73
+ <deliveryDate>2010-09-08</deliveryDate>
74
+ <deliveryDayOfWeek>4</deliveryDayOfWeek>
75
+ <nextDayAM>false</nextDayAM>
76
+ <packingID>P_0</packingID>
77
+ </product>
78
+ <product id="1010" sequence="3">
79
+ <name>Colis standard</name>
80
+ <rate>17.24</rate>
81
+ <shippingDate>2010-09-07</shippingDate>
82
+ <deliveryDate>2010-09-10</deliveryDate>
83
+ <deliveryDayOfWeek>6</deliveryDayOfWeek>
84
+ <nextDayAM>false</nextDayAM>
85
+ <packingID>P_0</packingID>
86
+ </product>
87
+ <packing>
88
+ <packingID>P_0</packingID>
89
+ <box>
90
+ <name>Small Box</name>
91
+ <weight>1.691</weight>
92
+ <expediterWeight>1.691</expediterWeight>
93
+ <length>25.0</length>
94
+ <width>17.0</width>
95
+ <height>16.0</height>
96
+ <packedItem>
97
+ <quantity>1</quantity>
98
+ <description>KAO Diskettes</description>
99
+ </packedItem>
100
+ </box>
101
+ <box>
102
+ <name>My Ready To Ship Item</name>
103
+ <weight>2.0</weight>
104
+ <expediterWeight>1.5</expediterWeight>
105
+ <length>30.0</length>
106
+ <width>20.0</width>
107
+ <height>20.0</height>
108
+ <packedItem>
109
+ <quantity>1</quantity>
110
+ <description>My Ready To Ship Item</description>
111
+ </packedItem>
112
+ </box>
113
+ </packing>
114
+ <shippingOptions>
115
+ <insurance>No</insurance>
116
+ <deliveryConfirmation>No</deliveryConfirmation>
117
+ <signature>No</signature>
118
+ </shippingOptions>
119
+ <comment/>
120
+ </ratesAndServicesResponse>
121
+ </eparcel>
122
+ <!--END_OF_EPARCEL-->
@@ -0,0 +1,164 @@
1
+ <?xml version="1.0"?>
2
+ <!DOCTYPE eparcel [
3
+ <!-- EVERY REQUEST CONTAIN THE eparcel TAG -->
4
+ <!ELEMENT eparcel (ratesAndServicesResponse)>
5
+ <!-- ********************************************************* -->
6
+ <!-- * Standard response for request for rates and services * -->
7
+ <!-- ********************************************************* -->
8
+ <!ELEMENT ratesAndServicesResponse (statusCode, statusMessage+, requestID, handling, language, product+, packing*, emptySpace*, shippingOptions, comment, nearestPostalOutlet*)>
9
+ <!ELEMENT statusCode (#PCDATA)>
10
+ <!ELEMENT statusMessage (#PCDATA)>
11
+ <!ELEMENT requestID (#PCDATA)>
12
+ <!ELEMENT handling (#PCDATA)>
13
+ <!ELEMENT language (#PCDATA)>
14
+ <!ELEMENT product (name, rate, shippingDate, deliveryDate, deliveryDayOfWeek, nextDayAM?, packingID)>
15
+ <!ATTLIST product
16
+ id CDATA #REQUIRED
17
+ sequence CDATA #REQUIRED
18
+ >
19
+ <!ELEMENT name (#PCDATA)>
20
+ <!ELEMENT rate (#PCDATA)>
21
+ <!ELEMENT shippingDate (#PCDATA)>
22
+ <!ELEMENT deliveryDate (#PCDATA)>
23
+ <!ELEMENT deliveryDayOfWeek (#PCDATA)>
24
+ <!ELEMENT nextDayAM (#PCDATA)>
25
+ <!ELEMENT packingID (#PCDATA)>
26
+ <!ELEMENT packing (packingID, box+)>
27
+ <!ELEMENT box (name, weight, expediterWeight, length, width, height, packedItem+)>
28
+ <!ELEMENT weight (#PCDATA)>
29
+ <!ELEMENT expediterWeight (#PCDATA)>
30
+ <!ELEMENT length (#PCDATA)>
31
+ <!ELEMENT width (#PCDATA)>
32
+ <!ELEMENT height (#PCDATA)>
33
+ <!ELEMENT packedItem (quantity, description)>
34
+ <!ELEMENT quantity (#PCDATA)>
35
+ <!ELEMENT description (#PCDATA)>
36
+ <!ELEMENT emptySpace (length, width, height, weight)>
37
+ <!ELEMENT shippingOptions (insurance, deliveryConfirmation, signature, flexiblePaymentAvailable?)>
38
+ <!ELEMENT insurance (#PCDATA)>
39
+ <!ELEMENT deliveryConfirmation (#PCDATA)>
40
+ <!ELEMENT signature (#PCDATA)>
41
+ <!ELEMENT flexiblePaymentAvailable EMPTY>
42
+ <!ELEMENT comment (#PCDATA)>
43
+ <!-- ********************************************************* -->
44
+ <!-- * 'nearestPostalOutlet' is optional and is returned * -->
45
+ <!-- * only if the merchant profile has this option enabled * -->
46
+ <!-- ********************************************************* -->
47
+ <!ELEMENT nearestPostalOutlet (postalOutletSequenceNo, distance, outletName, businessName, postalAddress, phoneNumber, businessHours+)>
48
+ <!ELEMENT postalOutletSequenceNo (#PCDATA)>
49
+ <!ELEMENT distance (#PCDATA)>
50
+ <!ELEMENT outletName (#PCDATA)>
51
+ <!ELEMENT businessName (#PCDATA)>
52
+ <!ELEMENT postalAddress (addressLine+, postalCode, municipality, province?)>
53
+ <!ELEMENT addressLine (#PCDATA)>
54
+ <!ELEMENT postalCode (#PCDATA)>
55
+ <!ELEMENT municipality (#PCDATA)>
56
+ <!ELEMENT province (#PCDATA)>
57
+ <!ELEMENT phoneNumber (#PCDATA)>
58
+ <!ELEMENT businessHours (dayId, dayOfWeek, time)>
59
+ <!ELEMENT dayId (#PCDATA)>
60
+ <!ELEMENT dayOfWeek (#PCDATA)>
61
+ <!ELEMENT time (#PCDATA)>
62
+
63
+ ]>
64
+ <eparcel>
65
+ <ratesAndServicesResponse>
66
+
67
+ <statusCode>1</statusCode>
68
+ <statusMessage>OK</statusMessage>
69
+ <requestID>12471821</requestID>
70
+ <handling>1.0</handling>
71
+ <language>0</language>
72
+ <product id="2040" sequence="1">
73
+ <name>Priority Worldwide USA</name>
74
+ <rate>139.36</rate>
75
+ <shippingDate>2015-01-21</shippingDate>
76
+ <deliveryDate>www.canadapost.ca</deliveryDate>
77
+ <deliveryDayOfWeek>4</deliveryDayOfWeek>
78
+ <nextDayAM>false</nextDayAM>
79
+ <packingID>P_0</packingID>
80
+ </product>
81
+ <product id="2030" sequence="2">
82
+ <name>Xpresspost USA</name>
83
+ <rate>64.6</rate>
84
+ <shippingDate>2015-01-21</shippingDate>
85
+ <deliveryDate>2015-01-24</deliveryDate>
86
+ <deliveryDayOfWeek>7</deliveryDayOfWeek>
87
+ <nextDayAM>false</nextDayAM>
88
+ <packingID>P_0</packingID>
89
+ </product>
90
+ <product id="2020" sequence="3">
91
+ <name>Expedited US Business</name>
92
+ <rate>38.0</rate>
93
+ <shippingDate>2015-01-21</shippingDate>
94
+ <deliveryDate>2015-01-27</deliveryDate>
95
+ <deliveryDayOfWeek>3</deliveryDayOfWeek>
96
+ <nextDayAM>false</nextDayAM>
97
+ <packingID>P_0</packingID>
98
+ </product>
99
+ <product id="2000" sequence="4">
100
+ <name>Tracked Packet - USA</name>
101
+ <rate>32.82</rate>
102
+ <shippingDate>2015-01-21</shippingDate>
103
+ <deliveryDate>2015-01-29</deliveryDate>
104
+ <deliveryDayOfWeek>5</deliveryDayOfWeek>
105
+ <nextDayAM>false</nextDayAM>
106
+ <packingID>P_0</packingID>
107
+ </product>
108
+ <product id="2015" sequence="5">
109
+ <name>Small Packets Air</name>
110
+ <rate>21.58</rate>
111
+ <shippingDate>2015-01-21</shippingDate>
112
+ <deliveryDate>up to 2 weeks</deliveryDate>
113
+ <deliveryDayOfWeek>4</deliveryDayOfWeek>
114
+ <nextDayAM>false</nextDayAM>
115
+ <packingID>P_0</packingID>
116
+ </product>
117
+
118
+
119
+ <packing>
120
+ <packingID>P_0</packingID>
121
+ <box>
122
+ <name>a box full of stuff</name>
123
+ <weight>0.5</weight>
124
+ <expediterWeight>0.5</expediterWeight>
125
+ <length>4.0</length>
126
+ <width>3.0</width>
127
+ <height>2.0</height>
128
+ <packedItem>
129
+ <quantity>1</quantity>
130
+ <description>a box full of stuff</description>
131
+ </packedItem>
132
+
133
+
134
+ </box>
135
+ <box>
136
+ <name>another box full of stuff</name>
137
+ <weight>0.5</weight>
138
+ <expediterWeight>0.5</expediterWeight>
139
+ <length>4.0</length>
140
+ <width>3.0</width>
141
+ <height>2.0</height>
142
+ <packedItem>
143
+ <quantity>1</quantity>
144
+ <description>another box full of stuff</description>
145
+ </packedItem>
146
+
147
+
148
+ </box>
149
+
150
+ </packing>
151
+
152
+ <shippingOptions>
153
+ <insurance>No</insurance>
154
+ <deliveryConfirmation>Yes</deliveryConfirmation>
155
+ <signature>No</signature>
156
+
157
+ </shippingOptions>
158
+
159
+ <comment>* For major centres only. Add 1 to 3 business days for other destinations.</comment>
160
+
161
+
162
+ </ratesAndServicesResponse>
163
+ </eparcel>
164
+ <!--END_OF_EPARCEL-->