function get_shipment_info($post_id, $shipment_source_data) { if (empty($post_id)) { $wftrackingmsg = 0; wp_redirect(admin_url('/post.php?post=' . $post_id . '&action=edit&' . self::TRACKING_MESSAGE_KEY . '=' . $wftrackingmsg)); exit; } if ('' == $shipment_source_data['shipping_service']) { update_post_meta($post_id, self::SHIPMENT_SOURCE_KEY, $shipment_source_data); update_post_meta($post_id, self::SHIPMENT_RESULT_KEY, ''); $wftrackingmsg = 6; wp_redirect(admin_url('/post.php?post=' . $post_id . '&action=edit&' . self::TRACKING_MESSAGE_KEY . '=' . $wftrackingmsg)); exit; } update_post_meta($post_id, self::SHIPMENT_SOURCE_KEY, $shipment_source_data); try { $shipment_result = WfTrackingUtil::get_shipment_result($shipment_source_data); } catch (Exception $e) { $wftrackingmsg = 0; wp_redirect(admin_url('/post.php?post=' . $post_id . '&action=edit&' . self::TRACKING_MESSAGE_KEY . '=' . $wftrackingmsg)); exit; } return $shipment_result; }
private function load_tracking_data() { $this->tracking_data = WfTrackingUtil::load_tracking_data(); }