r102943 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102942‎ | r102943 | r102944 >
Date:07:54, 14 November 2011
Author:jamesur
Status:ok
Tags:
Comment:
adding direct debit forms for AT and BE and adjustments to css and RapidHtml to account for same. Still needs a bit of error handling
Modified paths:
  • /trunk/extensions/DonationInterface/gateway_forms/RapidHtml.php (modified) (history)
  • /trunk/extensions/DonationInterface/gateway_forms/rapidhtml/css/webitects.css (modified) (history)
  • /trunk/extensions/DonationInterface/globalcollect_gateway/forms/html/dd (added) (history)
  • /trunk/extensions/DonationInterface/globalcollect_gateway/forms/html/dd/dd-AT.html (added) (history)
  • /trunk/extensions/DonationInterface/globalcollect_gateway/forms/html/dd/dd-BE.html (added) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/gateway_forms/rapidhtml/css/webitects.css
@@ -74,6 +74,14 @@
7575 .loc-fields .loc-street { margin-bottom: 5px; width: 100%; }
7676 .loc-fields .loc-country { margin-bottom: 5px; width: 103%; }
7777
 78+/* Direct Debit setups*/
 79+.dd-fields { float: left; margin-bottom: 5px; margin-top: 5px;}
 80+.dd-be-an { float: left; width: 45%; }
 81+.dd-be-ai { float: left; width: 45%; margin-left: 5%; }
 82+.dd-at-accountname { float: left; width: 97%; margin-bottom: 10px;}
 83+.dd-at-an { float: left; width: 45%; }
 84+.dd-at-bc { float: left; width: 45%; margin-left: 5%; }
 85+
7886 /* Location where we are not including a state select */
7987 .loc-fields.nostate .loc-city { float: left; margin: 0 1% 5px 0; width: 48%; }
8088 .loc-fields.nostate .loc-postal { float: left; margin: 0 1% 5px 0; width: 49%; }
@@ -213,4 +221,4 @@
214222 ul#moreinfolinks li{
215223 list-style: none !important;
216224 list-style-image: none !important;
217 -}
\ No newline at end of file
 225+}
Index: trunk/extensions/DonationInterface/gateway_forms/RapidHtml.php
@@ -52,6 +52,10 @@
5353 '@gateway', // => 'payflowpro', // this may need to become dynamic in the future
5454 '@owa_session', // => $wgRequest->getText( 'owa_session', null ),
5555 '@owa_ref', // => $owa_ref,
 56+ '@account_number',
 57+ '@authorization_id',
 58+ '@account_name',
 59+ '@bank_code',
