shipping 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/shipping/base.rb, line 33</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/shipping/base.rb, line 35</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fedex</span>
15
15
  <span class="ruby-constant">Shipping</span><span class="ruby-operator">::</span><span class="ruby-constant">FedEx</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">prepare_vars</span>
16
16
  <span class="ruby-keyword kw">end</span></pre>
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/shipping/base.rb, line 38</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/shipping/base.rb, line 40</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ups</span>
15
15
  <span class="ruby-constant">Shipping</span><span class="ruby-operator">::</span><span class="ruby-constant">UPS</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">prepare_vars</span>
16
16
  <span class="ruby-keyword kw">end</span></pre>
@@ -89,7 +89,10 @@
89
89
 
90
90
  <div class="name-list">
91
91
  <a href="#M000004">base_price</a>&nbsp;&nbsp;
92
+ <a href="#M000005">express_service_availability</a>&nbsp;&nbsp;
93
+ <a href="#M000007">label</a>&nbsp;&nbsp;
92
94
  <a href="#M000003">price</a>&nbsp;&nbsp;
95
+ <a href="#M000006">register</a>&nbsp;&nbsp;
93
96
  </div>
94
97
  </div>
95
98
 
@@ -109,17 +112,32 @@
109
112
  <tr class="top-aligned-row context-row">
110
113
  <td class="context-item-name">ServiceTypes</td>
111
114
  <td>=</td>
