flinnm Posted July 25, 2003 Posted July 25, 2003 Here is a patch to get Steve Fatula's Fedex Module to work with MS2. Also if you have attempted to use the module with errors, make sure to reset the meter id to NONE after patching. Make sure you set the shipping variables in the script file. Make sure your curl is up to date. Steve is very much on top of all this and is working hard on a better version for MS2 that should be out very soon. --- fedex1.php.orig Fri Jul 25 01:24:08 2003 +++ fedex1.php Fri Jul 25 01:27:52 2003 @@ -163,6 +163,8 @@ define('MODULE_SHIPPING_FEDEX1_FAX', '') function _AccessFedex($data) { $ch = curl_init(); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, 'https://' . MODULE_SHIPPING_FEDEX1_SERVER); @@ -190,8 +192,10 @@ define('MODULE_SHIPPING_FEDEX1_FAX', '') if (MODULE_SHIPPING_FEDEX1_STATE != '') { $data .= '4012,"' . MODULE_SHIPPING_FEDEX1_STATE . '"'; // Subscriber State code } - $data .= '4013,"' . STORE_ORIGIN_ZIP . '"'; // Subscriber Postal Code - $data .= '4014,"' . STORE_ORIGIN_COUNTRY . '"'; // Subscriber Country Code + $data .= '4013,"' . SHIPPING_ORIGIN_ZIP . '"'; // Subscriber Postal Code + $countries_array = tep_get_countries(SHIPPING_ORIGIN_COUNTRY,true); + $countries_code = $countries_array['countries_iso_code_2']; + $data .= '4014,"' . $countries_code . '"'; // Subscriber Country Code $data .= '4015,"' . MODULE_SHIPPING_FEDEX1_PHONE . '"'; // Subscriber phone number if (MODULE_SHIPPING_FEDEX1_PAGER != '') { $data .= '4017,"' . MODULE_SHIPPING_FEDEX1_PAGER . '"'; // Subscriber pager number @@ -244,8 +248,10 @@ define('MODULE_SHIPPING_FEDEX1_FAX', '') $data .= '10,"' . MODULE_SHIPPING_FEDEX1_ACCOUNT . '"'; // Sender fedex account number $data .= '498,"' . $this->meter . '"'; // Meter number $data .= '8,"' . MODULE_SHIPPING_FEDEX1_STATE . '"'; // Sender state code - $data .= '9,"' . STORE_ORIGIN_ZIP . '"'; // Origin postal code - $data .= '117,"' . STORE_ORIGIN_COUNTRY . '"'; // Origin country + $data .= '9,"' . SHIPPING_ORIGIN_ZIP . '"'; // Origin postal code + $countries_array = tep_get_countries(SHIPPING_ORIGIN_COUNTRY, true); + $countries_code = $countries_array['countries_iso_code_2']; + $data .= '117,"' . $countries_code . '"'; // Origin country if ($order->delivery['country']['iso_code_2'] == "US" || $order->delivery['country']['iso_code_2'] == " CA" || $order->delivery['country']['iso_code_2'] == "PR") { $dest_zip = str_replace(' ', '', $order->delivery['postcode']); $data .= '17,"' . $dest_zip . '"'; // Recipient zip code Quote "the link was unnecessary"
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.