5660 // Not actually data tokens, but available to you in html form:
5761 // @captcha -> the captcha form
5862 // @script_path -> maps to $wgScriptPath
Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/html/dd/dd-AT.html
@@ -0,0 +1,156 @@
 2+<script type="text/javascript">
 3+ mw.loader.load('gc.form.rapidhtml.webitects.bt');
 4+ // these must go through RapidHTML and thus are inline
 5+ var amountErrors = ["#general|escape",'#retryMsg|escape','#amount|escape'];
 6+ var billingErrors = ['#fname|escape','#lname|escape','#city|escape','#country|escape','#street|escape','#state|escape','#zip|escape','#emailAdd|escape'];
 7+ var paymentErrors = ['#card_num|escape','#card_type|escape','#cvv|escape'];
 8+ var actionURL = "@action";
 9+ var scriptPath = "@script_path";
 10+</script>
 11+<!--[if lt IE 7]>
 12+<script type="text/javascript">
 13+ mw.loader.load('gc.form.rapidhtml.webitects.ie6');
 14+</script>
 15+<style type="text/css">
 16+ body{
 17+ behavior: url("@script_path/skins/vector/csshover.min.htc");
 18+ }
 19+</style><![endif]-->
 20+<!--[if IE 7]>
 21+<style>
 22+ .gainlayout {
 23+ zoom: 1;
 24+ height: 1%;
 25+ }
 26+</style>
 27+<![endif]-->
 28+
 29+<div class="ltr">
 30+ <table id="layouttable">
 31+ <tr>
 32+ <td>
 33+ <div id="appeal">
 34+ <div id="appeal-content">
 35+ <h2 id="appeal-head"> <span class="mw-headline">{{LanguageSwitch|2011FR/@appeal/title|@language}}</span></h2>
 36+ <div id="appeal-body" class="plainlinks">{{LanguageSwitch|2011FR/@appeal/text|@language}}</div>
 37+ </div>
 38+ </div>
 39+ </td>
 40+ <td>
 41+ <div id="donate">
 42+ <div id="donate-content">
 43+ <div id="donate-body" style="padding: 0 1em;">
 44+ <form method="post" name="paypalcontribution">
 45+ <div id="step1header"><h3>%donate_interface-amount-legend% <span id="selected-amount"></span> <span class="mute" id="change-amount" style="display: none;">(<a href="#">%donate_interface-change%</a>)</span></h3></div>
 46+ <div id="step1wrapper" style="display: none;">
 47+ <div id="amtErrorMessages" class="small"></div>
 48+ <table id="amount-table-white">
 49+ <tr>
 50+ <td><label><input id="amountRadio0" type="radio" name="amountRadio" value="5" /> <span id="amountSpan0">5</span></label></td>
 51+ <td><label><input id="amountRadio1" type="radio" name="amountRadio" value="10" /> <span id="amountSpan1">10</span></label></td>
 52+ <td><label><input id="amountRadio2" type="radio" name="amountRadio" value="20" /> <span id="amountSpan2">20</span></label></td>
 53+ <td><label><input id="amountRadio3" type="radio" name="amountRadio" value="50" /> <span id="amountSpan3">50</span></label></td>
 54+ </tr>
 55+ <tr>
 56+ <td><label><input id="amountRadio4" type="radio" name="amountRadio" value="75" /> <span id="amountSpan4">75</span></label></td>
 57+ <td><label><input id="amountRadio5" type="radio" name="amountRadio" value="100" /> <span id="amountSpan5">100</span></label></td>
 58+ <td><label><input id="amountRadio6" type="radio" name="amountRadio" value="250" /> <span id="amountSpan6">250</span></label></td>
 59+ <td><input type="radio" name="amountRadio" id="input_amount_other" value="other" /> <label><span id="amountSpanOther"></span><input type="text" class="txt-sm hint" name="amountGiven" size="4" id="other-amount" title="%donate_interface-other%" placeholder="%donate_interface-other%" onfocus="this.form.input_amount_other.checked=true;"/></label></td>
 60+ </tr>
 61+ </table>
 62+ </div>
 63+ <div id="step2header"><h3>%donate_interface-billing-address% <span class="mute" id="change-billing" style="display: none;">(<a href="#">%donate_interface-change%</a>)</span></h3></div>
 64+ <div id="step2wrapper">
 65+ <div id="billing-content" class="gainlayout">
 66+ <div id="billingErrorMessages" class="small"></div>
 67+ <div id="paymentErrorMessages" class="small"></div>
 68+ <div class="name-fields">
 69+ <span class="name-first"><input class="txt" id="fname" name="fname" title="%donate_interface-donor-fname%" value="@fname" placeholder="%donate_interface-donor-fname%"/></span>
 70+ <span class="name-last"><input class="txt" id="lname" name="lname" title="%donate_interface-donor-lname%" value="@lname" placeholder="%donate_interface-donor-lname%"/></span>
 71+ </div>
 72+ <div class="loc-fields nostate">
 73+ <span class="loc-street"><input class="txt" id="street" name="street" title="%donate_interface-donor-street%" value="@street" placeholder="%donate_interface-donor-street%"/></span>
 74+ <span class="loc-postal"><input class="txt" id="zip" name="zip" title="%donate_interface-donor-postal%" value="@zip" placeholder="%donate_interface-donor-postal%"/></span>
 75+ <span class="loc-city"><input class="txt" id="city" name="city" title="%donate_interface-donor-city%" value="@city" placeholder="%donate_interface-donor-city%"/></span>
 76+ <span class="loc-country">
 77+ <select class="txt" id="country" name="country" value="@country" placeholder="%donate_interface-country%">
 78+ <option value="">%donate_interface-select-country%</option>
 79+ <option value="AT">%donate_interface-country-dropdown-AT%</option>
 80+ </select>
 81+ </span>
 82+ </div>
 83+ <p><input class="txt" title="%donate_interface-donor-email%" id="emailAdd" name="emailAdd" value="@emailAdd" placeholder="%donate_interface-donor-email%"/> </p>
 84+
 85+ <div id="ddheader"><h3>%donate_interface-cc-form-header-payment%</h3></div>
 86+ <div class="dd-fields">
 87+ <span class="dd-at-accountname"><input class="txt" title="%donate_interface-dd-account_name%" id="account_name" name="account_name" value="@account_name" placeholder="%donate_interface-dd-account_name%" maxlength="30"/></span>
 88+ <span class="dd-at-an"><input class="txt" title="%donate_interface-dd-account_number%" id="account_number" name="account_number" value="@account_number" placeholder="%donate_interface-dd-account_number%" maxlength="12"/></span>
 89+ <span class="dd-at-bc"><input class="txt" title="%donate_interface-dd-bank_code%" id="bank_code" name="bank_code" value="@bank_code" placeholder="%donate_interface-dd-bank_code%" maxlength="12"/></span>
 90+ </div>
 91+
 92+ <div id="bt-continue" style="margin-top: 10px;"> <input class="btn" id="bt-continueBtn" type="button" value="%donate_interface-continue%" /></div>
 93+ </div>
 94+ </div>
 95+
 96+
 97+
 98+ <input type="hidden" name="returnto" value="Thank_You/@language" />
 99+ <input type="hidden" value="0" name="PaypalRedirect" id="PaypalRedirect">
 100+
 101+ <input type="hidden" value="@amount" name="amount" />
 102+ <!--<input type="hidden" value="@country" name="country" id="country" /> -->
 103+ <input type="hidden" value="EUR" name="currency_code" />
 104+ <input type="hidden" value="@utm_source" name="utm_source"/>
 105+ <input type="hidden" value="@utm_medium" name="utm_medium"/>
 106+ <input type="hidden" value="@utm_campaign" name="utm_campaign"/>
 107+ <input type="hidden" value="@language" name="language"/>
 108+ <input type="hidden" value="@referrer" name="referrer"/>
 109+ <input type="hidden" value="@comment" name="comment"/>
 110+ <input type="hidden" value="@comment-option" name="comment-option"/>
 111+ <input type="hidden" value="1" name="email-opt"/>
 112+ <input type="hidden" value="@token" name="token"/>
 113+ <input type="hidden" value="@order_id" name="order_id"/>
 114+ <input type="hidden" value="@numAttempt" name="numAttempt"/>
 115+ <input type="hidden" value="@contribution_tracking_id" name="contribution_tracking_id"/>
 116+ <input type="hidden" value="@data_hash" name="data_hash"/>
 117+ <input type="hidden" value="@owa_session" name="owa_session"/>
 118+ <input type="hidden" value="@owa_ref" name="owa_ref"/>
 119+ <!-- new required fields -->
 120+ <input type="hidden" value="@gateway" name="gateway"/>
 121+ <!-- required fields for bt and dd -->
 122+ <input type="hidden" value="dd" name="payment_method"/>
 123+ <input type="hidden" value="dd_be" name="payment_submethod"/>
 124+ <!-- required fields omitted above -->
 125+ <input type="hidden" value="XX" name="state"/>
 126+ </form>
 127+ <div id="where-content">
 128+ {{LanguageSwitch|2011FR/core-appeal-whitebox-nodiv|@language}}
 129+ </div>
 130+ </div>
 131+ </div>
 132+ <p id="informationsharing">%donate_interface-informationsharing|url%</p>
 133+ <table>
 134+ <tr>
 135+ <td>
 136+ <ul id="moreinfolinks">
 137+ <li><a href="http://wikimediafoundation.org/wiki/Special:LandingCheck?landing_page=Monthly_donations&language=@language&uselang=@language&country=@country">%donate_interface-monthly-donation%</a></li>
 138+ <li><a href="http://wikimediafoundation.org/wiki/Special:LandingCheck?landing_page=Ways_to_Give&language=@language&uselang=@language&country=@country">%donate_interface-otherways-short%</a></li>
 139+ <li><a href="http://wikimediafoundation.org/wiki/Special:LandingCheck?landing_page=FAQ&language=@language&uselang=@language&country=@country">%donate_interface-faqs%</a></li>
 140+ <li><a href="http://wikimediafoundation.org/wiki/Special:LandingCheck?landing_page=Tax_Deductibility&language=@language&uselang=@language&country=@country">%donate_interface-tax-info%</a></li>
 141+ </ul>
 142+ </td>
 143+ <td>@verisign_logo</td>
 144+ </tr>
 145+ </table>
 146+ </div>
 147+ </td>
 148+ </tr>
 149+ </table>
 150+
 151+
 152+
 153+</div>
 154+
 155+<!-- Wikimedia Project logo
 156+<li id="footer-copyrightico"><a href="https://www.mediawiki.org//wikimediafoundation.org/"><img src="//bits.wikimedia.org/images/wikimedia-button.png" width="88" height="31" alt="Wikimedia Foundation"/></a></li>
 157+ -->
