Jump to content

greasemonkey

Members
  • Content count

    1,368
  • Joined

  • Last visited

  • Days Won

    25

Everything posted by greasemonkey

  1. greasemonkey

    FedEx - Web Services v9

    You have to create an account (if you haven't already) and then go to "technicall resources" http://www.fedex.com/us/developer/solutions.html I had to call... and get them to walk me through the 15 links it took to find it. 877-339-2774
  2. greasemonkey

    Automated FedEx Labels

    Hi all, after a bunch of trial and error I managed to get this contibution printing labels on the test server. I getting the following errors Warning: fopen(/shop/images/fedex/205262410000114.png) [function.fopen]: failed to open stream: No such file or directory in /home/flournet/public_html/osc_admin/includes/fedexdc.php on line 251 Warning: fwrite(): supplied argument is not a valid stream resource in /home/flournet/public_html/osc_admin/includes/fedexdc.php on line 252 Warning: Cannot modify header information - headers already sent by (output started at /home/flournet/public_html/osc_admin/includes/fedexdc.php:251) in /home/flournet/public_html/osc_admin/includes/functions/general.php on line 22 After going through all 36 pages of the forum 2 twice... and trying to change lines 251 and 252 in admin/includes/fedexdc.php to the absolute path I finally found the problem. What I needed to change to the direct path was admin/includes/configure.php Changed this: define('DIR_WS_FEDEX_LABELS', DIR_WS_IMAGES . 'fedex/'); To This; define('DIR_WS_FEDEX_LABELS', '/home/******/public_html/osc_admin/images/fedex/'); Off to the shop tomorrow to try it on the thermal printer and then see if it works on the product server. After reading through everything I'm still not 100% clear if I need to still call to get approval to use the production server. Thanks everyone who help create this time saving mod! Now, is anyone working on the update to work with Fedex's new Web Services API? I was able to get the Web Services v9 Fedex quotes working... bug there are a bunch of bugs and I lack the (any) skills in figuring out the code. As I understand it... this contribution will go dark on May 2012...
  3. greasemonkey

    Automated FedEx Labels

    Hi all, any one using this mod along side Canada Post Automatic labels? I'm just starting to install and the second edit will take out some of Can Post Labels. In admin/orders.php... it says to: Find this: <td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td> Replace with this: <td colspan="2" align="right"> <?php // begin fedex label mod // determine whether this is on the test or production server $value_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_FEDEX1_SERVER'"); $value = tep_db_fetch_array($value_query); $fedex_gateway = $value['configuration_value']; $orders_query_raw = "select orders_id, fedex_tracking, orders_status from " . TABLE_ORDERS . " where orders_id = '" . (int)$HTTP_GET_VARS['oID'] . "'"; $orders_query = tep_db_query($orders_query_raw); if (tep_db_num_rows($orders_query)) { $fedex_orders = tep_db_fetch_array($orders_query); } // check for a fedex tracking number in the order record // if yes tracking number, show "fedex label," "track" and "cancel" options $fedex_tracking = $fedex_orders['fedex_tracking']; if ($fedex_tracking) { // display the label echo '<a href="fedex_popup.php?num=' . $fedex_tracking . '&oID=' . $HTTP_GET_VARS['oID'] . '">' . tep_image_button('button_fedex_label.gif', IMAGE_ORDERS_FEDEX_LABEL) . '</a>'; // cancel the request echo '<a href="' . tep_href_link(FILENAME_SHIP_FEDEX, 'oID=' . $HTTP_GET_VARS['oID'] . '&num=' . $fedex_tracking . '&action=cancel&fedex_gateway=' . $fedex_gateway) . '" onClick="return(window.confirm(\'Cancel shipment of order number ' . $order->orders_id . '?\'));">' . tep_image_button('button_cancel_shipment.gif', IMAGE_ORDERS_CANCEL_SHIPMENT) . '</a>'; } elseif ($fedex_orders['orders_status'] != 3) { // if the order has not been manually marked "delivered," // display the "ship" button echo '<a href="' . tep_href_link(FILENAME_SHIP_FEDEX, 'oID=' . $HTTP_GET_VARS['oID'] . '&action=new&status=3') . '">' . tep_image_button('button_ship.gif', IMAGE_ORDERS_SHIP) . '</a>'; } // end fedex label mod echo '<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a>' . '<a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a>' . '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td> Problem is mine looks like this (modified for Can Post Automatic Labels): <td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_SHIP_CANADAPOST, 'oID=' .(int)$HTTP_GET_VARS['oID'] . '&action=new&status=3') . '">' . tep_image_button('button_ship_canadapost.gif', IMAGE_ORDERS_SHIP) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td> Any idea's how I can modify this code to work? Thanks in advance...
  4. greasemonkey

    FedEx Direct 2.06 Support thread

    Ya!!! I got it working. I had to dis-able all other shipping mods then re-activate Fedex1.... It looks like flat rate (I use as instore pick up) keep it from installing. It got a meterID and worked. Hope this helps someone else
  5. greasemonkey

    FedEx Direct 2.06 Support thread

    Hi all, i keep bouncing back and forth between Real Time Quotes and Web Services v9... I can get Web Services to work... but there are a bunch of bugs that are beyond me. I haven't been able to get Real Time Quotes to work... In fact I can't even get it to display. Hi All, I'm trying to install this mod with no luck... I can't even get Fedex to display in checkout_shipping? I get no errors, no meter ID and nothing (even though the mod is enabled) shows in checkout shipping. I managed to convince Fedex Tech Support to give me a meter ID manually (I guess they ran the request from there end)... But I still get no joy. Even though the contirbution is installed and enabled it doesn't show... I get no errors... no nothing. Any help would be greatly appreciated...
  6. greasemonkey

    FedEx - Web Services v9

    Testing is still going on with this contribution... I can't believe I seem to be the only one using (or having problems) with this mod. The 2 problems I have so far are: 1) the configure buttons to enable/disable shipping services in admin do not work 2) when checking out a customer can choose any Fedex service (Priority Express for example), however, as they proceed to checkout_payment and get to checkout_confirmation the service changes back to Ground (no matter what service was used in checkout_shipping) Hoping someone out there can help... Below is my code for catalog/includes/modules/shipping/fedexwebservices.php <?php class fedexwebservices { var $code, $title, $description, $icon, $sort_order, $enabled, $tax_class, $fedex_key, $fedex_pwd, $fedex_act_num, $fedex_meter_num, $country; //Class Constructor function fedexwebservices() { global $order, $customer_id; @define('MODULE_SHIPPING_FEDEX_WEB_SERVICES_INSURE', 0); $this->code = "fedexwebservices"; $this->title = MODULE_SHIPPING_FEDEX_WEB_SERVICES_TEXT_TITLE; $this->description = MODULE_SHIPPING_FEDEX_WEB_SERVICES_TEXT_DESCRIPTION; $this->sort_order = MODULE_SHIPPING_FEDEX_WEB_SERVICES_SORT_ORDER; $this->handling_fee = (float)MODULE_SHIPPING_FEDEX_WEB_SERVICES_HANDLING_FEE; $this->icon = DIR_WS_ICONS . 'shipping_fedex.gif'; $this->enabled = ((MODULE_SHIPPING_FEDEX_WEB_SERVICES_STATUS == 'true') ? true : false); $this->tax_class = MODULE_SHIPPING_FEDEX_WEB_SERVICES_TAX_CLASS; $this->fedex_key = MODULE_SHIPPING_FEDEX_WEB_SERVICES_KEY; $this->fedex_pwd = MODULE_SHIPPING_FEDEX_WEB_SERVICES_PWD; $this->fedex_act_num = MODULE_SHIPPING_FEDEX_WEB_SERVICES_ACT_NUM; $this->fedex_meter_num = MODULE_SHIPPING_FEDEX_WEB_SERVICES_METER_NUM; if (defined("SHIPPING_ORIGIN_COUNTRY")) { if ((int)SHIPPING_ORIGIN_COUNTRY > 0) { $countries_array = $this->get_countries(SHIPPING_ORIGIN_COUNTRY, true); $this->country = $countries_array['countries_iso_code_2']; } else { $this->country = SHIPPING_ORIGIN_COUNTRY; } } else { $this->country = STORE_ORIGIN_COUNTRY; } if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FEDEX_WEB_SERVICES_ZONE > 0) ) { $check_flag = false; $check_query = tep_db_query ("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_FEDEX_WEB_SERVICES_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id"); while( $check = tep_db_fetch_array($check_query)) { if ($check ['zone_id'] < 1) { $check_flag = true; break; } elseif ($check ['zone_id'] == $order->delivery['zone_id']) { $check_flag = true; break; } $check->MoveNext(); } if ($check_flag == false) { $this->enabled = false; } } } //Class Methods function quote($method = '') { /* FedEx integration starts */ global $shipping_weight, $shipping_num_boxes, $order; require_once('/home/flournet/public_html/shop/includes/library/fedex-common.php5'); //if (MODULE_SHIPPING_FEDEX_WEB_SERVICES_SERVER == 'test') { //$request['Version'] = array('ServiceId' => 'crs', 'Major' => '7', 'Intermediate' => '0', 'Minor' => '0'); //$path_to_wsdl = DIR_WS_INCLUDES . "wsdl/RateService_v7_test.wsdl"; //} else { $path_to_wsdl = "/home/flournet/public_html/shop/includes/wsdl/RateService_v9.wsdl"; //} ini_set("soap.wsdl_cache_enabled", "0"); $client = new SoapClient($path_to_wsdl, array('trace' => 1)); $this->types = array(); if (MODULE_SHIPPING_FEDEX_WEB_SERVICES_INTERNATIONAL_PRIORITY == 'true') { $this->types[] = 'INTERNATIONAL_PRIORITY'; $this->types[] = 'EUROPE_FIRST_INTERNATIONAL_PRIORITY'; } if (MODULE_SHIPPING_FEDEX_WEB_SERVICES_INTERNATIONAL_ECONOMY == 'true') { $this->types[] = 'INTERNATIONAL_ECONOMY'; } if (MODULE_SHIPPING_FEDEX_WEB_SERVICES_STANDARD_OVERNIGHT == 'true') { $this->types[] = 'STANDARD_OVERNIGHT'; } if (MODULE_SHIPPING_FEDEX_WEB_SERVICES_FIRST_OVERNIGHT == 'true') { $this->types[] = 'FIRST_OVERNIGHT'; } if (MODULE_SHIPPING_FEDEX_WEB_SERVICES_PRIORITY_OVERNIGHT == 'true') { $this->types[] = 'PRIORITY_OVERNIGHT'; } if (MODULE_SHIPPING_FEDEX_WEB_SERVICES_2DAY == 'true') { $this->types[] = 'FEDEX_2_DAY'; } if (MODULE_SHIPPING_FEDEX_WEB_SERVICES_GROUND == 'true') { $this->types[] = 'FEDEX_GROUND'; $this->types[] = 'GROUND_HOME_DELIVERY'; } if (MODULE_SHIPPING_FEDEX_WEB_SERVICES_INTERNATIONAL_GROUND == 'true') { $this->types[] = 'INTERNATIONAL_GROUND'; } if (MODULE_SHIPPING_FEDEX_WEB_SERVICES_EXPRESS_SAVER == 'true') { $this->types[] = 'FEDEX_EXPRESS_SAVER'; } if (MODULE_SHIPPING_FEDEX_WEB_SERVICES_FREIGHT == 'true') { $this->types[] = 'FEDEX_FREIGHT'; $this->types[] = 'FEDEX_NATIONAL_FREIGHT'; $this->types[] = 'FEDEX_1_DAY_FREIGHT'; $this->types[] = 'FEDEX_2_DAY_FREIGHT'; $this->types[] = 'FEDEX_3_DAY_FREIGHT'; $this->types[] = 'INTERNATIONAL_ECONOMY_FREIGHT'; $this->types[] = 'INTERNATIONAL_PRIORITY_FREIGHT'; } $this->types[] = 'SMART_POST'; // customer details $street_address = $order->delivery['street_address']; $street_address2 = $order->delivery['suburb']; $city = $order->delivery['city']; $state = tep_get_zone_code($order->delivery['country']['id'], $order->delivery['zone_id'], ''); if ($state == "QC") $state = "PQ"; $postcode = str_replace(array(' ', '-'), '', $order->delivery['postcode']); $country_id = $order->delivery['country']['iso_code_2']; // $totals = $order->info['subtotal'] = $_SESSION['cart']->show_total(); $this->_setInsuranceValue($totals); $request['WebAuthenticationDetail'] = array('UserCredential' => array('Key' => $this->fedex_key, 'Password' => $this->fedex_pwd)); $request['ClientDetail'] = array('AccountNumber' => $this->fedex_act_num, 'MeterNumber' => $this->fedex_meter_num); $request['TransactionDetail'] = array('CustomerTransactionId' => ' *** Rate Request v9 using PHP ***'); // $request['RequestedShipment']['SmartPostDetail'] = array( // 'Indicia' => 'MEDIA_MAIL', // 'AncillaryEndorsement' => 'CARRIER_LEAVE_IF_NO_RESPONSE', // 'SpecialServices' => 'USPS_DELIVERY_CONFIRMATION', // 'HubId' => '5254', // 'CustomerManifestId' => 1101); // $request['RequestedShipment']['ServiceType'] = 'SMART_POST'; $request['Version'] = array('ServiceId' => 'crs', 'Major' => '9', 'Intermediate' => '0', 'Minor' => '0'); $request['ReturnTransitAndCommit'] = true; $request['RequestedShipment']['DropoffType'] = $this->_setDropOff(); // valid values REGULAR_PICKUP, REQUEST_COURIER, ... $request['RequestedShipment']['ShipTimestamp'] = date('c'); //if (tep_not_null($method) && in_array($method, $this->types)) { //$request['RequestedShipment']['ServiceType'] = $method; // valid values STANDARD_OVERNIGHT, PRIORITY_OVERNIGHT, FEDEX_GROUND, ... //} $request['RequestedShipment']['PackagingType'] = 'YOUR_PACKAGING'; // valid values FEDEX_BOX, FEDEX_PAK, FEDEX_TUBE, YOUR_PACKAGING, ... $request['RequestedShipment']['TotalInsuredValue']=array('Ammount'=> $this->insurance, 'Currency' => $_SESSION['currency']); $request['WebAuthenticationDetail'] = array('UserCredential' => array('Key' => $this->fedex_key, 'Password' => $this->fedex_pwd)); $request['ClientDetail'] = array('AccountNumber' => $this->fedex_act_num, 'MeterNumber' => $this->fedex_meter_num); //print_r($request['WebAuthenticationDetail']); //print_r($request['ClientDetail']); //exit; $request['RequestedShipment']['Shipper'] = array('Address' => array( 'StreetLines' => array(MODULE_SHIPPING_FEDEX_WEB_SERVICES_ADDRESS_1, MODULE_SHIPPING_FEDEX_WEB_SERVICES_ADDRESS_2), // Origin details 'City' => MODULE_SHIPPING_FEDEX_WEB_SERVICES_CITY, 'StateOrProvinceCode' => MODULE_SHIPPING_FEDEX_WEB_SERVICES_STATE, 'PostalCode' => MODULE_SHIPPING_FEDEX_WEB_SERVICES_POSTAL, 'CountryCode' => $this->country)); $request['RequestedShipment']['Recipient'] = array('Address' => array ( // customer info 'StreetLines' => array($street_address, $street_address2), 'City' => $city, 'StateOrProvinceCode' => $state, 'PostalCode' => $postcode, 'CountryCode' => $country_id, 'Residential' => ($order->delivery['company'] != '' ? false : true))); //print_r($request['RequestedShipment']['Recipient']) ; //exit; $request['RequestedShipment']['ShippingChargesPayment'] = array('PaymentType' => 'SENDER', 'Payor' => array('AccountNumber' => $this->fedex_act_num, // Replace 'XXX' with payor's account number 'CountryCode' => $this->country)); $request['RequestedShipment']['RateRequestTypes'] = 'LIST'; $request['RequestedShipment']['PackageCount'] = $shipping_num_boxes; $request['RequestedShipment']['PackageDetail'] = 'INDIVIDUAL_PACKAGES'; $request['RequestedShipment']['RequestedPackageLineItems'] = array(); if ($shipping_weight == 0) $shipping_weight = 0.1; for ($i=0; $i<$shipping_num_boxes; $i++) { $request['RequestedShipment']['RequestedPackageLineItems'][] = array('Weight' => array('Value' => $shipping_weight, 'Units' => MODULE_SHIPPING_FEDEX_WEB_SERVICES_WEIGHT)); } //echo '<!-- shippingWeight: ' . $shipping_weight . ' ' . $shipping_num_boxes . ' -->'; //echo '<!-- '; //echo '<pre>'; //print_r($request); //echo '</pre>'; //echo ' -->'; $response = $client->getRates($request); //echo '<!-- '; //echo '<pre>'; //print_r($response); //echo '</pre>'; //echo ' -->'; if ($response->HighestSeverity != 'FAILURE' && $response->HighestSeverity != 'ERROR' && is_array($response->RateReplyDetails) || is_object($response->RateReplyDetails)) { if (is_object($response->RateReplyDetails)) { $response->RateReplyDetails = get_object_vars($response->RateReplyDetails); } //echo '<pre>'; //print_r($response->RateReplyDetails); //echo '</pre>'; switch (SHIPPING_BOX_WEIGHT_DISPLAY) { case (0): $show_box_weight = ''; break; case (1): $show_box_weight = ' (' . $shipping_num_boxes . ' ' . TEXT_SHIPPING_BOXES . ')'; break; case (2): $show_box_weight = ' (' . number_format($shipping_weight * $shipping_num_boxes,2) . TEXT_SHIPPING_WEIGHT . ')'; break; default: $show_box_weight = ' (' . $shipping_num_boxes . ' x ' . number_format($shipping_weight,2) . TEXT_SHIPPING_WEIGHT . ')'; break; } $this->quotes = array('id' => $this->code, 'module' => $this->title . $show_box_weight); $methods = array(); foreach ($response->RateReplyDetails as $rateReply) { if (true || in_array($rateReply->ServiceType, $this->types) && ($method == '' || str_replace('_', '', $rateReply->ServiceType) == $method)) { $cost = $rateReply->RatedShipmentDetails[0]->ShipmentRateDetail->TotalNetCharge->Amount; $cost = (float)round(preg_replace('/[^0-9.]/', '', $cost), 2); $methods[] = array('id' => str_replace('_', '', $rateReply->ServiceType), 'title' => ucwords(strtolower(str_replace('_', ' ', $rateReply->ServiceType))), 'cost' => $cost + $this->handling_fee); } } function cmp($a, $B) { if ($a['cost'] == $b['cost']) { return 0; } return ($a['cost'] < $b['cost']) ? -1 : 1; } usort($methods, 'cmp'); $this->quotes['methods'] = $methods; if ($this->tax_class > 0) { $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); } } else { $message = 'Error in processing transaction.<br /><br />'; foreach ($response -> Notifications as $notification) { if(is_array($response -> Notifications)) { $message .= $notification->Severity; $message .= ': '; $message .= $notification->Message . '<br />'; } else { $message .= $notification . '<br />'; } } $this->quotes = array('module' => $this->title, 'error' => $message); } if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title); //echo '<!-- Quotes: '; //print_r($this->quotes); //print_r($_SESSION['shipping']); //echo ' -->'; return $this->quotes; } function _setInsuranceValue($order_amount){ if ($order_amount > (float)MODULE_SHIPPING_FEDEX_WEB_SERVICES_INSURE) { $this->insurance = sprintf("%01.2f", $order_amount); } else { $this->insurance = 0; } } function objectToArray($object) { if( !is_object( $object ) && !is_array( $object ) ) { return $object; } if( is_object( $object ) ) { $object = get_object_vars( $object ); } return array_map( 'objectToArray', $object ); } function _setDropOff() { switch(MODULE_SHIPPING_FEDEX_WEB_SERVICES_DROPOFF) { case '1': return 'REGULAR_PICKUP'; break; case '2': return 'REQUEST_COURIER'; break; case '3': return 'DROP_BOX'; break; case '4': return 'BUSINESS_SERVICE_CENTER'; break; case '5': return 'STATION'; break; } } function check(){ if(!isset($this->_check)){ $check_query = tep_db_query("SELECT configuration_value FROM ". TABLE_CONFIGURATION ." WHERE configuration_key = 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_STATUS'"); $this->_check = tep_db_num_rows ($check_query); } return $this->_check; } function install() { tep_db_query ("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Enable FedEx Web Services','MODULE_SHIPPING_FEDEX_WEB_SERVICES_STATUS','true','Do you want to offer FedEx shipping?','6','0','tep_cfg_select_option(array(\'true\',\'false\'),',now())"); tep_db_query ("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('FedEx Web Services Key', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_KEY', '', 'Enter FedEx Web Services Key', '6', '3', now())"); tep_db_query ("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('FedEx Web Services Password', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_PWD', '', 'Enter FedEx Web Services Password', '6', '3', now())"); tep_db_query ("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('FedEx Account Number', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_ACT_NUM', '', 'Enter FedEx Account Number', '6', '3', now())"); tep_db_query ("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('FedEx Meter Number', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_METER_NUM', '', 'Enter FedEx Meter Number', '6', '4', now())"); tep_db_query ("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Weight Units', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_WEIGHT', 'LB', 'Weight Units:', '6', '10', 'tep_cfg_select_option(array(\'LB\', \'KG\'), ', now())"); tep_db_query ("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('First line of street address', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_ADDRESS_1', '', 'Enter the first line of your ship-from street address, required', '6', '20', now())"); tep_db_query ("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Second line of street address', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_ADDRESS_2', '', 'Enter the second line of your ship-from street address, leave blank if you do not need to specify a second line', '6', '21', now())"); tep_db_query ("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('City name', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_CITY', '', 'Enter the city name for the ship-from street address, required', '6', '22', now())"); tep_db_query ("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('State or Province name', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_STATE', '', 'Enter the 2 letter state or province name for the ship-from street address, required for Canada and US', '6', '23', now())"); tep_db_query ("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Postal code', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_POSTAL', '', 'Enter the postal code for the ship-from street address, required', '6', '24', now())"); tep_db_query ("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Phone number', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_PHONE', '', 'Enter a contact phone number for your company, required', '6', '25', now())"); tep_db_query ("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Drop off type', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_DROPOFF', '1', 'Dropoff type (1 = Regular pickup, 2 = request courier, 3 = drop box, 4 = drop at BSC, 5 = drop at station)?', '6', '30', 'tep_cfg_select_option(array(\'1\',\'2\',\'3\',\'4\',\'5\'),', now())"); tep_db_query ("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Express Saver', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_EXPRESS_SAVER', 'true', 'Enable FedEx Express Saver', '6', '10', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now())"); tep_db_query ("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Standard Overnight', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_STANDARD_OVERNIGHT', 'true', 'Enable FedEx Express Standard Overnight', '6', '10', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now())"); tep_db_query ("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable First Overnight', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_FIRST_OVERNIGHT', 'true', 'Enable FedEx Express First Overnight', '6', '10', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now())"); tep_db_query ("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Priority Overnight', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_PRIORITY_OVERNIGHT', 'true', 'Enable FedEx Express Priority Overnight', '6', '10', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now())"); tep_db_query ("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable 2 Day', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_2DAY', 'true', 'Enable FedEx Express 2 Day', '6', '10', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now())"); tep_db_query ("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable International Priority', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_INTERNATIONAL_PRIORITY', 'true', 'Enable FedEx Express International Priority', '6', '10', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now())"); tep_db_query ("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable International Economy', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_INTERNATIONAL_ECONOMY', 'true', 'Enable FedEx Express International Economy', '6', '10', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now())"); tep_db_query ("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Ground', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_GROUND', 'true', 'Enable FedEx Ground', '6', '10', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now())"); tep_db_query ("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable International Ground', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_INTERNATIONAL_GROUND', 'true', 'Enable FedEx International Ground', '6', '10', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now())"); tep_db_query ("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Freight', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_FREIGHT', 'true', 'Enable FedEx Freight', '6', '10', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now())"); tep_db_query ("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_HANDLING_FEE', '', 'Add a handling fee or leave blank', '6', '25', now())"); tep_db_query ("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '98', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())"); tep_db_query ("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '25', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())"); tep_db_query ("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_SORT_ORDER', '0', 'Sort order of display.', '6', '99', now())"); } function remove() { tep_db_query ("DELETE FROM ". TABLE_CONFIGURATION ." WHERE configuration_key in ('". implode("','",$this->keys()). "')"); } function keys() { return array('MODULE_SHIPPING_FEDEX_WEB_SERVICES_STATUS', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_KEY', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_PWD', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_ACT_NUM', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_METER_NUM', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_WEIGHT', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_ADDRESS_1', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_ADDRESS_2', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_CITY', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_STATE', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_POSTAL', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_PHONE', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_DROPOFF', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_EXPRESS_SAVER', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_STANDARD_OVERNIGHT', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_FIRST_OVERNIGHT', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_PRIORITY_OVERNIGHT', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_2DAY', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_INTERNATIONAL_PRIORITY', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_INTERNATIONAL_ECONOMY', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_GROUND', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_INTERNATIONAL_GROUND', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_FREIGHT', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_TAX_CLASS', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_HANDLING_FEE', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_ZONE', 'MODULE_SHIPPING_FEDEX_WEB_SERVICES_SORT_ORDER' ); } function get_countries($countries_id = '', $with_iso_codes = false) { $countries_array = array(); if (tep_not_null($countries_id)) { if ($with_iso_codes == true) { $countries = tep_db_query("select countries_name, countries_iso_code_2, countries_iso_code_3 from " . TABLE_COUNTRIES . " where countries_id = '" . (int)$countries_id . "' order by countries_name"); $countries_values = tep_db_fetch_array($countries); $countries_array = array('countries_name' => $countries_values['countries_name'], 'countries_iso_code_2' => $countries_values['countries_iso_code_2'], 'countries_iso_code_3' => $countries_values['countries_iso_code_3']); } else { $countries = tep_db_query("select countries_name from " . TABLE_COUNTRIES . " where countries_id = '" . (int)$countries_id . "'"); $countries_values = tep_db_fetch_array($countries); $countries_array = array('countries_name' => $countries_values['countries_name']); } } else { $countries = tep_db_query("select countries_id, countries_name from " . TABLE_COUNTRIES . " order by countries_name"); while ($countries_values = tep_db_fetch_array($countries)) { $countries_array[] = array('countries_id' => $countries_values['countries_id'], 'countries_name' => $countries_values['countries_name']); } } return $countries_array; } }
  7. greasemonkey

    FedEx - Web Services v9

    Ok, I got it working by change lines 59 & 64 to the absolute path... I presume this is something to do with my config files? So, the only problem I'm having now is fuctional... The buttons to enable/disable shipping services do not seem to work. Anyone out there working with this mod?
  8. greasemonkey

    FedEx Direct 2.06 Support thread

    I used 2.07 and then added 2.07.1 and 2.07.2 patches from the same link you provided.
  9. greasemonkey

    FedEx Direct 2.06 Support thread

    Hi Mossman, thank you for your quick reply... Yes the database us updated successfully. You may have missed step one in the readme?
  10. greasemonkey

    FedEx Direct 2.06 Support thread

    Hi All, I'm trying to install this mod with no luck... I can't even get Fedex to display in checkout_shipping? I get no errors, no meter ID and nothing (even though the mod is enabled) shows in checkout shipping. I know this is mod is near the end of life, however, I was hoping the community comes up with something that works with Fedex Automatic Labels (ultimately where I'm hoping to go with this) before spring 2012. I have called fedex tech support, and confirmed my account number is good, but... They can't tell me if my site has made a request for a meter ID, only that one has not been issued. I have tried every combination of setting I found in the forum with no luck. It's running on my VPS with openSSL, I get nothing from the "debug mode" (prob cause its not talking with Fedex?), I tried 2.07.1 and .2 patches, I tried disabling my UPS and Can Post Mods to see if it would make any diference and still nothing. I have copied by settings below... Hope someone can help! Enable Fedex Shipping True Your Fedex Account Number ********* Your Fedex Meter ID NONE cURL Path NONE Debug Mode False Weight Units KGS Which server to use production First line of street address *** ******** Rd. Second line of street address Unit 5 City name Pickering State or Province name ON Postal code ****** Phone number 905-***-**** Drop off type 1 Display Transit Times True Fedex surcharge? 1.00 Show List Rates? True Insurance? NONE Residential surcharge? 2.5 Enable Envelope Rates? True Sort rates: High to Low Timeout in Seconds NONE Max. weight NONE Max. quantity of ship boxes NONE Tax Class GST/HST Shipping Tier 1 Discount Weight NONE Tier 1 Discount Percent NONE Tier 2 Discount Weight NONE Tier 2 Discount Percent NONE Sort Order 1 Shipping Zone --none--
  11. greasemonkey

    Batch Print Center (support thread)

    Hi guys, I'm trying to add the credit card type (visa, m/c etc) to my invoice template but get no joy so far... I'm very new... if anyone can help? I'm using the Moneris Payment API. I have change this code // payment method if ($HTTP_POST_VARS['show_pay_method']) { $pos = $pdf->ezText("<b>" . ENTRY_PAYMENT_METHOD . "</b> " . str_replace($vilains , $cools, $order->info['payment_method']),GENERAL_FONT_SIZE); if ($order->info['payment_method'] == PAYMENT_TYPE) { $pos = $pdf->ezText("<b>" . ENTRY_PAYMENT_TYPE . "</b> " . $order->info['cc_type'],GENERAL_FONT_SIZE); $pos = $pdf->ezText("<b>" . ENTRY_CC_OWNER . "</b> " . $order->info['cc_owner'],GENERAL_FONT_SIZE); if ($HTTP_POST_VARS['show_cc']) { $pos = $pdf->ezText("<b>" . ENTRY_CC_NUMBER . "</b> " . $order->info['cc_number'],GENERAL_FONT_SIZE); } $pos = $pdf->ezText("<b>" . ENTRY_CC_EXP . "</b> " . $order->info['cc_expires'],GENERAL_FONT_SIZE); } } $pos -= SECTION_DIVIDER; To this: // payment method if ($HTTP_POST_VARS['show_pay_method']) { $pos = $pdf->ezText("<b>" . ENTRY_PAYMENT_METHOD . "</b> " . str_replace($vilains , $cools, $order->info['payment_method']),GENERAL_FONT_SIZE); if (is_array($payment_modules->modules)) { if ($confirmation = $payment_modules->confirmation()) { $pos = $pdf->ezText("<b>" . ENTRY_PAYMENT_METHOD . "</b> " . $confirmation['title'],GENERAL_FONT_SIZE); } } $pos -= SECTION_DIVIDER; I also had to add an extra "}" at the end of the file (I must have missed it somewhere...but don't konw where)? Anyway... I get nothing from my VERY "newbe" code hack. Thank you in advance.
  12. greasemonkey

    Display credit card type in Payment Method

    Maybe I'm going about this the wrong way. At present I'm not sure which file is writing to payment_method in the orders table. Maybe I could have the Moneris module write the credit card type to this table? Any ideas? Sorry... I konw my questions are coming from someone who (me) obviously lacks the php skills required. Any help would be appreciated.
  13. greasemonkey

    Display credit card type in Payment Method

    Sorry for the noob question; I'm using the moneris payment module and I'm having trouble displaying the credit card type (visa, M/C, AMEX etc) in orders.php. Anybody else out there having a similar issue? Currently, I get "Credit Card Payments"... But I would like to display' V, M or AX as written to the database in moneris_can_orders in card_type.
  14. greasemonkey

    Display credit card type in Payment Method

    I guess I probably need to do something in admin/includes/classes/orders.php too... Just not sure which or where... Maybe here? function query($order_id) { $order_query = tep_db_query("select customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified, cp_tracking from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'"); $order = tep_db_fetch_array($order_query); And here? $this->info = array('currency' => $order['currency'], 'currency_value' => $order['currency_value'], 'payment_method' => $order['payment_method'], 'cc_type' => $order['cc_type'], 'cc_owner' => $order['cc_owner'], 'cc_number' => $order['cc_number'], 'cc_expires' => $order['cc_expires'], 'date_purchased' => $order['date_purchased'], 'orders_status' => $order['orders_status'], 'cp_tracking' => $order['cp_tracking'], 'last_modified' => $order['last_modified']);
  15. greasemonkey

    Display credit card type in Payment Method

    Hi Chris,thank you once again. Yes the CC card type is card_type in the DB. Its written to the DB in catalog/includes/moneris/orders_addon_campg.php. while ($moneris_order_detail = tep_db_fetch_array($moneris_order_query)) { switch (strtoupper($moneris_order_detail['card_type'])) { case 'V': $card_type = 'Visa'; break; case 'M': $card_type = 'MasterCard'; break; case 'AX': $card_type = 'American Express'; break; case 'SE': $card_type = 'Sears Card'; break; case 'C': $card_type = 'JCB'; break; case 'DC': $card_type = 'Diners Card'; break; case 'NO': $card_type = 'Novus/Discover'; break; default: $card_type = 'UNKNOWN'; break; } $order_link = "<a href='https://" . $moneris_order_detail['gateway_url'] . "/mpg/reports/order_history/index.php" . "?order_no=" . $moneris_order_detail['moneris_order_id'] . "&orig_txn_no=" . $moneris_order_detail['orig_txn_num'] . "' target='_mpg'>" . $moneris_order_detail['moneris_order_id'] . "</a>"; $message = $moneris_order_detail['message']; $message = str_replace("''", "'", $message); ?> And here; <td class="smalltext" valign="top"><b>Card Type:</b></td> <td class="smalltext"><?php echo $card_type; ?></td> I would presume this needs to be echo'ed in admin/orders.php here; <td class="main"><b><?php echo ENTRY_PAYMENT_METHOD; ?></b></td> <td class="main"><?php echo $order->info['payment_method']; ?></td> I tried replacing this with; <td class="main"><b><?php echo ENTRY_PAYMENT_METHOD; ?></b></td> <td class="main"><?php echo $card_type; ?></td> But got nothing... Scott
  16. greasemonkey

    Display credit card type in Payment Method

    Hi Chris, thank you for your reply... you are correct, of course. However, it does write the credit card type to the database. The problem I have is... this way below my skill level. I was hoping someone else had already completed this type of mod and would share, or help with code.
  17. Hi All, sorry if this question is not in the correct area... or is "too" n00b... I'm trying to exclude / remove small packet service quotes (infact all service but Xpresspost and Priority) for international customers (anyone not located in Canada or USA). I had some help long ago... a programer helped to remove the small packet surface option for US... But I have not been able to figure out how to carry this forward to International Customers. Org Code; $aryProducts[$index] = array( $name . ', ' . $deliveryDate => $rate); Code Excluding Small Packet Surface; if($this->dest_country == "US" && $name != "Small Packets Surface") { $aryProducts[$index] = array( $name . ', ' . $deliveryDate => $rate); } elseif($this->dest_country != "US") { $aryProducts[$index] = array( $name . ', ' . $deliveryDate => $rate); } Any help would be greatly appreciated.
  18. greasemonkey

    Canada Post Automatic Labels

    Ok, I'm new here and very new to php. BUT I managed to figure it out (although I'm certain this is the long way... after hours of trial and error). Below are my edits... just in case it helps someone else (I take no responsibily for these edits... all I can say is they worked for me). In admin/ship_canadapost.php change (on or about line 72); $label_file = DIR_WS_IMAGES . 'canadapost/' . $order_id . '.pdf'; to; $label_file = '/home/******/public_html/admin/images/canadapost/' . $order_id . '.pdf'; Change (on or about line 755-757); $fh = fopen($label_file, 'wb'); fwrite($fh, $response); fclose($fh); to; $fh = fopen('/home/*****/public_html/admin/images/canadapost/' . $order_id . '.pdf', 'wb'); fwrite($fh, $response); fclose($fh); Change (on or about 795); echo '<a href="' . $label_file . '">Open PDF</a></b><br><br>'; to; echo '<b>PDF Label: <a href="' . sprintf(LABEL_FILE,$order_id) . '" target="_blank">Open</a></b><br><br>'; This also opens the label in a new window. In admin/includes/languages/english/ship_canadapost.php add (just below <?php); define('LABEL_FILE', 'http://www.mysite.com/admin/images/canadapost/%s.pdf');
  19. greasemonkey

    Canada Post Automatic Labels

    Ok, I've got this working... Kinda... It seems I forgot to remove the "<" ">" from the login info. It is creating the lable on the Can Post site... However NOT able to open it. Warning: fopen(http://www.mysite.ca/shop/images/canadapost/611.pdf) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/*******/public_html/osc_admin/ship_canadapost.php on line 755 Warning: fwrite(): supplied argument is not a valid stream resource in /home/*******/public_html/osc_admin/ship_canadapost.php on line 756 Warning: fclose(): supplied argument is not a valid stream resource in /home/*******/public_html/osc_admin/ship_canadapost.php on line 757 I have double checked... and I have uploaded and changed the file permission to 777 here; /public_html/osc_admin/images/canadapost/ What is funny is the above error is pointing to my "catalog"; fopen(http://www.mysite.ca/shop/images/canadapost/611.pdf) Shouldn't it be pointing to; osc_admin/images/canadapost/ ????????
  20. greasemonkey

    Canada Post Automatic Labels

    Hi All, I haven't worked on this in a while... but I'm now back working at it again... I have changed hosts and they have compile cURL with libssh2 However, I still cannot pass step 2. I sure port 30000 is open... as Canada Post Quotes (I belive) come through port 30000. So... I'm not sure what this issue is... The only thing I'm not 100% clear on is; what login info do I use? Or the login to EST I presume??? Or the login to sellonline? Right now I'm testing with the EST login info; $cp_user = '<********>'; $cp_password = '<******>'; $cp_contract = '<00********>'; // if you have a CP contract, put it here to pay via // account instead of credit card $cp_use_account = 1; // set to 1 to pay via account instead of credit card Any suggestions would be a great help... Currently the the code at step 2 looks like; // 2. LOG IN $response = cp_get_page($ch, 'https://www.canadapost.ca/cpid/login.jsp?SSO_REFERRER_URL=https://www.canadapost.ca'); $response = cp_get_page($ch, 'https://www.canadapost.ca/cpid/apps/signIn?LOCALE=en'); $query_string = 'cpidSignIn:signIn.x=46&cpidSignIn:signIn.y=11&cpidSignIn_SUBMIT=1'
  21. greasemonkey

    [contribution] Package Tracking for Canada Post

    I'm having the same problem... Was there a resolution? Thank you in advance.
  22. greasemonkey

    Canada Post Automatic Labels

    So I think I've found the answer in another post... Apparently not passing Step 2 is almost always to do with the cURL missing OpenSSL AND! libssh2... Right now my cURL is cURL support enabled cURL Information libcurl/7.19.0 OpenSSL/0.9.8k zlib/1.1.3 Just waiting for my host to reconfigure the cURL (it didn't seem like it would be an issue... other than the system admin has to do it and they don't work on the weekend).
  23. greasemonkey

    Canada Post Automatic Labels

    I've tried the original code from the install... still the same problem... I now have the below installed... //// // 2. LOG IN $response = cp_get_page($ch, 'https://www.canadapost.ca/cpid/login.jsp?SSO_REFERRER_URL=https://www.canadapost.ca'); $response = cp_get_page($ch, 'https://www.canadapost.ca/cpid/apps/signIn?LOCALE=en'); $query_string = 'cpidSignIn:signIn.x=46&cpidSignIn:signIn.y=11&cpidSignIn_SUBMIT=1' . '&cpidSignIn:j_username=' . urlencode($cp_user) . '&cpidSignIn:j_password=' . urlencode($cp_password) . '&cpidSignIn:rememberUserName=true' . '&destination=https://obc.canadapost.ca/zcpb2b/b2b/init.do'; $response = cp_post_page($ch, 'https://www.canadapost.ca/cpid/apps/signIn?execution=e1s1', $query_string); $query_string = 'SHOP=CPFRCOMM&SSO_ITS_URL=%2Fcpid%2Flogin.jsp&SSO_ACTION=0&P_SHOP=CPFRCOMM' . '&login_type=2&password_length=0&%7Elanguage=EN&APP_ID=B2B' . '&SSO_USERID=' . urlencode($cp_user) . '&SSO_PASSWORD=' . urlencode($cp_password); $response = cp_post_page($ch, 'https://www.canadapost.ca/cpid/login/redirect', $query_string); // get Canada Post customer number $regexp = "SSO_CUSTOMER_NUMBER\" value=\"([0123456789]*)(,|\")"; $matches = ''; preg_match("/$regexp/siU", $response, $matches); $cp_customer = $matches[1]; $response = cp_submit_page($ch, $response, 'https://www.canadapost.ca'); // Sanity Check and Progress Report if (strstr($response, '<input type=hidden name="SSO_VERSION_MAJOR" value="3">') === FALSE) { cp_error(2, 'Failed check in ' . __FILE__ . ' at line ' . __LINE__ . '. This most likely means that Canada Post has changed their user interface. You need to update your Canada Post Automatic Shipping Labels module.'); curl_close($ch); die(); ///////////////////// } else { cp_progress(2, 'Logged in.'); }
  24. greasemonkey

    Canada Post Automatic Labels

    Hi All, I'm really new... so please excuse my newbe questions (I've been lurking here for months... and been able to answer all my question with the search funtion up until now). I've installed this mod on my test site and cannot get past Step 2. Step 1. Initialized. Step 2. Error: Failed check in /mnt/w0113/d12/s07/b02a2859/www/osc_admin_dev/ship_canadapost.php at line 346. This most likely means that Canada Post has changed their user interface. You need to update your Canada Post Automatic Shipping Labels module. I've tried multiple versions of admin/ship_canadapost.php // 2. LOG IN code... below is what I currently have //// // 2. LOG IN $response = cp_get_page($ch, 'https://sso-cal.canadapost-postescanada.ca/cpid/apps/signIn?LOCALE=en&~language=EN&APP_ID=B2B&SSO_REFERRER_URL=https://obc.canadapost.ca/zcpb2b/b2b/init.do?language=EN&shop=CPENCOMM'); $query_string = 'cpidSignIn:signIn.x=46&cpidSignIn:signIn.y=11&cpidSignIn_SUBMIT=1' . '&cpidSignIn:j_username=' . urlencode($cp_user) . '&cpidSignIn:j_password=' . urlencode($cp_password); $response = cp_post_page($ch, 'https://sso-cal.canadapost-postescanada.ca/cpid/apps/signIn?execution=e1s1', $query_string); $query_string = 'SHOP=CPFRCOMM&SSO_ITS_URL=%2Fcpid%2Flogin.jsp&SSO_ACTION=0&P_SHOP=CPFRCOMM' . '&login_type=2&password_length=0&%7Elanguage=EN&APP_ID=B2B' . '&SSO_USERID=' . urlencode($cp_user) . '&SSO_PASSWORD=' . urlencode($cp_password); $response = cp_post_page($ch, 'https://sso-cal.canadapost-postescanada.ca/cpid/login/redirect', $query_string); // get Canada Post customer number $regexp = "SSO_CUSTOMER_NUMBER\" value=\"([0123456789]*)(,|\")"; $matches = ''; preg_match("/$regexp/siU", $response, $matches); $cp_customer = $matches[1]; $response = cp_submit_page($ch, $response, 'https://sso-cal.canadapost-postescanada.ca'); // Sanity Check and Progress Report if (strstr($response, '<input type=hidden name="SSO_VERSION_MAJOR" value="3">') === FALSE) { cp_error(2, 'Failed check in ' . __FILE__ . ' at line ' . __LINE__ . '. This most likely means that Canada Post has changed their user interface. You need to update your Canada Post Automatic Shipping Labels module.'); curl_close($ch); die(); ///////////////////// } else { cp_progress(2, 'Logged in.'); } Any help would be appreciated....
×