<!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>[4156] sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments: WordCamp.org: Convert spaces to tabs, and fix an array key.</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/4156">4156</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/4156","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>kovshenin</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2016-09-28 12:52:27 +0000 (Wed, 28 Sep 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.org: Convert spaces to tabs, and fix an array key.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcamppaymentscsssponsorpaymentscss">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/css/sponsor-payments.css</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcamppaymentsincludessponsorpaymentstripephp">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/sponsor-payment-stripe.php</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcamppaymentsviewssponsorpaymentmainphp">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/views/sponsor-payment/main.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcamppaymentscsssponsorpaymentscss"></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-payments/css/sponsor-payments.css</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-payments/css/sponsor-payments.css        2016-09-28 12:43:35 UTC (rev 4155)
+++ sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/css/sponsor-payments.css  2016-09-28 12:52:27 UTC (rev 4156)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,14 +1,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .wcorg-sponsor-payment label,
</span><span class="cx" style="display: block; padding: 0 10px"> .wcorg-sponsor-payment .control {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-    float: left;
-    clear: both;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ float: left;
+       clear: both;
</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"> .wcorg-sponsor-payment label {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-    margin-top: 10px;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ margin-top: 10px;
</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"> .wcorg-sponsor-payment .clear {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-    display: block;
-    margin-bottom: 20px;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ display: block;
+       margin-bottom: 20px;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcamppaymentsincludessponsorpaymentstripephp"></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-payments/includes/sponsor-payment-stripe.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-payments/includes/sponsor-payment-stripe.php     2016-09-28 12:43:35 UTC (rev 4155)
+++ sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/sponsor-payment-stripe.php       2016-09-28 12:52:27 UTC (rev 4156)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -21,28 +21,28 @@
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> function render() {
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-    // Make sure we have Stripe keys and an HMAC.
-    $keys = _get_keys();
-    if ( empty( $keys['publishable'] ) || empty( $keys['secret'] ) || empty( $keys['wcorg_hmac'] ) )
-        return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Make sure we have Stripe keys and an HMAC.
+       $keys = _get_keys();
+       if ( empty( $keys['publishable'] ) || empty( $keys['secret'] ) || empty( $keys['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">-    // Make sure WordCamp_Budgets is available.
-    require_once( __DIR__ . '/wordcamp-budgets.php' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Make sure WordCamp_Budgets is available.
+       require_once( __DIR__ . '/wordcamp-budgets.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">-    $data = array(
-        'keys' => $keys,
-        'step' => STEP_SELECT_INVOICE,
-        'wordcamps' => _get_wordcamps(),
-        'currencies' => \WordCamp_Budgets::get_currencies(),
-        'errors' => array(),
-    );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $data = array(
+               'keys' => $keys,
+               'step' => STEP_SELECT_INVOICE,
+               'wordcamps' => _get_wordcamps(),
+               'currencies' => \WordCamp_Budgets::get_currencies(),
+               'errors' => 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 ( ! empty( $_POST['sponsor_payment_submit'] ) ) {
-        _handle_post_data( $data ); // $data passed by ref.
-    }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $_POST['sponsor_payment_submit'] ) ) {
+               _handle_post_data( $data ); // $data passed by ref.
+       }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-    wp_enqueue_style( 'wcb-sponsor-payments', plugins_url( 'css/sponsor-payments.css', __DIR__ ), array(), CSS_VERSION );
-    require_once( dirname( __DIR__ ) . '/views/sponsor-payment/main.php' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_enqueue_style( 'wcb-sponsor-payments', plugins_url( 'css/sponsor-payments.css', __DIR__ ), array(), CSS_VERSION );
+       require_once( dirname( __DIR__ ) . '/views/sponsor-payment/main.php' );
</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"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -51,14 +51,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * @return array Stripe and HMAC keys.
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> function _get_keys() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-    return apply_filters( 'wcorg_sponsor_payment_stripe', array(
-        // Stripe API credentials.
-        'publishable' => '',
-        'secret' => '',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return apply_filters( 'wcorg_sponsor_payment_stripe', array(
+               // Stripe API credentials.
+               'publishable' => '',
+               'secret' => '',
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        // An HMAC key used to sign some data in between requests.
-        'hmac_key' => '',
-    ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         // An HMAC key used to sign some data in between requests.
+               'hmac_key' => '',
+       ) );
</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"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -67,24 +67,24 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * @return array An array or WP_Post objects for all public WordCamps.
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> function _get_wordcamps() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-    static $wordcamps;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ static $wordcamps;
</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 ( ! isset( $wordcamps ) ) {
-        $wordcamps = get_posts( array(
-            'post_type' => 'wordcamp',
-            'post_status' => \WordCamp_Loader::get_public_post_statuses(),
-            'posts_per_page' => -1,
-            'orderby'        => 'title',
-            'order'          => 'asc',
-            'meta_query'     => array( array(
-                'key'        => 'Start Date (YYYY-mm-dd)',
-                'value'      => strtotime( '-14 days' ),
-                'compare'    => '>'
-            ) )
-        ) );
-    }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! isset( $wordcamps ) ) {
+               $wordcamps = get_posts( array(
+                       'post_type' => 'wordcamp',
+                       'post_status' => \WordCamp_Loader::get_public_post_statuses(),
+                       'posts_per_page' => -1,
+                       'orderby'               => 'title',
+                       'order'           => 'asc',
+                       'meta_query'     => array( array(
+                               'key'           => 'Start Date (YYYY-mm-dd)',
+                               'value'   => strtotime( '-14 days' ),
+                               'compare'       => '>'
+                       ) )
+               ) );
+       }
</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 $wordcamps;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $wordcamps;
</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"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -97,119 +97,119 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * @param array $data By-ref $data array that is passed to the view.
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> function _handle_post_data( &$data ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-    $step = isset( $_POST['step'] ) ? absint( $_POST['step'] ) : STEP_SELECT_INVOICE;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $step = isset( $_POST['step'] ) ? absint( $_POST['step'] ) : STEP_SELECT_INVOICE;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-    switch ( $_POST['step'] ) {
-        case STEP_SELECT_INVOICE:
-            // An invoice, event, currency and amount have been selected.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ switch ( $_POST['step'] ) {
+               case STEP_SELECT_INVOICE:
+                       // An invoice, event, currency and amount have been selected.
</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['currency'] ) ) {
-                $data['errors'][] = 'Please select a currency.';
-                return;
-            }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 if ( empty( $_POST['currency'] ) ) {
+                               $data['errors'][] = 'Please select a currency.';
+                               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">-            $currency = $_POST['currency'];
-            if ( ! array_key_exists( $currency, $data['currencies'] ) or strpos( $currency, 'null' ) === 0 ) {
-                $data['errors'][] = 'Invalid currency.';
-                return;
-            }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $currency = $_POST['currency'];
+                       if ( ! array_key_exists( $currency, $data['currencies'] ) or strpos( $currency, 'null' ) === 0 ) {
+                               $data['errors'][] = 'Invalid currency.';
+                               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['amount'] ) ) {
-                $data['errors'][] = 'Please enter a payment amount.';
-                return;
-            }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 if ( empty( $_POST['amount'] ) ) {
+                               $data['errors'][] = 'Please enter a payment amount.';
+                               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">-            $amount = round( floatval( $_POST['amount'] ), 2 );
-            if ( $amount < 1.00 ) {
-                $data['errors'][] = 'Amount can not be less than 1.00.';
-                return;
-            }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $amount = round( floatval( $_POST['amount'] ), 2 );
+                       if ( $amount < 1.00 ) {
+                               $data['errors'][] = 'Amount can not be less than 1.00.';
+                               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_id'] ) ) {
-                $data['errors'][] = 'Please select an event.';
-                return;
-            }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 if ( empty( $_POST['wordcamp_id'] ) ) {
+                               $data['errors'][] = 'Please select an event.';
+                               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">-            // Make sure the selected WordCamp is valid.
-            $wordcamp_id = absint( $_POST['wordcamp_id'] );
-            $valid_ids = wp_list_pluck( _get_wordcamps(), 'ID' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 // Make sure the selected WordCamp is valid.
+                       $wordcamp_id = absint( $_POST['wordcamp_id'] );
+                       $valid_ids = wp_list_pluck( _get_wordcamps(), '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">-            if ( ! in_array( $wordcamp_id, $valid_ids ) ) {
-                $data['errors'][] = 'Please select a valid event.';
-                return;
-            }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 if ( ! in_array( $wordcamp_id, $valid_ids ) ) {
+                               $data['errors'][] = 'Please select a valid event.';
+                               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['invoice_id'] ) ) {
-                $data['errors'][] = 'Please provide a valid invoice ID.';
-                return;
-            }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 if ( empty( $_POST['invoice_id'] ) ) {
+                               $data['errors'][] = 'Please provide a valid invoice 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">-            $invoice_id = absint( $_POST['invoice_id'] );
-            $wordcamp_site_id = get_wordcamp_site_id( get_post( $wordcamp_id ) );
-            if ( empty( $wordcamp_site_id ) ) {
-                $data['errors'][] = 'Could not find a site for this WordCamp.';
-                return;
-            }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $invoice_id = absint( $_POST['invoice_id'] );
+                       $wordcamp_site_id = get_wordcamp_site_id( get_post( $wordcamp_id ) );
+                       if ( empty( $wordcamp_site_id ) ) {
+                               $data['errors'][] = 'Could not find a site for this WordCamp.';
+                               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">-            // Next step is to collect the card details via Stripe.
-            $data['step'] = STEP_PAYMENT_DETAILS;
-            $data['payment'] = array(
-                'currency' => $currency,
-                'amount' => $amount,
-                'wordcamp_id' => $wordcamp_id,
-                'invoice_id' => $invoice_id,
-            );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 // Next step is to collect the card details via Stripe.
+                       $data['step'] = STEP_PAYMENT_DETAILS;
+                       $data['payment'] = array(
+                               'currency' => $currency,
+                               'amount' => $amount,
+                               'wordcamp_id' => $wordcamp_id,
+                               'invoice_id' => $invoice_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">-            // Passed through to the charge step.
-            $data['payment_data_json'] = json_encode( $data['payment'] );
-            $data['payment_data_signature'] = hash_hmac( 'sha256', $data['payment_data_json'], $data['keys']['hmac_key'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 // Passed through to the charge step.
+                       $data['payment_data_json'] = json_encode( $data['payment'] );
+                       $data['payment_data_signature'] = hash_hmac( 'sha256', $data['payment_data_json'], $data['keys']['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">-            // Add a WordCamp object for convenience.
-            $data['payment']['wordcamp_obj'] = get_post( $wordcamp_id );
-            break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 // Add a WordCamp object for convenience.
+                       $data['payment']['wordcamp_obj'] = get_post( $wordcamp_id );
+                       break;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        case STEP_PAYMENT_DETAILS:
-            // The card details have been entered and Stripe has submitted our form.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         case STEP_PAYMENT_DETAILS:
+                       // The card details have been entered and Stripe has submitted our form.
</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['stripeToken'] ) ) {
-                $data['errors'][] = 'Stripe token not found.';
-                return;
-            }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 if ( empty( $_POST['stripeToken'] ) ) {
+                               $data['errors'][] = 'Stripe token not found.';
+                               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">-            // Make sure our data hasn't been altered.
-            $payment_data_str = wp_unslash( $_POST['payment_data_json'] );
-            $payment_data = json_decode( $payment_data_str, true );
-            if ( ! hash_equals( hash_hmac( 'sha256', $payment_data_str, $data['keys']['hmac_key'] ), $_POST['payment_data_signature'] ) ) {
-                $data['errors'][] = 'Could not verify payload signature.';
-                return;
-            }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 // Make sure our data hasn't been altered.
+                       $payment_data_str = wp_unslash( $_POST['payment_data_json'] );
+                       $payment_data = json_decode( $payment_data_str, true );
+                       if ( ! hash_equals( hash_hmac( 'sha256', $payment_data_str, $data['keys']['hmac_key'] ), $_POST['payment_data_signature'] ) ) {
+                               $data['errors'][] = 'Could not verify payload signature.';
+                               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">-            $wordcamp_obj = get_post( $payment_data['wordcamp_id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $wordcamp_obj = get_post( $payment_data['wordcamp_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">-            require_once( __DIR__ . '/stripe-php/init.php' );
-            \Stripe\Stripe::setApiKey( $data['keys']['secret'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 require_once( __DIR__ . '/stripe-php/init.php' );
+                       \Stripe\Stripe::setApiKey( $data['keys']['secret'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-            try {
-                $charge = \Stripe\Charge::create( array(
-                    'amount' => round( $payment_data['amount'], 2 ) * 100,
-                    'currency' => $payment_data['currency'],
-                    'source' => $_POST['stripeToken'],
-                    'description' => 'WordCamp Sponsorship: ' . $wordcamp_obj->post_title,
-                    'metadata' => array(
-                        'invoice_id' => $payment_data['invoice_id'],
-                        'wordcamp_id' => $payment_data['wordcamp_id'],
-                    ),
-                ) );
-            } catch ( \Stripe\Error\Card $e ) {
-                $data['errors'][] = 'The card has been declined.';
-                return;
-            } catch ( \Exception $e ) {
-                $data['errors'][] = 'An unknown error has occurred, please try again later.';
-                return;
-            }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 try {
+                               $charge = \Stripe\Charge::create( array(
+                                       'amount' => round( $payment_data['amount'], 2 ) * 100,
+                                       'currency' => $payment_data['currency'],
+                                       'source' => $_POST['stripeToken'],
+                                       'description' => 'WordCamp Sponsorship: ' . $wordcamp_obj->post_title,
+                                       'metadata' => array(
+                                               'invoice_id' => $payment_data['invoice_id'],
+                                               'wordcamp_id' => $payment_data['wordcamp_id'],
+                                       ),
+                               ) );
+                       } catch ( \Stripe\Error\Card $e ) {
+                               $data['errors'][] = 'The card has been declined.';
+                               return;
+                       } catch ( \Exception $e ) {
+                               $data['errors'][] = 'An unknown error has occurred, please try again later.';
+                               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">-            // All good!
-            $data['step'] = STEP_PAYMENT_SUCCESS;
-            break;
-    }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 // All good!
+                       $data['step'] = STEP_PAYMENT_SUCCESS;
+                       break;
+       }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswordcamppaymentsviewssponsorpaymentmainphp"></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-payments/views/sponsor-payment/main.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-payments/views/sponsor-payment/main.php  2016-09-28 12:43:35 UTC (rev 4155)
+++ sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/views/sponsor-payment/main.php    2016-09-28 12:52:27 UTC (rev 4156)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5,116 +5,116 @@
</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"> <div id="container">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-    <div id="content" class="wcorg-sponsor-payment" role="main">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div id="content" class="wcorg-sponsor-payment" role="main">
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        <h1 class="entry-title">Sponsorship Payment</h1>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         <h1 class="entry-title">Sponsorship Payment</h1>
</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['errors'] ) ) : ?>
-            <?php foreach ( $data['errors'] as $error ) : ?>
-                <p><strong>Error:</strong> <?php echo esc_html( $error ); ?></p>
-            <?php endforeach; ?>
-        <?php endif; ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         <?php if ( ! empty( $data['errors'] ) ) : ?>
+                       <?php foreach ( $data['errors'] as $error ) : ?>
+                               <p><strong>Error:</strong> <?php echo esc_html( $error ); ?></p>
+                       <?php endforeach; ?>
+               <?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 ( $data['step'] == STEP_SELECT_INVOICE ) : ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         <?php if ( $data['step'] == STEP_SELECT_INVOICE ) : ?>
</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>Use this form to pay your WordCamp sponsorship fee to WordPress Community Support, PBC. If you did not receive an invoice ID yet, please get in touch with the event's Sponsorships Coordinator for more information.</p>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 <p>Use this form to pay your WordCamp sponsorship fee to WordPress Community Support, PBC. If you did not receive an invoice ID yet, please get in touch with the event's Sponsorships Coordinator for more information.</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">-            <form method="POST">
-                <input type="hidden" name="step" value="<?php echo STEP_SELECT_INVOICE; ?>" />
-                <input type="hidden" name="sponsor_payment_submit" value="1" />
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 <form method="POST">
+                               <input type="hidden" name="step" value="<?php echo STEP_SELECT_INVOICE; ?>" />
+                               <input type="hidden" name="sponsor_payment_submit" value="1" />
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                <label>Event</label>
-                <div class="control">
-                    <select name="wordcamp_id">
-                        <option value="" disabled selected>Select a WordCamp</option>
-                        <?php foreach ( $data['wordcamps'] as $wordcamp ) : ?>
-                        <option value="<?php echo esc_attr( $wordcamp->ID ); ?>"><?php echo esc_html( $wordcamp->post_title ); ?></option>
-                        <?php endforeach; ?>
-                    </select>
-                </div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         <label>Event</label>
+                               <div class="control">
+                                       <select name="wordcamp_id">
+                                               <option value="" disabled selected>Select a WordCamp</option>
+                                               <?php foreach ( $data['wordcamps'] as $wordcamp ) : ?>
+                                               <option value="<?php echo esc_attr( $wordcamp->ID ); ?>"><?php echo esc_html( $wordcamp->post_title ); ?></option>
+                                               <?php endforeach; ?>
+                                       </select>
+                               </div>
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                <label>Invoice ID</label>
-                <div class="control">
-                    <input type="text" name="invoice_id" />
-                </div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         <label>Invoice ID</label>
+                               <div class="control">
+                                       <input type="text" name="invoice_id" />
+                               </div>
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                <label>Currency</label>
-                <div class="control">
-                    <select name="currency">
-                        <option value="" disabled selected>Select a Currency</option>
-                        <?php foreach ( $data['currencies'] as $currency_key => $currency_name ) : ?>
-                        <option value="<?php echo esc_attr( $currency_key ); ?>">
-                            <?php echo esc_html( $currency_name ); ?>
-                        </option>
-                        <?php endforeach; ?>
-                    </select>
-                </div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         <label>Currency</label>
+                               <div class="control">
+                                       <select name="currency">
+                                               <option value="" disabled selected>Select a Currency</option>
+                                               <?php foreach ( $data['currencies'] as $currency_key => $currency_name ) : ?>
+                                               <option value="<?php echo esc_attr( $currency_key ); ?>">
+                                                       <?php echo esc_html( $currency_name ); ?>
+                                               </option>
+                                               <?php endforeach; ?>
+                                       </select>
+                               </div>
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                <label>Amount</label>
-                <div class="control">
-                    <input type="text" name="amount" />
-                </div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         <label>Amount</label>
+                               <div class="control">
+                                       <input type="text" name="amount" />
+                               </div>
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                <div class="clear"></div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         <div class="clear"></div>
</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="submit" value="Continue" />
-            </form>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         <input type="submit" value="Continue" />
+                       </form>
</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 elseif ( $data['step'] == STEP_PAYMENT_DETAILS ) : ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         <?php elseif ( $data['step'] == STEP_PAYMENT_DETAILS ) : ?>
</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>Please review the details below and hit "Make a Payment" when you're ready.</p>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 <p>Please review the details below and hit "Make a Payment" when you're ready.</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">-            <table>
-                <tr>
-                    <td>Invoice</td>
-                    <td><?php echo esc_html( $data['payment']['invoice_id'] ); ?></td>
-                </tr>
-                <tr>
-                    <td>Event</td>
-                    <td><?php echo esc_html( $data['payment']['wordcamp_obj']->post_title ); ?></td>
-                </tr>
-                <tr>
-                    <td>Currency</td>
-                    <td><?php echo esc_html( $data['payment']['currency'] ); ?></td>
-                </tr>
-                <tr>
-                    <td>Amount</td>
-                    <td><?php echo number_format( round( $data['payment']['amount'], 2 ), 2, '.', ' ' ); ?></td>
-                </tr>
-            </table>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 <table>
+                               <tr>
+                                       <td>Invoice</td>
+                                       <td><?php echo esc_html( $data['payment']['invoice_id'] ); ?></td>
+                               </tr>
+                               <tr>
+                                       <td>Event</td>
+                                       <td><?php echo esc_html( $data['payment']['wordcamp_obj']->post_title ); ?></td>
+                               </tr>
+                               <tr>
+                                       <td>Currency</td>
+                                       <td><?php echo esc_html( $data['payment']['currency'] ); ?></td>
+                               </tr>
+                               <tr>
+                                       <td>Amount</td>
+                                       <td><?php echo number_format( round( $data['payment']['amount'], 2 ), 2, '.', ' ' ); ?></td>
+                               </tr>
+                       </table>
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-            <form method="POST">
-                <input type="hidden" name="step" value="<?php echo STEP_PAYMENT_DETAILS; ?>" />
-                <input type="hidden" name="sponsor_payment_submit" value="1" />
-                <input type="hidden" name="payment_data_json" value="<?php echo esc_attr( $data['payment_data_json'] ); ?>" />
-                <input type="hidden" name="payment_data_signature" value="<?php echo esc_attr( $data['payment_data_signature'] ); ?>" />
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 <form method="POST">
+                               <input type="hidden" name="step" value="<?php echo STEP_PAYMENT_DETAILS; ?>" />
+                               <input type="hidden" name="sponsor_payment_submit" value="1" />
+                               <input type="hidden" name="payment_data_json" value="<?php echo esc_attr( $data['payment_data_json'] ); ?>" />
+                               <input type="hidden" name="payment_data_signature" value="<?php echo esc_attr( $data['payment_data_signature'] ); ?>" />
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                <script src="https://checkout.stripe.com/checkout.js" class="stripe-button"
-                    data-key="<?php echo esc_attr( $data['keys']['publishable'] ); ?>"
-                    data-amount="<?php echo esc_attr( round( $data['payment']['amount'], 2 ) * 100 ); ?>"
-                    data-currency="<?php echo esc_attr( $data['payment']['currency'] ); ?>"
-                    data-name="WordPress Community Support, PBC"
-                    data-description="Event Sponsorship Payment"
-                    data-image="https://stripe.com/img/documentation/checkout/marketplace.png"
-                    data-locale="auto"
-                    data-panel-label="Pay"
-                    data-label="Make a Payment"
-                    data-zip-code="true">
-                </script>
-            </form>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         <script src="https://checkout.stripe.com/checkout.js" class="stripe-button"
+                                       data-key="<?php echo esc_attr( $data['keys']['publishable'] ); ?>"
+                                       data-amount="<?php echo esc_attr( round( $data['payment']['amount'], 2 ) * 100 ); ?>"
+                                       data-currency="<?php echo esc_attr( $data['payment']['currency'] ); ?>"
+                                       data-name="WordPress Community Support, PBC"
+                                       data-description="Event Sponsorship Payment"
+                                       data-image="https://stripe.com/img/documentation/checkout/marketplace.png"
+                                       data-locale="auto"
+                                       data-panel-label="Pay"
+                                       data-label="Make a Payment"
+                                       data-zip-code="true">
+                               </script>
+                       </form>
</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 elseif ( $data['step'] == STEP_PAYMENT_SUCCESS ) : ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         <?php elseif ( $data['step'] == STEP_PAYMENT_SUCCESS ) : ?>
</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><strong>Success!</strong> Your payment has been received, thank you!</p>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 <p><strong>Success!</strong> Your payment has been received, thank you!</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">-            <ul>
-                <li><a href="<?php echo esc_url( add_query_arg( 'again', 1 ) ); ?>">Make another payment</a></li>
-                <li><a href="<?php echo esc_url( home_url( '/' ) ); ?>">Go back to Central</a></li>
-            </ul>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 <ul>
+                               <li><a href="<?php echo esc_url( add_query_arg( 'again', 1 ) ); ?>">Make another payment</a></li>
+                               <li><a href="<?php echo esc_url( home_url( '/' ) ); ?>">Go back to Central</a></li>
+                       </ul>
</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 endif; ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         <?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">-    </div><!-- #content -->
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ </div><!-- #content -->
</ins><span class="cx" style="display: block; padding: 0 10px"> </div><!-- #container -->
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> <?php get_footer(); ?>
</span></span></pre>
</div>
</div>

</body>
</html>