<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[2513] sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-qbo-client/wordcamp-qbo-client.php: WordCamp QBO Client: Convert spaces to tabs for coding standards conformance.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://meta.trac.wordpress.org/changeset/2513">2513</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://meta.trac.wordpress.org/changeset/2513","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>iandunn</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2016-02-16 01:07:19 +0000 (Tue, 16 Feb 2016)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>WordCamp QBO Client: Convert spaces to tabs for coding standards conformance.

When adding new code that conforms to the guidelines, the existing spaces make it harder to review the diff, because they throw off the alignment of the addition and deletion lines.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampqboclientwordcampqboclientphp">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-qbo-client/wordcamp-qbo-client.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcampqboclientwordcampqboclientphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-qbo-client/wordcamp-qbo-client.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-qbo-client/wordcamp-qbo-client.php       2016-02-15 22:59:08 UTC (rev 2512)
+++ sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-qbo-client/wordcamp-qbo-client.php 2016-02-16 01:07:19 UTC (rev 2513)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4,290 +4,290 @@
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> class WordCamp_QBO_Client {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-    private static $hmac_key;
-    private static $api_base;
-    private static $options;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ private static $hmac_key;
+       private static $api_base;
+       private static $options;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-    public static function load_options() {
-        if ( isset( self::$options ) )
-            return self::$options;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function load_options() {
+               if ( isset( self::$options ) )
+                       return self::$options;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        self::$options = wp_parse_args( get_option( 'wordcamp-qbo-client', array() ), array(
-            'default-class' => '',
-        ) );
-    }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         self::$options = wp_parse_args( get_option( 'wordcamp-qbo-client', array() ), array(
+                       'default-class' => '',
+               ) );
+       }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-    public static function load() {
-        add_action( 'plugins_loaded', array( __CLASS__, 'plugins_loaded' ) );
-    }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function load() {
+               add_action( 'plugins_loaded', array( __CLASS__, 'plugins_loaded' ) );
+       }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-    public static function plugins_loaded() {
-        $init_options = wp_parse_args( apply_filters( 'wordcamp_qbo_client_options', array() ), array(
-            'hmac_key' => '',
-            'api_base' => '',
-        ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function plugins_loaded() {
+               $init_options = wp_parse_args( apply_filters( 'wordcamp_qbo_client_options', array() ), array(
+                       'hmac_key' => '',
+                       'api_base' => '',
+               ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        foreach ( $init_options as $key => $value )
-            self::$$key = $value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         foreach ( $init_options as $key => $value )
+                       self::$$key = $value;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if ( empty( self::$hmac_key ) )
-            return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( empty( self::$hmac_key ) )
+                       return;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        add_action( 'admin_init', array( __CLASS__, 'admin_init' ), 20 );
-    }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         add_action( 'admin_init', array( __CLASS__, 'admin_init' ), 20 );
+       }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-    public static function admin_init() {
-        $cap = is_multisite() ? 'manage_network' : 'manage_options';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function admin_init() {
+               $cap = is_multisite() ? 'manage_network' : 'manage_options';
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if ( ! current_user_can( $cap ) )
-            return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( ! current_user_can( $cap ) )
+                       return;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if ( ! class_exists( 'WCP_Payment_Request' ) )
-            return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( ! class_exists( 'WCP_Payment_Request' ) )
+                       return;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        add_action( 'add_meta_boxes', array( __CLASS__, 'add_meta_boxes' ) );
-        add_action( 'admin_notices', array( __CLASS__, 'admin_notices' ) );
-        add_action( 'save_post', array( __CLASS__, 'save_post' ), 20, 2 );
-    }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         add_action( 'add_meta_boxes', array( __CLASS__, 'add_meta_boxes' ) );
+               add_action( 'admin_notices', array( __CLASS__, 'admin_notices' ) );
+               add_action( 'save_post', array( __CLASS__, 'save_post' ), 20, 2 );
+       }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-    public static function admin_notices() {
-        $screen = get_current_screen();
-        if ( $screen->id != 'wcp_payment_request' )
-            return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function admin_notices() {
+               $screen = get_current_screen();
+               if ( $screen->id != 'wcp_payment_request' )
+                       return;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $post = get_post();
-        if ( $post->post_status == 'auto-draft' )
-            return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post = get_post();
+               if ( $post->post_status == 'auto-draft' )
+                       return;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $data = get_post_meta( $post->ID, '_wordcamp-qbo-client-data', true );
-        if ( empty( $data['last_error'] ) )
-            return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $data = get_post_meta( $post->ID, '_wordcamp-qbo-client-data', true );
+               if ( empty( $data['last_error'] ) )
+                       return;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        printf( '<div class="notice error is-dismissible"><p>QBO Sync Error: %s</p></div>', esc_html( $data['last_error'] ) );
-    }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         printf( '<div class="notice error is-dismissible"><p>QBO Sync Error: %s</p></div>', esc_html( $data['last_error'] ) );
+       }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-    public static function update_options() {
-        self::load_options();
-        update_option( 'wordcamp-qbo-client', self::$options );
-    }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function update_options() {
+               self::load_options();
+               update_option( 'wordcamp-qbo-client', self::$options );
+       }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-    public static function add_meta_boxes() {
-       add_meta_box( 'qbo-metabox-quickbooks', 'QuickBooks', array( __CLASS__, 'metabox_quickbooks' ),
-               WCP_Payment_Request::POST_TYPE, 'side', 'high' );
-    }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function add_meta_boxes() {
+               add_meta_box( 'qbo-metabox-quickbooks', 'QuickBooks', array( __CLASS__, 'metabox_quickbooks' ),
+                       WCP_Payment_Request::POST_TYPE, 'side', 'high' );
+       }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-    /**
-     * Get an array of classes from QBO.
-     *
-     * @uses get_transient()
-     *
-     * @return array Class IDs as keys, names as values.
-     */
-    private static function _get_classes() {
-        $cache_key = md5( 'wordcamp-qbo-client:classes' );
-        $cache = get_transient( $cache_key );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+        * Get an array of classes from QBO.
+        *
+        * @uses get_transient()
+        *
+        * @return array Class IDs as keys, names as values.
+        */
+       private static function _get_classes() {
+               $cache_key = md5( 'wordcamp-qbo-client:classes' );
+               $cache = get_transient( $cache_key );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if ( $cache !== false )
-            return $cache;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( $cache !== false )
+                       return $cache;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $request_url = esc_url_raw( self::$api_base . '/classes/' );
-        $response = wp_remote_get( $request_url, array(
-            'headers' => array(
-                'Content-Type' => 'application/json',
-                'Authorization' => self::_get_auth_header( 'get', $request_url ),
-            ),
-        ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $request_url = esc_url_raw( self::$api_base . '/classes/' );
+               $response = wp_remote_get( $request_url, array(
+                       'headers' => array(
+                               'Content-Type' => 'application/json',
+                               'Authorization' => self::_get_auth_header( 'get', $request_url ),
+                       ),
+               ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $classes = array();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $classes = array();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if ( ! is_wp_error( $response ) && wp_remote_retrieve_response_code( $response ) == 200 ) {
-            $body = json_decode( wp_remote_retrieve_body( $response ), true );
-            if ( ! empty( $body ) && is_array( $body ) )
-                $classes = $body;
-        }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( ! is_wp_error( $response ) && wp_remote_retrieve_response_code( $response ) == 200 ) {
+                       $body = json_decode( wp_remote_retrieve_body( $response ), true );
+                       if ( ! empty( $body ) && is_array( $body ) )
+                               $classes = $body;
+               }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        set_transient( $cache_key, $classes, 12 * HOUR_IN_SECONDS );
-        return $classes;
-    }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         set_transient( $cache_key, $classes, 12 * HOUR_IN_SECONDS );
+               return $classes;
+       }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-    public static function metabox_quickbooks() {
-        self::load_options();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function metabox_quickbooks() {
+               self::load_options();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $post = get_post();
-        $classes = self::_get_classes();
-        $data = get_post_meta( $post->ID, '_wordcamp-qbo-client-data', true );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $post = get_post();
+               $classes = self::_get_classes();
+               $data = get_post_meta( $post->ID, '_wordcamp-qbo-client-data', true );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $selected_class = self::$options['default-class'];
-        if ( ! empty( $data['class'] ) && array_key_exists( $data['class'], $classes ) )
-            $selected_class = $data['class'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $selected_class = self::$options['default-class'];
+               if ( ! empty( $data['class'] ) && array_key_exists( $data['class'], $classes ) )
+                       $selected_class = $data['class'];
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        <?php if ( ! empty( $data['last_error'] ) ) : ?>
-        <p><?php echo esc_html( $data['last_error'] ); ?></p>
-        <?php endif; ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         <?php if ( ! empty( $data['last_error'] ) ) : ?>
+                       <p><?php echo esc_html( $data['last_error'] ); ?></p>
+               <?php endif; ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        <?php if ( empty( $data['transaction_id'] ) ) : ?>
-        <p>This request has not been synced with QuickBooks yet.</p>
-        <?php else: ?>
-        <pre><?php echo esc_html( print_r( $data, true ) ); ?></pre>
-        <?php endif; ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         <?php if ( empty( $data['transaction_id'] ) ) : ?>
+                       <p>This request has not been synced with QuickBooks yet.</p>
+               <?php else: ?>
+                       <pre><?php echo esc_html( print_r( $data, true ) ); ?></pre>
+               <?php endif; ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        <input type="hidden" name="wordcamp-qbo-client-post" value="<?php echo esc_attr( $post->ID ); ?>" />
-        <?php wp_nonce_field( 'wordcamp-qbo-client-push-' . $post->ID, 'wordcamp-qbo-client-nonce' ); ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         <input type="hidden" name="wordcamp-qbo-client-post" value="<?php echo esc_attr( $post->ID ); ?>" />
+               <?php wp_nonce_field( 'wordcamp-qbo-client-push-' . $post->ID, 'wordcamp-qbo-client-nonce' ); ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        <p>
-            <label>
-                <input type="checkbox" value="1" name="wordcamp-qbo-client-push"
-                    <?php checked( ! empty( $data['transaction_id'] ) ); ?> />
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         <p>
+                       <label>
+                               <input type="checkbox" value="1" name="wordcamp-qbo-client-push"
+                                       <?php checked( ! empty( $data['transaction_id'] ) ); ?> />
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                <?php if ( empty( $data['transaction_id'] ) ) : ?>
-                    Push to QuickBooks
-                <?php else : ?>
-                    Push Changes to QuickBooks
-                <?php endif; ?>
-            </label>
-        </p>
-        <p>
-            <label>QuickBooks Class:</label>
-            <select name="wordcamp-qbo-client-class">
-                <option value="">Not Set</option>
-                <?php foreach ( self::_get_classes() as $id => $class ) : ?>
-                <option value="<?php echo esc_attr( $id ); ?>" <?php selected( $id, $selected_class ); ?>><?php echo esc_html( $class ); ?></option>
-                <?php endforeach; ?>
-            </select>
-        </p>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         <?php if ( empty( $data['transaction_id'] ) ) : ?>
+                                       Push to QuickBooks
+                               <?php else : ?>
+                                       Push Changes to QuickBooks
+                               <?php endif; ?>
+                       </label>
+               </p>
+               <p>
+                       <label>QuickBooks Class:</label>
+                       <select name="wordcamp-qbo-client-class">
+                               <option value="">Not Set</option>
+                               <?php foreach ( self::_get_classes() as $id => $class ) : ?>
+                                       <option value="<?php echo esc_attr( $id ); ?>" <?php selected( $id, $selected_class ); ?>><?php echo esc_html( $class ); ?></option>
+                               <?php endforeach; ?>
+                       </select>
+               </p>
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        <?php if ( ! empty( $data['transaction_id'] ) ) : ?>
-            <p>
-                Last Sync: <?php echo gmdate( 'Y-m-d H:i:s', absint( $data['timestamp'] ) ); ?> UTC<br />
-                Transaction ID: <?php echo absint( $data['transaction_id'] ); ?>
-            </p>
-        <?php endif; ?>
-        <?php
-    }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         <?php if ( ! empty( $data['transaction_id'] ) ) : ?>
+                       <p>
+                               Last Sync: <?php echo gmdate( 'Y-m-d H:i:s', absint( $data['timestamp'] ) ); ?> UTC<br />
+                               Transaction ID: <?php echo absint( $data['transaction_id'] ); ?>
+                       </p>
+               <?php endif; ?>
+               <?php
+       }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-    public static function save_post( $post_id, $post ) {
-        if ( $post->post_type !== WCP_Payment_Request::POST_TYPE )
-            return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function save_post( $post_id, $post ) {
+               if ( $post->post_type !== WCP_Payment_Request::POST_TYPE )
+                       return;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if ( empty( $_POST['wordcamp-qbo-client-nonce'] ) || empty( $_POST['wordcamp-qbo-client-post'] ) )
-            return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( empty( $_POST['wordcamp-qbo-client-nonce'] ) || empty( $_POST['wordcamp-qbo-client-post'] ) )
+                       return;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if ( intval( $_POST['wordcamp-qbo-client-post'] ) !== $post->ID )
-            return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( intval( $_POST['wordcamp-qbo-client-post'] ) !== $post->ID )
+                       return;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if ( ! wp_verify_nonce( $_POST['wordcamp-qbo-client-nonce'], 'wordcamp-qbo-client-push-' . $post->ID ) )
-            wp_die( 'Could not verify QBO nonce. Please go back, refresh the page and try again.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( ! wp_verify_nonce( $_POST['wordcamp-qbo-client-nonce'], 'wordcamp-qbo-client-push-' . $post->ID ) )
+                       wp_die( 'Could not verify QBO nonce. Please go back, refresh the page and try again.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        // No need to push.
-        if ( empty( $_POST['wordcamp-qbo-client-push'] ) )
-            return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         // No need to push.
+               if ( empty( $_POST['wordcamp-qbo-client-push'] ) )
+                       return;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if ( $post->post_status != 'paid' )
-            wp_die( 'A request has to be marked as paid before it could be synced to QuickBooks.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( $post->post_status != 'paid' )
+                       wp_die( 'A request has to be marked as paid before it could be synced to QuickBooks.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if ( empty( $_POST['wordcamp-qbo-client-class'] ) )
-            wp_die( 'You need to set a QuickBooks class before you can sync this payment request.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( empty( $_POST['wordcamp-qbo-client-class'] ) )
+                       wp_die( 'You need to set a QuickBooks class before you can sync this payment request.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $class = $_POST['wordcamp-qbo-client-class'];
-        if ( ! array_key_exists( $class, self::_get_classes() ) )
-            wp_die( 'The class you have picked does not exist.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $class = $_POST['wordcamp-qbo-client-class'];
+               if ( ! array_key_exists( $class, self::_get_classes() ) )
+                       wp_die( 'The class you have picked does not exist.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $data = get_post_meta( $post->ID, '_wordcamp-qbo-client-data', true );
-        $txn_id = false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $data = get_post_meta( $post->ID, '_wordcamp-qbo-client-data', true );
+               $txn_id = false;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if ( ! is_array( $data ) )
-            $data = array();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( ! is_array( $data ) )
+                       $data = array();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        // This request has not been synced before.
-        if ( ! empty( $data['transaction_id'] ) )
-            $txn_id = $data['transaction_id'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         // This request has not been synced before.
+               if ( ! empty( $data['transaction_id'] ) )
+                       $txn_id = $data['transaction_id'];
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $amount = get_post_meta( $post->ID, '_camppayments_payment_amount', true );
-        $amount = preg_replace( '#[^\d.-]+#', '', $amount );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $amount = get_post_meta( $post->ID, '_camppayments_payment_amount', true );
+               $amount = preg_replace( '#[^\d.-]+#', '', $amount );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $amount = floatval( $amount );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $currency = get_post_meta( $post->ID, '_camppayments_currency', true );
-        if ( strtoupper( $currency ) != 'USD' )
-            wp_die( 'Non-USD payments sync to QuickBooks is not available yet.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $currency = get_post_meta( $post->ID, '_camppayments_currency', true );
+               if ( strtoupper( $currency ) != 'USD' )
+                       wp_die( 'Non-USD payments sync to QuickBooks is not available yet.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $description_chunks = array( $post->post_title );
-        $description = get_post_meta( $post->ID, '_camppayments_description', true );
-        if ( ! empty( $description ) )
-            $description_chunks[] = $description;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $description_chunks = array( $post->post_title );
+               $description = get_post_meta( $post->ID, '_camppayments_description', true );
+               if ( ! empty( $description ) )
+                       $description_chunks[] = $description;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $description_chunks[] = esc_url_raw( get_edit_post_link( $post->ID, 'raw' ) );
-        $description = implode( "\n", $description_chunks );
-        unset( $description_chunks );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $description_chunks[] = esc_url_raw( get_edit_post_link( $post->ID, 'raw' ) );
+               $description = implode( "\n", $description_chunks );
+               unset( $description_chunks );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $category = get_post_meta( $post->ID, '_camppayments_payment_category', true );
-        $date = absint( get_post_meta( $post->ID, '_camppayments_date_vendor_paid', true ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $category = get_post_meta( $post->ID, '_camppayments_payment_category', true );
+               $date = absint( get_post_meta( $post->ID, '_camppayments_date_vendor_paid', true ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $body = array(
-            'id' => $txn_id,
-            'date' => $date,
-            'amount' => $amount,
-            'category' => $category,
-            'description' => $description,
-            'class' => $class,
-        );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $body = array(
+                       'id' => $txn_id,
+                       'date' => $date,
+                       'amount' => $amount,
+                       'category' => $category,
+                       'description' => $description,
+                       'class' => $class,
+               );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $body = json_encode( $body );
-        $request_url = esc_url_raw( self::$api_base . '/expense/' );
-        $response = wp_remote_post( $request_url, array(
-            'body' => $body,
-            'headers' => array(
-                'Content-Type' => 'application/json',
-                'Authorization' => self::_get_auth_header( 'post', $request_url, $body ),
-            ),
-        ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $body = json_encode( $body );
+               $request_url = esc_url_raw( self::$api_base . '/expense/' );
+               $response = wp_remote_post( $request_url, array(
+                       'body' => $body,
+                       'headers' => array(
+                               'Content-Type' => 'application/json',
+                               'Authorization' => self::_get_auth_header( 'post', $request_url, $body ),
+                       ),
+               ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if ( is_wp_error( $response ) ) {
-            $data['last_error'] = $response->get_error_message();
-        } elseif ( wp_remote_retrieve_response_code( $response ) != 200 ) {
-            $data['last_error'] = 'Could not create or update the QBO transaction.';
-        } else {
-            $body = json_decode( wp_remote_retrieve_body( $response ), true );
-            if ( empty( $body['transaction_id'] ) ) {
-                $data['last_error'] = 'Could not decode JSON response from API.';
-            } else {
-                unset( $data['last_error'] );
-                $data['transaction_id'] = $body['transaction_id'];
-                $data['timestamp'] = time();
-                $data['class'] = $class;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( is_wp_error( $response ) ) {
+                       $data['last_error'] = $response->get_error_message();
+               } elseif ( wp_remote_retrieve_response_code( $response ) != 200 ) {
+                       $data['last_error'] = 'Could not create or update the QBO transaction.';
+               } else {
+                       $body = json_decode( wp_remote_retrieve_body( $response ), true );
+                       if ( empty( $body['transaction_id'] ) ) {
+                               $data['last_error'] = 'Could not decode JSON response from API.';
+                       } else {
+                               unset( $data['last_error'] );
+                               $data['transaction_id'] = $body['transaction_id'];
+                               $data['timestamp'] = time();
+                               $data['class'] = $class;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                // Remember this class for future reference.
-                if ( self::$options['default-class'] != $class ) {
-                    self::$options['default-class'] = $class;
-                    self::update_options();
-                }
-            }
-        }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         // Remember this class for future reference.
+                               if ( self::$options['default-class'] != $class ) {
+                                       self::$options['default-class'] = $class;
+                                       self::update_options();
+                               }
+                       }
+               }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        update_post_meta( $post->ID, '_wordcamp-qbo-client-data', $data );
-    }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         update_post_meta( $post->ID, '_wordcamp-qbo-client-data', $data );
+       }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-    /**
-     * Create an HMAC signature header for a request.
-     *
-     * Use with Authorization HTTP header.
-     *
-     * @see WordCamp_QBO::_is_valid_request()
-     *
-     * @param string $method The request method: GET, POST, etc.
-     * @param string $request_url The clean request URI, without any query arguments.
-     * @param string $body The payload body.
-     * @param array $args The query arguments.
-     *
-     * @return string A sha256 HMAC signature.
-     */
-    private static function _get_auth_header( $method, $request_url, $body = '', $args = array() ) {
-        $signature = hash_hmac( 'sha256', json_encode( array( strtolower( $method ),
-            strtolower( $request_url ), $body, $args ) ), self::$hmac_key );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+        * Create an HMAC signature header for a request.
+        *
+        * Use with Authorization HTTP header.
+        *
+        * @see WordCamp_QBO::_is_valid_request()
+        *
+        * @param string $method The request method: GET, POST, etc.
+        * @param string $request_url The clean request URI, without any query arguments.
+        * @param string $body The payload body.
+        * @param array $args The query arguments.
+        *
+        * @return string A sha256 HMAC signature.
+        */
+       private static function _get_auth_header( $method, $request_url, $body = '', $args = array() ) {
+               $signature = hash_hmac( 'sha256', json_encode( array( strtolower( $method ),
+                       strtolower( $request_url ), $body, $args ) ), self::$hmac_key );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        return 'wordcamp-qbo-hmac ' . $signature;
-    }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         return 'wordcamp-qbo-hmac ' . $signature;
+       }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> WordCamp_QBO_Client::load();
</span><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre>
</div>
</div>

</body>
</html>