function wpsc_get_transaction_html_output($purchase_log)
{
    if (!is_object($purchase_log)) {
        $purchase_log = new WPSC_Purchase_Log($purchase_log);
    }
    $notification = new WPSC_Purchase_Log_Customer_HTML_Notification($purchase_log);
    $output = $notification->get_html_message();
    // see if the customer trying to view this transaction output is the person
    // who made the purchase.
    $checkout_session_id = wpsc_get_customer_meta('checkout_session_id');
    if ($checkout_session_id == $purchase_log->get('sessionid')) {
        $output = apply_filters('wpsc_get_transaction_html_output', $output, $notification);
    } else {
        $output = apply_filters('wpsc_get_transaction_unauthorized_view', __("You don't have the permission to view this page", 'wp-e-commerce'), $output, $notification);
    }
    return $output;
}
function wpsc_get_transaction_html_output($purchase_log)
{
    if (!is_object($purchase_log)) {
        $purchase_log = new WPSC_Purchase_Log($purchase_log);
    }
    if (!$purchase_log->is_transaction_completed() && !$purchase_log->is_order_received()) {
        return '';
    }
    $notification = new WPSC_Purchase_Log_Customer_HTML_Notification($purchase_log);
    $output = $notification->get_html_message();
    $output = apply_filters('wpsc_get_transaction_html_output', $output, $notification);
    return $output;
}