r100401 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100400‎ | r100401 | r100402 >
Date:01:00, 21 October 2011
Author:kaldari
Status:ok
Tags:fundraising 
Comment:
very basic working webitects form with globalcollect iframe insertion
Modified paths:
  • /trunk/extensions/DonationInterface/globalcollect_gateway/forms/html/webitects_2_3step.html (modified) (history)
  • /trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects_2_3step.js (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/html/webitects_2_3step.html
@@ -141,62 +141,7 @@
142142 </div>
143143 <div id="step3header"><h3>Payment Information <span class="mute" id="change-payment" style="display: none;">(<a href="#">Change</a>)</span></h3></div>
144144 <div id="step3wrapper" style="display: none;">
145 - <div id="payment" class="gainlayout">
146 - <div id="paymentErrorMessages" class="small"></div>
147 - <dl class="form">
148 - <dt><span class="label"><label for="card_num">Card number</label></span></dt>
149 - <dd class="field"><input class="txt" id="card_num" name="card_num" value="@card_num"/></dd>
150 -
151 - <dt></dt>
152 - <dd class="field">
153 - <div class="l" style="margin-right: 5%;">
154 - <span class="label">Expiration date</span>
155 - <select id="mos" name="mos">
156 - <option value="">Month</option>
157 - <option value="01">01 - January</option>
158 - <option value="02">02 - February</option>
159 - <option value="03">03 - March</option>
160 - <option value="04">04 - April</option>
161 - <option value="05">05 - May</option>
162 - <option value="06">06 - June</option>
163 - <option value="07">07 - July</option>
164 - <option value="08">08 - August</option>
165 - <option value="09">09 - September</option>
166 - <option value="10">10 - October</option>
167 - <option value="11">11 - November</option>
168 - <option value="12">12 - December</option>
169 - </select>
170 -
171 - <select id="year" name="year">
172 - <option value="">Year</option>
173 - <option value="2011">2011</option>
174 - <option value="2012">2012</option>
175 - <option value="2013">2013</option>
176 - <option value="2014">2014</option>
177 - <option value="2015">2015</option>
178 - <option value="2016">2016</option>
179 - <option value="2017">2017</option>
180 - <option value="2018">2018</option>
181 - <option value="2019">2019</option>
182 - <option value="2020">2020</option>
183 - </select>
184 - </div>
185 - <div class="l">
186 - <label class="label" for="cvv">Security code</label>
187 - <input class="txt-sm" id="cvv" name="cvv" value="@cvv"/>
188 - <a class="mute" href="#" id="where">Where?</a>
189 - </div>
190 -
191 - <div class="clear" id="codes" style="display: none;"><img alt="Security codes" src="@script_path/extensions/DonationInterface/gateway_forms/includes/security-code.png" /></div>
192 - </dd>
193 -
194 - <dt></dt>
195 - <dd class="field">
196 - <input id="submitcreditcard" class="btn" type="button" value="Submit donation" />
197 - <p class="mute"><img alt="" src="@script_path/extensions/DonationInterface/gateway_forms/includes/padlock.gif" /> Your credit card will be securely processed.</p>
198 - </dd>
199 - </dl>
200 - </div>
 145+ <div id="payment" class="gainlayout" style="height:300px;text-align:center;"></div>
201146 </div>
202147
203148 <input type="hidden" name="gateway" value="payflowpro" id="gateway" />
Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects_2_3step.js
@@ -84,8 +84,12 @@
8585 // Set the cards to progress to step 3
8686 $( ".cardradio" ).live( "click", function() {
8787 if ( validate_personal( document.paypalcontribution ) ) {
88 - var language = 'en'; // default value
89 - var matches = document.location.href.match(/uselang=(\w+)/i);
 88+ $( '#payment' ).empty();
 89+ // Load wait spinner
 90+ $( '#payment' ).append( '<br/><br/><br/><img alt="loading" src="'+mw.config.get( 'wgScriptPath' )+'/extensions/DonationInterface/gateway_forms/includes/loading-white.gif" />' );
 91+ showStep3(); // Open the 3rd section
 92+ var language = 'en'; // default value is English
 93+ var matches = document.location.href.match(/uselang=(\w+)/i); // fine the real language
9094 if ( matches[1] ) {
9195 language = matches[1];
9296 }
@@ -120,9 +124,13 @@
121125 alert( value );
122126 } );
123127 } else {
124 - if ( data.result.returnurl ) {
 128+ if ( data.result.formaction ) {
 129+ $( '#payment' ).empty();
125130 // Insert the iframe into the form
126 - showStep3();
 131+ $( '#payment' ).append(
 132+ '<iframe src="'+data.result.formaction+'" width="318" height="300" frameborder="0"></iframe>'
 133+ );
 134+
127135 }
128136 }
129137 }

Status & tagging log