112
- <td class="context-item-value">{ &quot;priority&quot; =&gt; &quot;01&quot;, &quot;2day&quot; =&gt; &quot;03&quot;, &quot;standard_overnight&quot; =&gt; &quot;05&quot;, &quot;first_overnight&quot; =&gt; &quot;06&quot;, &quot;express_saver&quot; =&gt; &quot;20&quot;, &quot;1day_freight&quot; =&gt; &quot;70&quot;, &quot;2day_freight&quot; =&gt; &quot;80&quot;, &quot;3day_freight&quot; =&gt; &quot;83&quot;, &quot;international_priority&quot; =&gt; &quot;01&quot;, &quot;international_economy&quot; =&gt; &quot;03&quot;, &quot;international_first&quot; =&gt; &quot;06&quot;, &quot;international_priority_freight&quot; =&gt; &quot;70&quot;, &quot;international_economy_freight&quot; =&gt; &quot;86&quot;, &quot;home_delivery&quot; =&gt; &quot;90&quot;, &quot;ground_service&quot; =&gt; &quot;92&quot;, &quot;international_ground_service&quot; =&gt; &quot;92&quot;</td>
115
+ <td class="context-item-value">{ &quot;priority&quot; =&gt; &quot;PRIORITYOVERNIGHT&quot;, &quot;2day&quot; =&gt; &quot;FEDEX2DAY&quot;, &quot;standard_overnight&quot; =&gt; &quot;STANDARDOVERNIGHT&quot;, &quot;first_overnight&quot; =&gt; &quot;FIRSTOVERNIGHT&quot;, &quot;express_saver&quot; =&gt; &quot;FEDEXEXPRESSSAVER&quot;, &quot;1day_freight&quot; =&gt; &quot;FEDEX1DAYFREIGHT&quot;, &quot;2day_freight&quot; =&gt; &quot;FEDEX2DAYFREIGHT&quot;, &quot;3day_freight&quot; =&gt; &quot;FEDEX3DAYFREIGHT&quot;, &quot;international_priority&quot; =&gt; &quot;INTERNATIONALPRIORITY&quot;, &quot;international_economy&quot; =&gt; &quot;INTERNATIONALECONOMY&quot;, &quot;international_first&quot; =&gt; &quot;INTERNATIONALFIRST&quot;, &quot;international_priority_freight&quot; =&gt; &quot;INTERNATIONALPRIORITYFREIGHT&quot;, &quot;international_economy_freight&quot; =&gt; &quot;INTERNATIONALECONOMYFREIGHT&quot;, &quot;home_delivery&quot; =&gt; &quot;GROUNDHOMEDELIVERY&quot;, &quot;ground_service&quot; =&gt; &quot;FEDEXGROUND&quot;, &quot;international_ground_service&quot; =&gt; &quot;INTERNATIONALGROUND&quot;</td>
116
+ <td width="3em">&nbsp;</td>
117
+ <td class="context-item-desc">
118
+ The following type hashes are to allow cross-api data retrieval
119
+
120
+ </td>
113
121
  </tr>
114
122
  <tr class="top-aligned-row context-row">
115
- <td class="context-item-name">TransactionTypes</td>
123
+ <td class="context-item-name">PackageTypes</td>
116
124
  <td>=</td>
117
- <td class="context-item-value">{ 'rate_ground' =&gt; ['022','FDXG'], 'rate_express' =&gt; ['022','FDXE'], 'rate_services' =&gt; ['025',''], 'ship_ground' =&gt; ['021','FDXG'], 'ship_express' =&gt; ['021','FDXE'], 'cancel_express' =&gt; ['023','FDXE'], 'cancel_ground' =&gt; ['023','FDXG'], 'close_ground' =&gt; ['007','FDXG'], 'service_available' =&gt; ['019','FDXE'], 'fedex_locater' =&gt; ['410',''], 'subscribe' =&gt; ['211',''], 'sig_proof_delivery' =&gt; ['402',''], 'track' =&gt; ['405',''], 'ref_track' =&gt; ['403','']</td>
125
+ <td class="context-item-value">{ &quot;fedex_envelope&quot; =&gt; &quot;FEDEXENVELOPE&quot;, &quot;fedex_pak&quot; =&gt; &quot;FEDEXPAK&quot;, &quot;fedex_box&quot; =&gt; &quot;FEDEXBOX&quot;, &quot;fedex_tube&quot; =&gt; &quot;FEDEXTUBE&quot;, &quot;fedex_10_kg_box&quot; =&gt; &quot;FEDEX10KGBOX&quot;, &quot;fedex_25_kg_box&quot; =&gt; &quot;FEDEX25KGBOX&quot;, &quot;your_packaging&quot; =&gt; &quot;YOURPACKAGING&quot;</td>
126
+ </tr>
127
+ <tr class="top-aligned-row context-row">
128
+ <td class="context-item-name">DropoffTypes</td>
129
+ <td>=</td>
130
+ <td class="context-item-value">{ 'regular_pickup' =&gt; 'REGULARPICKUP', 'request_courier' =&gt; 'REQUESTCOURIER', 'dropbox' =&gt; 'DROPBOX', 'business_service_center' =&gt; 'BUSINESSSERVICECENTER', 'station' =&gt; 'STATION'</td>
118
131
  </tr>
119
132
  <tr class="top-aligned-row context-row">
120
- <td class="context-item-name">Tag</td>
133
+ <td class="context-item-name">PaymentTypes</td>
121
134
  <td>=</td>
122
- <td class="context-item-value">{ 0 =&gt; 'transaction_code', 1 =&gt; 'customer_transaction_identifier', 2 =&gt; 'transaction_error_code', 3 =&gt; 'transaction_error_message', 4 =&gt; 'sender_company', 5 =&gt; 'sender_address_line_1', 6 =&gt; 'sender_address_line_2', 7 =&gt; 'sender_city', 8 =&gt; 'sender_state', 9 =&gt; 'sender_postal_code', 10 =&gt; 'sender_fedex_express_account_number', 11 =&gt; 'recipient_company', 12 =&gt; 'recipient_contact_name', 13 =&gt; 'recipient_address_line_1', 14 =&gt; 'recipient_address_line_2', 15 =&gt; 'recipient_city', 16 =&gt; 'recipient_state', 17 =&gt; 'recipient_postal_code', 18 =&gt; 'recipient_phone_number', 20 =&gt; 'payer_account_number', 23 =&gt; 'pay_type', 24 =&gt; 'ship_date', 25 =&gt; 'reference_information', 27 =&gt; 'cod_flag', 28 =&gt; 'cod_return_tracking_number', 29 =&gt; 'tracking_number', 30 =&gt; 'ursa_code', 32 =&gt; 'sender_contact_name', 33 =&gt; 'service_commitment', 38 =&gt; 'sender_department', 40 =&gt; 'alcohol_type', 41 =&gt; 'alcohol_packaging', 44 =&gt; 'hal_address', 46 =&gt; 'hal_city', 47 =&gt; 'hal_state', 48 =&gt; 'hal_postal_code', 49 =&gt; 'hal_phone_number', 50 =&gt; 'recipient_country_code', 51 =&gt; 'signature_release_ok_flag', 52 =&gt; 'alcohol_packages', 57 =&gt; 'dim_height', 58 =&gt; 'dim_width', 59 =&gt; 'dim_length', 65 =&gt; 'astra_barcode', 66 =&gt; 'broker_name', 67 =&gt; 'broker_phone_number', 68 =&gt; 'customs_declared_value_currency_type', 70 =&gt; 'duties_pay_type', 71 =&gt; 'duties_payer_account', 72 =&gt; 'terms_of_sale', 73 =&gt; 'parties_to_transaction', 74 =&gt; 'country_of_ultimate_destination', 75 =&gt; 'weight_units', 76 =&gt; 'commodity_number_of_pieces', 79 =&gt; 'description_of_contents', 80 =&gt; 'country_of_manufacturer', 81 =&gt; 'harmonized_code', 82 =&gt; 'unit_quantity', 83 =&gt; 'export_license_number', 84 =&gt; 'export_license_expiration_date', 99 =&gt; 'end_of_record', 113 =&gt; 'commercial_invoice_flag', 116 =&gt; 'package_total', 117 =&gt; 'sender_country_code', 118 =&gt; 'recipient_irs', 120 =&gt; 'ci_marks_and_numbers', 169 =&gt; 'importer_country', 170 =&gt; 'importer_name', 171 =&gt; 'importer_company', 172 =&gt; 'importer_address_line_1', 173 =&gt; 'importer_address_line_2', 174 =&gt; 'importer_city', 175 =&gt; 'importer_state', 176 =&gt; 'importer_postal_code', 177 =&gt; 'importer_account_number', 178 =&gt; 'importer_number_phone', 180 =&gt; 'importer_id', 183 =&gt; 'sender_phone_number', 186 =&gt; 'cod_add_freight_charges_flag', 188 =&gt; 'label_buffer_data_stream', 190 =&gt; 'document_pib_shipment_flag', 194 =&gt; 'delivery_day', 195 =&gt; 'destination', 198 =&gt; 'destination_location_id', 404 =&gt; 'commodity_license_exception', 409 =&gt; 'delivery_date', 411 =&gt; 'cod_return_label_buffer_data_stream', 413 =&gt; 'nafta_flag', 414 =&gt; 'commodity_unit_of_measure', 418 =&gt; 'ci_comments', 431 =&gt; 'dim_weight_used_flag', 439 =&gt; 'cod_return_contact_name', 440 =&gt; 'residential_delivery_flag', 496 =&gt; 'freight_service_commitment', 498 =&gt; 'meter_number', 526 =&gt; 'form_id', 527 =&gt; 'cod_return_form_id', 528 =&gt; 'commodity_eccn', 535 =&gt; 'cod_return', 536 =&gt; 'cod_return_service_commitment', 543 =&gt; 'cod_return_collect_plus_freight_amount', 557 =&gt; 'message_type_code', 558 =&gt; 'message_code', 559 =&gt; 'message_text', 600 =&gt; 'forwarding_agent_routed_export_transaction_indicator', 602 =&gt; 'exporter_ein_ssn_indicator', 603 =&gt; 'int-con_company_name', 604 =&gt; 'int-con_contact_name', 605 =&gt; 'int-con_address_line_1', 606 =&gt; 'int-con_address_line_2', 607 =&gt; 'int-con_city', 608 =&gt; 'int-con_state', 609 =&gt; 'int-con_zip', 610 =&gt; 'int-con_phone_number', 611 =&gt; 'int-con_country', 1005 =&gt; 'manifest_invoic_e_file_name', 1006 =&gt; 'domain_name', 1007 =&gt; 'close_manifest_date', 1008 =&gt; 'package_ready_time', 1009 =&gt; 'time_companyclose', 1032 =&gt; 'duties_payer_country_code', 1089 =&gt; 'rate_scale', 1090 =&gt; 'rate_currency_type', 1092 =&gt; 'rate_zone', 1096 =&gt; 'origin_location_id', 1099 =&gt; 'volume_units', 1101 =&gt; 'payer_credit_card_number', 1102 =&gt; 'payer_credit_card_type', 1103 =&gt; 'sender_fax', 1104 =&gt; 'payer_credit_card_expiration_date', 1115 =&gt; 'ship_time', 1116 =&gt; 'dim_units', 1117 =&gt; 'package_sequence', 1118 =&gt; 'release_authorization_number', 1119 =&gt; 'future_day_shipment', 1120 =&gt; 'inside_pickup_flag', 1121 =&gt; 'inside_delivery_flag', 1123 =&gt; 'master_tracking_number', 1124 =&gt; 'master_form_id', 1137 =&gt; 'ursa_uned_prefix', 1139 =&gt; 'sender_irs_ein_number', 1145 =&gt; 'recipient_department', 1159 =&gt; 'scan_description', 1160 =&gt; 'scan_location_city', 1161 =&gt; 'scan_location_state', 1162 =&gt; 'scan_date', 1163 =&gt; 'scan_time', 1164 =&gt; 'scan_location_country', 1167 =&gt; 'disp_exception_cd', 1168 =&gt; 'status_exception_cd', 1174 =&gt; 'bso_flag', 1178 =&gt; 'ursa_suffix_code', 1179 =&gt; 'broker_fdx_account_number', 1180 =&gt; 'broker_company', 1181 =&gt; 'broker_line_1_address', 1182 =&gt; 'broker_line_2_address', 1183 =&gt; 'broker_city', 1184 =&gt; 'broker_state', 1185 =&gt; 'broker_postal_code', 1186 =&gt; 'broker_country_code', 1187 =&gt; 'broker_id_number', 1193 =&gt; 'ship_delete_message', 1195 =&gt; 'payer_country_code', 1200 =&gt; 'hold_at_location_hal_flag', 1201 =&gt; 'sender_email_address', 1202 =&gt; 'recipient_email_address', 1203 =&gt; 'optional_ship_alert_message', 1204 =&gt; 'ship_alert_email_address', 1206 =&gt; 'ship_alert_notification_flag', 1208 =&gt; 'no_indirect_delivery_flag_signature_required', 1210 =&gt; 'purpose_of_shipment', 1211 =&gt; 'pod_address', 1213 =&gt; 'proactive_notification_flag', 1237 =&gt; 'cod_return_phone', 1238 =&gt; 'cod_return_company', 1239 =&gt; 'cod_return_department', 1240 =&gt; 'cod_return_address_1', 1241 =&gt; 'cod_return_address_2', 1242 =&gt; 'cod_return_city', 1243 =&gt; 'cod_return_state', 1244 =&gt; 'cod_return_postal_code', 1253 =&gt; 'packaging_list_enclosed_flag', 1265 =&gt; 'hold_at_location_contact_name', 1266 =&gt; 'saturday_delivery_flag', 1267 =&gt; 'saturday_pickup_flag', 1268 =&gt; 'dry_ice_flag', 1271 =&gt; 'shippers_load_and_count_slac', 1272 =&gt; 'booking_number', 1273 =&gt; 'packaging_type', 1274 =&gt; 'service_type', 1286 =&gt; 'exporter_ppi-_contact_name', 1287 =&gt; 'exporter_ppi-company_name', 1288 =&gt; 'exporter_ppi-address_line_1', 1289 =&gt; 'exporter_ppi-address_line_2', 1290 =&gt; 'exporter_ppi-city', 1291 =&gt; 'exporter_ppi-state', 1292 =&gt; 'exporter_ppi-zip', 1293 =&gt; 'exporter_ppi-country', 1294 =&gt; 'exporter_ppi-phone_number', 1295 =&gt; 'exporter_ppi-ein_ssn', 1297 =&gt; 'customer_invoice_number', 1300 =&gt; 'purchase_order_number', 1331 =&gt; 'dangerous', 1332 =&gt; 'alcohol_flag', 1333 =&gt; 'drop_off_type', 1337 =&gt; 'package_content_information', 1339 =&gt; 'estimated_delivery_date', 1340 =&gt; 'estimated_delivery_time', 1341 =&gt; 'sender_pager_number', 1342 =&gt; 'recipient_pager_number', 1343 =&gt; 'broker_email_address', 1344 =&gt; 'broker_fax_number', 1346 =&gt; 'emerge_shipment_identifier', 1347 =&gt; 'emerge_merchant_identifier', 1349 =&gt; 'aes_filing_status', 1350 =&gt; 'xtn_suffix_number', 1352 =&gt; 'sender_ein_ssn_identificator', 1358 =&gt; 'aes_ftsr_exemption_number', 1359 =&gt; 'sed_legend_number', 1366 =&gt; 'close_manifest_time', 1367 =&gt; 'close_manifest_data_buffer', 1368 =&gt; 'label_type', 1369 =&gt; 'label_printer_type', 1370 =&gt; 'label_media_type', 1371 =&gt; 'manifest_only_request_flag', 1372 =&gt; 'manifest_total', 1376 =&gt; 'rate_weight_unit_of_measure', 1377 =&gt; 'dim_weight_unit_of_measure', 1391 =&gt; 'client_revision_indicator', 1392 =&gt; 'inbound_visibility_block_shipment_data_indicator', 1394 =&gt; 'shipment_content_records_total', 1395 =&gt; 'part_number', 1396 =&gt; 'sku_item_upc', 1397 =&gt; 'receive_quantity', 1398 =&gt; 'description', 1399 =&gt; 'aes_entry_number', 1400 =&gt; 'total_shipment_weight', 1401 =&gt; 'total_package_weight', 1402 =&gt; 'billed_weight', 1403 =&gt; 'dim_weight', 1404 =&gt; 'total_volume', 1405 =&gt; 'alcohol_volume', 1406 =&gt; 'dry_ice_weight', 1407 =&gt; 'commodity_weight', 1408 =&gt; 'commodity_unit_value', 1409 =&gt; 'cod_amount', 1410 =&gt; 'commodity_customs_value', 1411 =&gt; 'total_customs_value', 1412 =&gt; 'freight_charge', 1413 =&gt; 'insurance_charge', 1414 =&gt; 'taxes_miscellaneous_charge', 1415 =&gt; 'declared_value', 1416 =&gt; 'base_rate_amount', 1417 =&gt; 'total_surcharge_amount', 1418 =&gt; 'total_discount_amount', 1419 =&gt; 'net_charge_amount', 1420 =&gt; 'total_rebate_amount', 1429 =&gt; 'list_variable_handling_charge_amount', 1431 =&gt; 'list_total_customer_charge', 1432 =&gt; 'cod_customer_amount', 1450 =&gt; 'more_data_indicator', 1451 =&gt; 'sequence_number', 1452 =&gt; 'last_tracking_number', 1453 =&gt; 'track_reference_type', 1454 =&gt; 'track_reference', 1456 =&gt; 'spod_type_request', 1458 =&gt; 'spod_fax_recipient_name', 1459 =&gt; 'spod_fax_recipient_number', 1460 =&gt; 'spod_fax_sender_name', 1461 =&gt; 'spod_fax_sender_phone_number', 1462 =&gt; 'language_indicator', 1463 =&gt; 'spod_fax_recipient_company_name_mail', 1464 =&gt; 'spod_fax_recipient_address_line_1_mail', 1465 =&gt; 'spod_fax_recipient_address_line_2_mail', 1466 =&gt; 'spod_fax_recipient_city_mail', 1467 =&gt; 'spod_fax_recipient_state_mail', 1468 =&gt; 'spod_fax_recipient_zip_postal_code_mail', 1469 =&gt; 'spod_fax_recipient_country_mail', 1470 =&gt; 'spod_fax_confirmation', 1471 =&gt; 'spod_letter', 1472 =&gt; 'spod_ground_recipient_name', 1473 =&gt; 'spod_ground_recipient_company_name', 1474 =&gt; 'spod_ground_recipient_address_line_1', 1475 =&gt; 'spod_ground_recipient_address_line_2', 1476 =&gt; 'spod_ground_recipient_city', 1477 =&gt; 'spod_ground_recipient_state_province', 1478 =&gt; 'spod_ground_recipient_zip_postal_code', 1479 =&gt; 'spod_ground_recipient_country', 1480 =&gt; 'more_information', 1507 =&gt; 'list_total_surcharge_amount', 1525 =&gt; 'effective_net_discount', 1528 =&gt; 'list_net_charge_amount', 1529 =&gt; 'rate_indicator_1_numeric_valid_values', 1530 =&gt; 'list_base_rate_amount', 1531 =&gt; 'list_total_discount_amount', 1532 =&gt; 'list_total_rebate_amount', 1534 =&gt; 'detail_scan_indicator', 1535 =&gt; 'paging_token', 1536 =&gt; 'number_of_relationships', 1537 =&gt; 'search_relationship_string', 1538 =&gt; 'search_relationship_type_code', 1551 =&gt; 'delivery_notification_flag', 1552 =&gt; 'language_code', 1553 =&gt; 'shipper_delivery_notification_flag', 1554 =&gt; 'shipper_ship_alert_flag', 1555 =&gt; 'shipper_language_code', 1556 =&gt; 'recipient_delivery_notification_flag', 1557 =&gt; 'recipient_ship_alert_flag', 1558 =&gt; 'recipient_language_code', 1559 =&gt; 'broker_delivery_notification_flag', 1560 =&gt; 'broker_ship_alert_flag', 1561 =&gt; 'broker_language_code', 1562 =&gt; 'fedex_staffed_location_flag', 1563 =&gt; 'fedex_self_service_location_indicator', 1564 =&gt; 'fasc', 1565 =&gt; 'latest_express_dropoff_flag', 1566 =&gt; 'express_dropoff_after_time', 1567 =&gt; 'fedex_location_intersection_street_address', 1568 =&gt; 'distance', 1569 =&gt; 'hours_of_operation', 1570 =&gt; 'hours_of_operation_sat', 1571 =&gt; 'last_express_dropoff', 1572 =&gt; 'last_express_dropoff_sat', 1573 =&gt; 'express_service_flag', 1574 =&gt; 'location_count', 1575 =&gt; 'fedex_location_business_name', 1576 =&gt; 'fedex_location_business_type', 1577 =&gt; 'fedex_location_city', 1578 =&gt; 'fedex_location_state', 1579 =&gt; 'fedex_location_postal_code', 1580 =&gt; 'dangerous_goods_flag', 1581 =&gt; 'saturday_service_flag', 1582 =&gt; 'begin_date', 1583 =&gt; 'end_date', 1584 =&gt; 'tracking_groups', 1606 =&gt; 'variable_handling_charge_level', 1607 =&gt; 'doc_tab_header_1', 1608 =&gt; 'doc_tab_header_2', 1609 =&gt; 'doc_tab_header_3', 1610 =&gt; 'doc_tab_header_4', 1611 =&gt; 'doc_tab_header_5', 1612 =&gt; 'doc_tab_header_6', 1613 =&gt; 'doc_tab_header_7', 1614 =&gt; 'doc_tab_header_8', 1615 =&gt; 'doc_tab_header_9', 1616 =&gt; 'doc_tab_header_10', 1617 =&gt; 'doc_tab_header_11', 1618 =&gt; 'doc_tab_header_12', 1624 =&gt; 'doc_tab_field_1', 1625 =&gt; 'doc_tab_field_2', 1626 =&gt; 'doc_tab_field_3', 1627 =&gt; 'doc_tab_field_4', 1628 =&gt; 'doc_tab_field_5', 1629 =&gt; 'doc_tab_field_6', 1630 =&gt; 'doc_tab_field_7', 1631 =&gt; 'doc_tab_field_8', 1632 =&gt; 'doc_tab_field_9', 1633 =&gt; 'doc_tab_field_10', 1634 =&gt; 'doc_tab_field_11', 1635 =&gt; 'doc_tab_field_12', 1636 =&gt; 'delivery_area_surcharge', 1637 =&gt; 'list_delivery_area_surcharge', 1638 =&gt; 'fuel_surcharge', 1639 =&gt; 'list_fuel_surcharge', 1640 =&gt; 'fice_surcharge', 1642 =&gt; 'value_added_tax', 1644 =&gt; 'offshore_surcharge', 1645 =&gt; 'list_offshore_surcharge', 1649 =&gt; 'other_surcharges', 1650 =&gt; 'list_other_surcharges', 1704 =&gt; 'service_type_description', 1705 =&gt; 'deliver_to', 1706 =&gt; 'signed_for', 1707 =&gt; 'delivery_time', 1711 =&gt; 'status_exception', 1713 =&gt; 'tracking_cod_flag', 1715 =&gt; 'number_of_track_activities', 1716 =&gt; 'delivery_reattempt_date', 1717 =&gt; 'delivery_reattempt_time', 1718 =&gt; 'package_type_description', 1720 =&gt; 'delivery_date_numeric', 1721 =&gt; 'tracking_activity_line_1', 1722 =&gt; 'tracking_activity_line_2', 1723 =&gt; 'tracking_activity_line_3', 1724 =&gt; 'tracking_activity_line_4', 1725 =&gt; 'tracking_activity_line_5', 1726 =&gt; 'tracking_activity_line_6', 1727 =&gt; 'tracking_activity_line_7', 1728 =&gt; 'tracking_activity_line_8', 1729 =&gt; 'tracking_activity_line_9', 1730 =&gt; 'tracking_activity_line_10', 1731 =&gt; 'tracking_activity_line_11', 1732 =&gt; 'tracking_activity_line_12', 1733 =&gt; 'tracking_activity_line_13', 1734 =&gt; 'tracking_activity_line_14', 1735 =&gt; 'tracking_activity_line_15', 2254 =&gt; 'recipient_fax_number', 2382 =&gt; 'return_shipment_indicator', 3000 =&gt; 'cod_type_collection', 3001 =&gt; 'fedex_ground_purchase_order', 3002 =&gt; 'fedex_ground_invoice', 3003 =&gt; 'fedex_ground_customer_reference', 3008 =&gt; 'autopod_flag', 3009 =&gt; 'aod_flag', 3010 =&gt; 'oversize_flag', 3011 =&gt; 'other_oversize_flag', 3018 =&gt; 'nonstandard_container_flag', 3019 =&gt; 'fedex_signature_home_delivery_flag', 3020 =&gt; 'fedex_home_delivery_type', 3023 =&gt; 'fedex_home_delivery_date', 3024 =&gt; 'fedex_home_delivery_phone_number', 3025 =&gt; 'carrier_code', 3028 =&gt; 'ground_account_number', 3035 =&gt; 'ship_alert_fax_number', 3045 =&gt; 'cod_return_reference_indicator', 3046 =&gt; 'additional_handling_detected', 3053 =&gt; 'multiweight_net_charge', 3090 =&gt; 'last_ground_dropoff', 3091 =&gt; 'last_ground_dropoff_sat', 3092 =&gt; 'ground_service_flag', 3124 =&gt; 'oversize_classification', 4003 =&gt; 'subscriber_contact_name', 4004 =&gt; 'subscriber_password_reminder', 4007 =&gt; 'subscriber_company_name', 4008 =&gt; 'subscriber_address_line_1', 4009 =&gt; 'subscriber_address_line_2', 4011 =&gt; 'subscriber_city_name', 4012 =&gt; 'subscriber_state_code', 4013 =&gt; 'subscriber_postal_code', 4014 =&gt; 'subscriber_country_code', 4015 =&gt; 'subscriber_phone_number', 4017 =&gt; 'subscriber_pager_number', 4018 =&gt; 'subscriber_email_address', 4021 =&gt; 'subscription_service_name', 4022 =&gt; 'subscriber_fax_number'</td>
135
+ <td class="context-item-value">{ 'sender' =&gt; 'SENDER', 'recipient' =&gt; 'RECIPIENT', 'third_party' =&gt; 'THIRDPARTY', 'collect' =&gt; 'COLLECT'</td>
136
+ </tr>
137
+ <tr class="top-aligned-row context-row">
138
+ <td class="context-item-name">TransactionTypes</td>
139
+ <td>=</td>
140
+ <td class="context-item-value">{ 'rate_ground' =&gt; ['022','FDXG'], 'rate_express' =&gt; ['022','FDXE'], 'rate_services' =&gt; ['025',''], 'ship_ground' =&gt; ['021','FDXG'], 'ship_express' =&gt; ['021','FDXE'], 'cancel_express' =&gt; ['023','FDXE'], 'cancel_ground' =&gt; ['023','FDXG'], 'close_ground' =&gt; ['007','FDXG'], 'service_available' =&gt; ['019','FDXE'], 'fedex_locater' =&gt; ['410',''], 'subscribe' =&gt; ['211',''], 'sig_proof_delivery' =&gt; ['402',''], 'track' =&gt; ['405',''], 'ref_track' =&gt; ['403','']</td>
123
141
  </tr>
124
142
  </table>
125
143
  </div>
@@ -152,6 +170,56 @@ consideration)
152
170
  </div>
153
171
  </div>
154
172
 
173
+ <div id="method-M000005" class="method-detail">
174
+ <a name="M000005"></a>
175
+
176
+ <div class="method-heading">
177
+ <a href="FedEx.src/M000005.html" target="Code" class="method-signature"
178
+ onclick="popupCode('FedEx.src/M000005.html');return false;">
179
+ <span class="method-name">express_service_availability</span><span class="method-args">()</span>
180
+ </a>
181
+ </div>
182
+
183
+ <div class="method-description">
184
+ <p>
185
+ still not sure what the best way to handle this transaction&#8217;s return
186
+ data would be. Possibly a hash of the form {service =&gt;
187
+ delivery_estimate}?
188
+ </p>
189
+ </div>
190
+ </div>
191
+
192
+ <div id="method-M000007" class="method-detail">
193
+ <a name="M000007"></a>
194
+
195
+ <div class="method-heading">
196
+ <a href="FedEx.src/M000007.html" target="Code" class="method-signature"
197
+ onclick="popupCode('FedEx.src/M000007.html');return false;">
198
+ <span class="method-name">label</span><span class="method-args">()</span>
199
+ </a>
200
+ </div>
201
+
202
+ <div class="method-description">
203
+ <p>
204
+ require &#8216;fileutils&#8217; fedex = Shipping::FedEx.new :name =&gt;
205
+ &#8216;John Doe&#8217;, &#8230; , :sender_zip =&gt; 97202 label =
206
+ fedex.label
207
+ </p>
208
+ <pre>
209
+ puts label.url
210
+ </pre>
211
+ <p>
212
+ puts label.tracking_number
213
+ </p>
214
+ <pre>
215
+ In the future you will be able to do:
216
+ </pre>
217
+ <p>
218
+ FileUtils.cp label.image.path, &#8217;/path/to/my/images/directory/&#8217;
219
+ </p>
220
+ </div>
221
+ </div>
222
+
155
223
  <div id="method-M000003" class="method-detail">
156
224
  <a name="M000003"></a>
157
225
 
@@ -169,6 +237,20 @@ Gets the total price of the shipping
169
237
  </div>
170
238
  </div>
171
239
 
240
+ <div id="method-M000006" class="method-detail">
241
+ <a name="M000006"></a>
242
+
243
+ <div class="method-heading">
244
+ <a href="FedEx.src/M000006.html" target="Code" class="method-signature"
245
+ onclick="popupCode('FedEx.src/M000006.html');return false;">
246
+ <span class="method-name">register</span><span class="method-args">()</span>
247
+ </a>
248
+ </div>
249
+
250
+ <div class="method-description">
251
+ </div>
252
+ </div>
253
+
172
254
 
173
255
  </div>
174
256
 
@@ -10,11 +10,11 @@
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/shipping/fedex.rb, line 8</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/shipping/fedex.rb, line 11</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">price</span>
15
15
  <span class="ruby-identifier">get_price</span>
16
- <span class="ruby-identifier">p</span> = <span class="ruby-ivar">@response</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/.*&quot;#{Tag.index 'net_charge_amount'}(-1)?,&quot;([^&quot;]+)&quot;.*99,&quot;&quot;/</span>,<span class="ruby-value str">'\2'</span>).<span class="ruby-identifier">to_f</span>
17
- <span class="ruby-identifier">raise</span> <span class="ruby-constant">ShippingError</span>, <span class="ruby-ivar">@response</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/.*&quot;3,&quot;([^&quot;]+)&quot;.*99,&quot;&quot;/</span>,<span class="ruby-value str">'\1'</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">p</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
16
+ <span class="ruby-identifier">p</span> = <span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">XPath</span>.<span class="ruby-identifier">first</span>(<span class="ruby-ivar">@response</span>, <span class="ruby-value str">&quot;//FDXRateReply/EstimatedCharges/DiscountedCharges/NetCharge&quot;</span>).<span class="ruby-identifier">text</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
17
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">ShippingError</span>, <span class="ruby-identifier">get_error</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">p</span>.<span class="ruby-identifier">nil?</span>
18
18
  <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">p</span>
19
19
  <span class="ruby-keyword kw">end</span></pre>
20
20
  </body>
@@ -10,11 +10,11 @@
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/shipping/fedex.rb, line 16</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/shipping/fedex.rb, line 19</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">base_price</span>
15
15
  <span class="ruby-identifier">get_price</span>
16
- <span class="ruby-identifier">p</span> = <span class="ruby-ivar">@response</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/.*&quot;#{Tag.index 'base_rate_amount'}(-1)?,&quot;([^&quot;]+)&quot;.*99,&quot;&quot;/</span>,<span class="ruby-value str">'\2'</span>).<span class="ruby-identifier">to_f</span>
17
- <span class="ruby-identifier">raise</span> <span class="ruby-constant">ShippingError</span>, <span class="ruby-ivar">@response</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/.*&quot;3,&quot;([^&quot;]+)&quot;.*99,&quot;&quot;/</span>,<span class="ruby-value str">'\1'</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">p</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
16
+ <span class="ruby-identifier">p</span> = <span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">XPath</span>.<span class="ruby-identifier">first</span>(<span class="ruby-ivar">@response</span>, <span class="ruby-value str">&quot;//FDXRateReply/EstimatedCharges/DiscountedCharges/BaseCharge&quot;</span>).<span class="ruby-identifier">text</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
17
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">ShippingError</span>, <span class="ruby-identifier">get_error</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">p</span>.<span class="ruby-identifier">nil?</span>
18
18
  <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">p</span>
19
19
  <span class="ruby-keyword kw">end</span></pre>
20
20
  </body>
@@ -0,0 +1,39 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>express_service_availability (Shipping::FedEx)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/shipping/fedex.rb, line 27</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">express_service_availability</span>
15
+
16
+ <span class="ruby-ivar">@data</span> = <span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>
17
+ <span class="ruby-identifier">b</span> = <span class="ruby-constant">Builder</span><span class="ruby-operator">::</span><span class="ruby-constant">XmlMarkup</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">:target</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@data</span>
18
+ <span class="ruby-identifier">b</span>.<span class="ruby-identifier">instruct!</span>
19
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">FDXServiceAvailabilityRequest</span>(<span class="ruby-value str">'xmlns:api'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'http://www.fedex.com/fsmapi'</span>, <span class="ruby-value str">'xmlns:xsi'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'http://www.w3.org/2001/XMLSchema-instance'</span>, <span class="ruby-value str">'xsi:noNamespaceSchemaLocation'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'FDXServiceAvailabilityRequest.xsd'</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
20
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">RequestHeader</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
21
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">AccountNumber</span> <span class="ruby-ivar">@fedex_account</span>
22
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">MeterNumber</span> <span class="ruby-ivar">@fedex_meter</span>
23
+ }
24
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">OriginAddress</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
25
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">PostalCode</span> <span class="ruby-ivar">@sender_zip</span>
26
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">CountryCode</span> <span class="ruby-ivar">@sender_country_code</span> <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;US&quot;</span>
27
+ }
28
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">DestinationAddress</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
29
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">PostalCode</span> <span class="ruby-ivar">@zip</span>
30
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">CountryCode</span> <span class="ruby-ivar">@country</span> <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;US&quot;</span>
31
+ }
32
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">ShipDate</span> <span class="ruby-ivar">@ship_date</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@ship_date</span>.<span class="ruby-identifier">nil?</span>
33
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">PackageCount</span> <span class="ruby-ivar">@package_total</span> <span class="ruby-operator">||</span> <span class="ruby-value str">'1'</span>
34
+ }
35
+
36
+ <span class="ruby-identifier">get_response</span> <span class="ruby-ivar">@fedex_url</span>
37
+ <span class="ruby-keyword kw">end</span></pre>
38
+ </body>
39
+ </html>
@@ -0,0 +1,50 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>register (Shipping::FedEx)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/shipping/fedex.rb, line 52</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">register</span>
15
+ <span class="ruby-ivar">@required</span> = [<span class="ruby-identifier">:name</span>, <span class="ruby-identifier">:company</span>, <span class="ruby-identifier">:phone</span>, <span class="ruby-identifier">:email</span>, <span class="ruby-identifier">:address</span>, <span class="ruby-identifier">:city</span>, <span class="ruby-identifier">:state</span>, <span class="ruby-identifier">:zip</span>]
16
+ <span class="ruby-ivar">@required</span> <span class="ruby-operator">+=</span> [<span class="ruby-identifier">:fedex_account</span>, <span class="ruby-identifier">:fedex_url</span>]
17
+
18
+ <span class="ruby-identifier">state</span> = <span class="ruby-constant">STATES</span>.<span class="ruby-identifier">has_value?</span>(<span class="ruby-ivar">@state</span>.<span class="ruby-identifier">downcase</span>) <span class="ruby-operator">?</span> <span class="ruby-constant">STATES</span>.<span class="ruby-identifier">index</span>(<span class="ruby-ivar">@state</span>.<span class="ruby-identifier">downcase</span>).<span class="ruby-identifier">upcase</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@state</span>.<span class="ruby-identifier">upcase</span>
19
+
20
+ <span class="ruby-ivar">@data</span> = <span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>
21
+ <span class="ruby-identifier">b</span> = <span class="ruby-constant">Builder</span><span class="ruby-operator">::</span><span class="ruby-constant">XmlMarkup</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">:target</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@data</span>
22
+ <span class="ruby-identifier">b</span>.<span class="ruby-identifier">instruct!</span>
23
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">FDXSubscriptionRequest</span>(<span class="ruby-value str">'xmlns:api'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'http://www.fedex.com/fsmapi'</span>, <span class="ruby-value str">'xmlns:xsi'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'http://www.w3.org/2001/XMLSchema-instance'</span>, <span class="ruby-value str">'xsi:noNamespaceSchemaLocation'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'FDXSubscriptionRequest.xsd'</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
24
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">RequestHeader</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
25
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">CustomerTransactionIdentifier</span> <span class="ruby-ivar">@transaction_identifier</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@transaction_identifier</span> <span class="ruby-comment cmt"># optional</span>
26
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">AccountNumber</span> <span class="ruby-ivar">@fedex_account</span>
27
+ }
28
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">Contact</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
29
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">PersonName</span> <span class="ruby-ivar">@name</span>
30
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">CompanyName</span> <span class="ruby-ivar">@company</span>
31
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">Department</span> <span class="ruby-ivar">@department</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@department</span>
32
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">PhoneNumber</span> <span class="ruby-ivar">@phone</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/[^\d]/</span>,<span class="ruby-value str">&quot;&quot;</span>)
33
+ <span class="ruby-identifier">b</span>.<span class="ruby-identifier">tag!</span> <span class="ruby-value str">&quot;E-MailAddress&quot;</span><span class="ruby-value str">&quot;E-MailAddress&quot;</span>, <span class="ruby-ivar">@email</span>
34
+ }
35
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">Address</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
36
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">Line1</span> <span class="ruby-ivar">@address</span>
37
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">Line2</span> <span class="ruby-ivar">@address2</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@address2</span>
38
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">City</span> <span class="ruby-ivar">@city</span>
39
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">StateOrProvinceCode</span> <span class="ruby-identifier">state</span>
40
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">PostalCode</span> <span class="ruby-ivar">@zip</span>
41
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">CountryCode</span> <span class="ruby-ivar">@country</span> <span class="ruby-operator">||</span> <span class="ruby-value str">'US'</span>
42
+ }
43
+ }
44
+
45
+ <span class="ruby-identifier">get_response</span> <span class="ruby-ivar">@fedex_url</span>
46
+
47
+ <span class="ruby-keyword kw">return</span> <span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">XPath</span>.<span class="ruby-identifier">first</span>(<span class="ruby-ivar">@response</span>, <span class="ruby-value str">&quot;//FDXSubscriptionReply/MeterNumber&quot;</span>).<span class="ruby-identifier">text</span>
48
+ <span class="ruby-keyword kw">end</span></pre>
49
+ </body>
50
+ </html>
@@ -0,0 +1,155 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>label (Shipping::FedEx)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/shipping/fedex.rb, line 98</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">label</span>
15
+ <span class="ruby-ivar">@required</span> = [<span class="ruby-identifier">:phone</span>, <span class="ruby-identifier">:email</span>, <span class="ruby-identifier">:address</span>, <span class="ruby-identifier">:city</span>, <span class="ruby-identifier">:state</span>, <span class="ruby-identifier">:zip</span> ]
16
+ <span class="ruby-ivar">@required</span> <span class="ruby-operator">+=</span> [<span class="ruby-identifier">:sender_phone</span>, <span class="ruby-identifier">:sender_email</span>, <span class="ruby-identifier">:sender_address</span>, <span class="ruby-identifier">:sender_city</span>, <span class="ruby-identifier">:sender_state</span>, <span class="ruby-identifier">:sender_zip</span> ]
17
+ <span class="ruby-ivar">@required</span> <span class="ruby-operator">+=</span> [<span class="ruby-identifier">:fedex_account</span>, <span class="ruby-identifier">:fedex_url</span>]
18
+
19
+ <span class="ruby-ivar">@transaction_type</span> <span class="ruby-operator">||=</span> <span class="ruby-value str">'rate_ground'</span>
20
+ <span class="ruby-ivar">@weight</span> = (<span class="ruby-ivar">@weight</span>.<span class="ruby-identifier">to_f</span><span class="ruby-operator">*</span><span class="ruby-value">10</span>).<span class="ruby-identifier">round</span><span class="ruby-operator">/</span><span class="ruby-value">10.0</span>
21
+ <span class="ruby-ivar">@declared_value</span> = (<span class="ruby-ivar">@declared_value</span>.<span class="ruby-identifier">to_f</span><span class="ruby-operator">*</span><span class="ruby-value">100</span>).<span class="ruby-identifier">round</span><span class="ruby-operator">/</span><span class="ruby-value">100.0</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@declared_value</span>.<span class="ruby-identifier">nil?</span>
22
+ <span class="ruby-identifier">state</span> = <span class="ruby-constant">STATES</span>.<span class="ruby-identifier">has_value?</span>(<span class="ruby-ivar">@state</span>.<span class="ruby-identifier">downcase</span>) <span class="ruby-operator">?</span> <span class="ruby-constant">STATES</span>.<span class="ruby-identifier">index</span>(<span class="ruby-ivar">@state</span>.<span class="ruby-identifier">downcase</span>).<span class="ruby-identifier">upcase</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@state</span>.<span class="ruby-identifier">upcase</span>
23
+ <span class="ruby-identifier">sender_state</span> = <span class="ruby-constant">STATES</span>.<span class="ruby-identifier">has_value?</span>(<span class="ruby-ivar">@sender_state</span>.<span class="ruby-identifier">downcase</span>) <span class="ruby-operator">?</span> <span class="ruby-constant">STATES</span>.<span class="ruby-identifier">index</span>(<span class="ruby-ivar">@sender_state</span>.<span class="ruby-identifier">downcase</span>).<span class="ruby-identifier">upcase</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@sender_state</span>.<span class="ruby-identifier">upcase</span>
24
+
25
+ <span class="ruby-ivar">@data</span> = <span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>
26
+
27
+ <span class="ruby-identifier">b</span> = <span class="ruby-constant">Builder</span><span class="ruby-operator">::</span><span class="ruby-constant">XmlMarkup</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">:target</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@data</span>
28
+ <span class="ruby-identifier">b</span>.<span class="ruby-identifier">instruct!</span>
29
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">FDXEmailLabelRequest</span>(<span class="ruby-value str">'xmlns:api'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'http://www.fedex.com/fsmapi'</span>, <span class="ruby-value str">'xmlns:xsi'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'http://www.w3.org/2001/XMLSchema-instance'</span>, <span class="ruby-value str">'xsi:noNamespaceSchemaLocation'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'FDXEmailLabelRequest.xsd'</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
30
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">RequestHeader</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
31
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">AccountNumber</span> <span class="ruby-ivar">@fedex_account</span>
32
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">MeterNumber</span> <span class="ruby-ivar">@fedex_meter</span>
33
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">CarrierCode</span> <span class="ruby-constant">TransactionTypes</span>[<span class="ruby-ivar">@transaction_type</span>][<span class="ruby-value">1</span>]
34
+ }
35
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">URLExpirationDate</span>((<span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span> <span class="ruby-operator">+</span> <span class="ruby-value">3600</span><span class="ruby-operator">*</span><span class="ruby-value">24</span>).<span class="ruby-identifier">strftime</span>(<span class="ruby-value str">&quot;%Y-%m-%d&quot;</span>))
36
+ <span class="ruby-identifier">b</span>.<span class="ruby-identifier">tag!</span> <span class="ruby-value str">&quot;URLNotificationE-MailAddress&quot;</span><span class="ruby-value str">&quot;URLNotificationE-MailAddress&quot;</span>, <span class="ruby-ivar">@sender_email</span>
37
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">MerchantPhoneNumber</span> <span class="ruby-ivar">@sender_phone</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/[^\d]/</span>,<span class="ruby-value str">&quot;&quot;</span>)
38
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">Service</span> <span class="ruby-constant">ServiceTypes</span>[<span class="ruby-ivar">@service_type</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">ServiceTypes</span>[<span class="ruby-value str">'ground_service'</span>] <span class="ruby-comment cmt"># default to ground service</span>
39
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">Packaging</span> <span class="ruby-constant">PackageTypes</span>[<span class="ruby-ivar">@packaging_type</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">'YOURPACKAGING'</span>
40
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">WeightUnits</span> <span class="ruby-ivar">@weight_units</span> <span class="ruby-operator">||</span> <span class="ruby-value str">'LBS'</span> <span class="ruby-comment cmt"># or KGS</span>
41
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">CurrencyCode</span> <span class="ruby-ivar">@currency_code</span> <span class="ruby-operator">||</span> <span class="ruby-value str">'USD'</span>
42
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">Origin</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
43
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">Contact</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
44
+ <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@sender_name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">2</span>
45
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">PersonName</span> <span class="ruby-ivar">@sender_name</span>
46
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">CompanyName</span> <span class="ruby-ivar">@sender_company</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@sender_company</span>.<span class="ruby-identifier">nil?</span>
47
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-ivar">@sender_company</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">2</span>
48
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">PersonName</span> <span class="ruby-ivar">@sender_name</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@sender_name</span>.<span class="ruby-identifier">nil?</span>
49
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">CompanyName</span> <span class="ruby-ivar">@sender_company</span>
50
+ <span class="ruby-keyword kw">else</span>
51
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">ShippingError</span>, <span class="ruby-value str">&quot;Either the sender_name or the sender_company value must be bigger than 2 characters.&quot;</span>
52
+ <span class="ruby-keyword kw">end</span>
53
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">Department</span> <span class="ruby-ivar">@sender_department</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@sender_department</span>.<span class="ruby-identifier">nil?</span>
54
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">PhoneNumber</span> <span class="ruby-ivar">@sender_phone</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/[^\d]/</span>,<span class="ruby-value str">&quot;&quot;</span>)
55
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">PagerNumber</span> <span class="ruby-ivar">@sender_pager</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/[^\d]/</span>,<span class="ruby-value str">&quot;&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@sender_pager</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-constant">String</span>
56
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">FaxNumber</span> <span class="ruby-ivar">@sender_fax</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/[^\d]/</span>,<span class="ruby-value str">&quot;&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@sender_fax</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-constant">String</span>
57
+ <span class="ruby-identifier">b</span>.<span class="ruby-identifier">tag!</span> <span class="ruby-value str">&quot;E-MailAddress&quot;</span><span class="ruby-value str">&quot;E-MailAddress&quot;</span>, <span class="ruby-ivar">@sender_email</span>
58
+ }
59
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">Address</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
60
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">Line1</span> <span class="ruby-ivar">@sender_address</span>
61
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">Line2</span> <span class="ruby-ivar">@sender_address2</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@sender_address2</span>.<span class="ruby-identifier">nil?</span>
62
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">City</span> <span class="ruby-ivar">@sender_city</span>
63
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">StateOrProvinceCode</span> <span class="ruby-identifier">sender_state</span>
64
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">PostalCode</span> <span class="ruby-ivar">@sender_zip</span>
65
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">CountryCode</span> <span class="ruby-ivar">@sender_country</span> <span class="ruby-operator">||</span> <span class="ruby-value str">'US'</span>
66
+ }
67
+ }
68
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">Destination</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
69
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">Contact</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
70
+ <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">2</span>
71
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">PersonName</span> <span class="ruby-ivar">@name</span>
72
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">CompanyName</span> <span class="ruby-ivar">@company</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@company</span>.<span class="ruby-identifier">nil?</span>
73
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-ivar">@company</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">2</span>
74
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">PersonName</span> <span class="ruby-ivar">@name</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@name</span>.<span class="ruby-identifier">nil?</span>
75
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">CompanyName</span> <span class="ruby-ivar">@company</span>
76
+ <span class="ruby-keyword kw">else</span>
77
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">ShippingError</span>, <span class="ruby-value str">&quot;Either the name or the company value must be bigger than 2 characters.&quot;</span>
78
+ <span class="ruby-keyword kw">end</span>
79
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">Department</span> <span class="ruby-ivar">@department</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@department</span>.<span class="ruby-identifier">nil?</span>
80
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">PhoneNumber</span> <span class="ruby-ivar">@phone</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/[^\d]/</span>,<span class="ruby-value str">&quot;&quot;</span>)
81
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">PagerNumber</span> <span class="ruby-ivar">@pager</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/[^\d]/</span>,<span class="ruby-value str">&quot;&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@pager</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-constant">String</span>
82
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">FaxNumber</span> <span class="ruby-ivar">@fax</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/[^\d]/</span>,<span class="ruby-value str">&quot;&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@fax</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-constant">String</span>
83
+ <span class="ruby-identifier">b</span>.<span class="ruby-identifier">tag!</span> <span class="ruby-value str">&quot;E-MailAddress&quot;</span><span class="ruby-value str">&quot;E-MailAddress&quot;</span>, <span class="ruby-ivar">@email</span>
84
+ }
85
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">Address</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
86
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">Line1</span> <span class="ruby-ivar">@address</span>
87
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">Line2</span> <span class="ruby-ivar">@address2</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@address2</span>.<span class="ruby-identifier">nil?</span>
88
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">City</span> <span class="ruby-ivar">@city</span>
89
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">StateOrProvinceCode</span> <span class="ruby-identifier">state</span>
90
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">PostalCode</span> <span class="ruby-ivar">@zip</span>
91
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">CountryCode</span> <span class="ruby-ivar">@country</span> <span class="ruby-operator">||</span> <span class="ruby-value str">'US'</span>
92
+ }
93
+ }
94
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">Payment</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
95
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">PayorType</span> <span class="ruby-constant">PaymentTypes</span>[<span class="ruby-ivar">@pay_type</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">'SENDER'</span>
96
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">Payor</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
97
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">AccountNumber</span> <span class="ruby-ivar">@payor_account_number</span>
98
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">CountryCode</span> <span class="ruby-ivar">@payor_country_code</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@payor_country_code</span>.<span class="ruby-identifier">nil?</span>
99
+ } <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@payor_account_number</span>.<span class="ruby-identifier">nil?</span>
100
+ }
101
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">RMA</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
102
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">Number</span> <span class="ruby-ivar">@rma_number</span>
103
+ } <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@rma_number</span>.<span class="ruby-identifier">nil?</span>
104
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">Package</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
105
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">Weight</span> <span class="ruby-ivar">@weight</span>
106
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">DeclaredValue</span> <span class="ruby-ivar">@declared_value</span> <span class="ruby-operator">||</span> <span class="ruby-value str">'99.00'</span>
107
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">ReferenceInfo</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
108
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">CustomerReference</span> <span class="ruby-ivar">@customer_reference</span>
109
+ } <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@customer_reference</span>.<span class="ruby-identifier">nil?</span>
110
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">ItemDescription</span> <span class="ruby-ivar">@description</span> <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;Shipment&quot;</span>
111
+ }
112
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">SpecialServices</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
113
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">EMailNotification</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
114
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">ShipAlertOptionalMessage</span> <span class="ruby-ivar">@message</span>
115
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">Shipper</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
116
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">ShipAlert</span> <span class="ruby-ivar">@shipper_ship_alert</span> <span class="ruby-operator">?</span> <span class="ruby-value str">'true'</span> <span class="ruby-operator">:</span> <span class="ruby-value str">'false'</span>
117
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">LanguageCode</span> <span class="ruby-ivar">@shipper_language</span> <span class="ruby-operator">||</span> <span class="ruby-value str">'EN'</span> <span class="ruby-comment cmt"># FR also available</span>
118
+ }
119
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">Recipient</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
120
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">ShipAlert</span> <span class="ruby-ivar">@recipient_ship_alert</span> <span class="ruby-operator">?</span> <span class="ruby-value str">'true'</span> <span class="ruby-operator">:</span> <span class="ruby-value str">'false'</span>
121
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">LanguageCode</span> <span class="ruby-ivar">@recipient_language</span> <span class="ruby-operator">||</span> <span class="ruby-value str">'EN'</span> <span class="ruby-comment cmt"># FR also available</span>
122
+ }
123
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">Other</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
124
+ <span class="ruby-identifier">b</span>.<span class="ruby-identifier">tag!</span> <span class="ruby-value str">&quot;E-MailAddress&quot;</span><span class="ruby-value str">&quot;E-MailAddress&quot;</span>, <span class="ruby-ivar">@other_email</span>
125
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">ShipAlert</span> <span class="ruby-ivar">@other_ship_alert</span> <span class="ruby-operator">?</span> <span class="ruby-value str">'true'</span> <span class="ruby-operator">:</span> <span class="ruby-value str">'false'</span>
126
+ <span class="ruby-identifier">b</span>.<span class="ruby-constant">LanguageCode</span> <span class="ruby-ivar">@other_language</span> <span class="ruby-operator">||</span> <span class="ruby-value str">'EN'</span> <span class="ruby-comment cmt"># FR also available</span>
127
+ } <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@other_email</span>.<span class="ruby-identifier">nil?</span>
128
+ }
129
+ } <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@message</span>.<span class="ruby-identifier">nil?</span>
130
+ }
131
+
132
+ <span class="ruby-identifier">get_response</span> <span class="ruby-ivar">@fedex_url</span>
133
+
134
+ <span class="ruby-keyword kw">begin</span>
135
+ <span class="ruby-identifier">response</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
136
+ <span class="ruby-identifier">response</span>[<span class="ruby-identifier">:url</span>] = <span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">XPath</span>.<span class="ruby-identifier">first</span>(<span class="ruby-ivar">@response</span>, <span class="ruby-value str">&quot;//FDXEmailLabelReply/URL&quot;</span>).<span class="ruby-identifier">text</span>
137
+ <span class="ruby-identifier">response</span>[<span class="ruby-identifier">:userid</span>] = <span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">XPath</span>.<span class="ruby-identifier">first</span>(<span class="ruby-ivar">@response</span>, <span class="ruby-value str">&quot;//FDXEmailLabelReply/UserID&quot;</span>).<span class="ruby-identifier">text</span>
138
+ <span class="ruby-identifier">response</span>[<span class="ruby-identifier">:password</span>] = <span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">XPath</span>.<span class="ruby-identifier">first</span>(<span class="ruby-ivar">@response</span>, <span class="ruby-value str">&quot;//FDXEmailLabelReply/Password&quot;</span>).<span class="ruby-identifier">text</span>
139
+ <span class="ruby-identifier">response</span>[<span class="ruby-identifier">:tracking_number</span>] = <span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">XPath</span>.<span class="ruby-identifier">first</span>(<span class="ruby-ivar">@response</span>, <span class="ruby-value str">&quot;//FDXEmailLabelReply/Package/TrackingNumber&quot;</span>).<span class="ruby-identifier">text</span>
140
+ <span class="ruby-keyword kw">rescue</span>
141
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">ShippingError</span>, <span class="ruby-identifier">get_error</span>
142
+ <span class="ruby-keyword kw">end</span>
143
+
144
+ <span class="ruby-comment cmt"># allows for things like fedex.label.url</span>
145
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
146
+ <span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">name</span>) <span class="ruby-operator">?</span> <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">name</span>] <span class="ruby-operator">:</span> <span class="ruby-keyword kw">super</span>
147
+ <span class="ruby-keyword kw">end</span>
148
+
149
+ ??
150
+
151
+ <span class="ruby-comment cmt"># don't allow people to edit the response</span>
152
+ <span class="ruby-identifier">response</span>.<span class="ruby-identifier">freeze</span>
153
+ <span class="ruby-keyword kw">end</span></pre>
154
+ </body>
155
+ </html>