Property changes on: trunk/extensions/DonationInterface/globalcollect_gateway/forms/html/dd/dd-AT.html
___________________________________________________________________
Added: svn:eol-style
1158 + native
Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/html/dd/dd-BE.html
@@ -0,0 +1,155 @@
 2+<script type="text/javascript">
 3+ mw.loader.load('gc.form.rapidhtml.webitects.bt');
 4+ // these must go through RapidHTML and thus are inline
 5+ var amountErrors = ["#general|escape",'#retryMsg|escape','#amount|escape'];
 6+ var billingErrors = ['#fname|escape','#lname|escape','#city|escape','#country|escape','#street|escape','#state|escape','#zip|escape','#emailAdd|escape'];
 7+ var paymentErrors = ['#card_num|escape','#card_type|escape','#cvv|escape'];
 8+ var actionURL = "@action";
 9+ var scriptPath = "@script_path";
 10+</script>
 11+<!--[if lt IE 7]>
 12+<script type="text/javascript">
 13+ mw.loader.load('gc.form.rapidhtml.webitects.ie6');
 14+</script>
 15+<style type="text/css">
 16+ body{
 17+ behavior: url("@script_path/skins/vector/csshover.min.htc");
 18+ }
 19+</style><![endif]-->
 20+<!--[if IE 7]>
 21+<style>
 22+ .gainlayout {
 23+ zoom: 1;
 24+ height: 1%;
 25+ }
 26+</style>
 27+<![endif]-->
 28+
 29+<div class="ltr">
 30+ <table id="layouttable">
 31+ <tr>
 32+ <td>
 33+ <div id="appeal">
 34+ <div id="appeal-content">
 35+ <h2 id="appeal-head"> <span class="mw-headline">{{LanguageSwitch|2011FR/@appeal/title|@language}}</span></h2>
 36+ <div id="appeal-body" class="plainlinks">{{LanguageSwitch|2011FR/@appeal/text|@language}}</div>
 37+ </div>
 38+ </div>
 39+ </td>
 40+ <td>
 41+ <div id="donate">
 42+ <div id="donate-content">
 43+ <div id="donate-body" style="padding: 0 1em;">
 44+ <form method="post" name="paypalcontribution">
 45+ <div id="step1header"><h3>%donate_interface-amount-legend% <span id="selected-amount"></span> <span class="mute" id="change-amount" style="display: none;">(<a href="#">%donate_interface-change%</a>)</span></h3></div>
 46+ <div id="step1wrapper" style="display: none;">
 47+ <div id="amtErrorMessages" class="small"></div>
 48+ <table id="amount-table-white">
 49+ <tr>
 50+ <td><label><input id="amountRadio0" type="radio" name="amountRadio" value="5" /> <span id="amountSpan0">5</span></label></td>
 51+ <td><label><input id="amountRadio1" type="radio" name="amountRadio" value="10" /> <span id="amountSpan1">10</span></label></td>
 52+ <td><label><input id="amountRadio2" type="radio" name="amountRadio" value="20" /> <span id="amountSpan2">20</span></label></td>
 53+ <td><label><input id="amountRadio3" type="radio" name="amountRadio" value="50" /> <span id="amountSpan3">50</span></label></td>
 54+ </tr>
 55+ <tr>
 56+ <td><label><input id="amountRadio4" type="radio" name="amountRadio" value="75" /> <span id="amountSpan4">75</span></label></td>
 57+ <td><label><input id="amountRadio5" type="radio" name="amountRadio" value="100" /> <span id="amountSpan5">100</span></label></td>
 58+ <td><label><input id="amountRadio6" type="radio" name="amountRadio" value="250" /> <span id="amountSpan6">250</span></label></td>
 59+ <td><input type="radio" name="amountRadio" id="input_amount_other" value="other" /> <label><span id="amountSpanOther"></span><input type="text" class="txt-sm hint" name="amountGiven" size="4" id="other-amount" title="%donate_interface-other%" placeholder="%donate_interface-other%" onfocus="this.form.input_amount_other.checked=true;"/></label></td>
 60+ </tr>
 61+ </table>
 62+ </div>
 63+ <div id="step2header"><h3>%donate_interface-billing-address% <span class="mute" id="change-billing" style="display: none;">(<a href="#">%donate_interface-change%</a>)</span></h3></div>
 64+ <div id="step2wrapper">
 65+ <div id="billing-content" class="gainlayout">
 66+ <div id="billingErrorMessages" class="small"></div>
 67+ <div id="paymentErrorMessages" class="small"></div>
 68+ <div class="name-fields">
 69+ <span class="name-first"><input class="txt" id="fname" name="fname" title="%donate_interface-donor-fname%" value="@fname" placeholder="%donate_interface-donor-fname%"/></span>
 70+ <span class="name-last"><input class="txt" id="lname" name="lname" title="%donate_interface-donor-lname%" value="@lname" placeholder="%donate_interface-donor-lname%"/></span>
 71+ </div>
 72+ <div class="loc-fields nostate">
 73+ <span class="loc-street"><input class="txt" id="street" name="street" title="%donate_interface-donor-street%" value="@street" placeholder="%donate_interface-donor-street%"/></span>
 74+ <span class="loc-postal"><input class="txt" id="zip" name="zip" title="%donate_interface-donor-postal%" value="@zip" placeholder="%donate_interface-donor-postal%"/></span>
 75+ <span class="loc-city"><input class="txt" id="city" name="city" title="%donate_interface-donor-city%" value="@city" placeholder="%donate_interface-donor-city%"/></span>
 76+ <span class="loc-country">
 77+ <select class="txt" id="country" name="country" value="@country" placeholder="%donate_interface-country%">
 78+ <option value="">%donate_interface-select-country%</option>
 79+ <option value="BE">%donate_interface-country-dropdown-BE%</option>
 80+ </select>
 81+ </span>
 82+ </div>
 83+ <p><input class="txt" title="%donate_interface-donor-email%" id="emailAdd" name="emailAdd" value="@emailAdd" placeholder="%donate_interface-donor-email%"/> </p>
 84+
 85+ <div id="ddheader"><h3>%donate_interface-cc-form-header-payment%</h3></div>
 86+ <div class="dd-fields">
 87+ <span class="dd-be-an"><input class="txt" title="%donate_interface-dd-account_number%" id="account_number" name="account_number" value="@account_number" placeholder="%donate_interface-dd-account_number%" maxlength="12"/></span>
 88+ <span class="dd-be-ai"><input class="txt" title="%donate_interface-dd-authorization_id%" id="authorization_id" name="authorization_id" value="@authorization_id" placeholder="%donate_interface-dd-authorization_id%" maxlength="12"/></span>
 89+ </div>
 90+
 91+ <div id="bt-continue" style="margin-top: 10px;"> <input class="btn" id="bt-continueBtn" type="button" value="%donate_interface-continue%" /></div>
 92+ </div>
 93+ </div>
 94+
 95+
 96+
 97+ <input type="hidden" name="returnto" value="Thank_You/@language" />
 98+ <input type="hidden" value="0" name="PaypalRedirect" id="PaypalRedirect">
 99+
 100+ <input type="hidden" value="@amount" name="amount" />
 101+ <!--<input type="hidden" value="@country" name="country" id="country" /> -->
 102+ <input type="hidden" value="EUR" name="currency_code" />
 103+ <input type="hidden" value="@utm_source" name="utm_source"/>
 104+ <input type="hidden" value="@utm_medium" name="utm_medium"/>
 105+ <input type="hidden" value="@utm_campaign" name="utm_campaign"/>
 106+ <input type="hidden" value="@language" name="language"/>
 107+ <input type="hidden" value="@referrer" name="referrer"/>
 108+ <input type="hidden" value="@comment" name="comment"/>
 109+ <input type="hidden" value="@comment-option" name="comment-option"/>
 110+ <input type="hidden" value="1" name="email-opt"/>
 111+ <input type="hidden" value="@token" name="token"/>
 112+ <input type="hidden" value="@order_id" name="order_id"/>
 113+ <input type="hidden" value="@numAttempt" name="numAttempt"/>
 114+ <input type="hidden" value="@contribution_tracking_id" name="contribution_tracking_id"/>
 115+ <input type="hidden" value="@data_hash" name="data_hash"/>
 116+ <input type="hidden" value="@owa_session" name="owa_session"/>
 117+ <input type="hidden" value="@owa_ref" name="owa_ref"/>
 118+ <!-- new required fields -->
 119+ <input type="hidden" value="@gateway" name="gateway"/>
 120+ <!-- required fields for bt and dd -->
 121+ <input type="hidden" value="dd" name="payment_method"/>
 122+ <input type="hidden" value="dd_be" name="payment_submethod"/>
 123+ <!-- required fields omitted above -->
 124+ <input type="hidden" value="XX" name="state"/>
 125+ </form>
 126+ <div id="where-content">
 127+ {{LanguageSwitch|2011FR/core-appeal-whitebox-nodiv|@language}}
 128+ </div>
 129+ </div>
 130+ </div>
 131+ <p id="informationsharing">%donate_interface-informationsharing|url%</p>
 132+ <table>
 133+ <tr>
 134+ <td>
 135+ <ul id="moreinfolinks">
 136+ <li><a href="http://wikimediafoundation.org/wiki/Special:LandingCheck?landing_page=Monthly_donations&language=@language&uselang=@language&country=@country">%donate_interface-monthly-donation%</a></li>
 137+ <li><a href="http://wikimediafoundation.org/wiki/Special:LandingCheck?landing_page=Ways_to_Give&language=@language&uselang=@language&country=@country">%donate_interface-otherways-short%</a></li>
 138+ <li><a href="http://wikimediafoundation.org/wiki/Special:LandingCheck?landing_page=FAQ&language=@language&uselang=@language&country=@country">%donate_interface-faqs%</a></li>
 139+ <li><a href="http://wikimediafoundation.org/wiki/Special:LandingCheck?landing_page=Tax_Deductibility&language=@language&uselang=@language&country=@country">%donate_interface-tax-info%</a></li>
 140+ </ul>
 141+ </td>
 142+ <td>@verisign_logo</td>
 143+ </tr>
 144+ </table>
 145+ </div>
 146+ </td>
 147+ </tr>
 148+ </table>
 149+
 150+
 151+
 152+</div>
 153+
 154+<!-- Wikimedia Project logo
 155+<li id="footer-copyrightico"><a href="https://www.mediawiki.org//wikimediafoundation.org/"><img src="//bits.wikimedia.org/images/wikimedia-button.png" width="88" height="31" alt="Wikimedia Foundation"/></a></li>
 156+ -->
Property changes on: trunk/extensions/DonationInterface/globalcollect_gateway/forms/html/dd/dd-BE.html
___________________________________________________________________
Added: svn:eol-style
1157 + native

Follow-up revisions

RevisionCommit summaryAuthorDate
r103052MFT r102807, r102942, r102953, r102960, r102961, r102943, r103009, r103023, r...awjrichards22:17, 14 November 2011

Status & tagging log