r101102 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101101‎ | r101102 | r101103 >
Date:00:49, 28 October 2011
Author:awjrichards
Status:deferred
Tags:
Comment:
Modified paths:
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/DonationData.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/donation.api.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects_2_3step.js (modified) (history)

Diff [purge]

Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects_2_3step.js
@@ -140,7 +140,7 @@
141141 showStep3(); // Open the 3rd section
142142 var language = 'en'; // default value is English
143143 var matches = document.location.href.match(/uselang=(\w+)/i); // fine the real language
144 - if ( matches[1] ) {
 144+ if ( matches && matches[1] ) {
145145 language = matches[1];
146146 }
147147 var sendData = {
@@ -162,26 +162,28 @@
163163 'format': 'json'
164164 };
165165 $.ajax( {
166 - 'url': mw.util.wikiScript( 'api' ),
 166+ 'url': mw.config.get( 'wgServer' ) + mw.config.get( 'wgScriptPath' ) + '/api.php?',
167167 'data': sendData,
168168 'dataType': 'json',
169169 'type': 'GET',
170170 'success': function( data ) {
171 - if ( data.result.errors ) {
172 - var errors = new Array();
173 - $.each( data.result.errors, function( index, value ) {
174 - alert( value ); // Show them the error
175 - $( "#paymentContinue" ).show(); // Show continue button in 2nd section
176 - showStep2(); // Switch back to 2nd section of form
177 - } );
178 - } else {
179 - if ( data.result.formaction ) {
180 - $( '#payment' ).empty();
181 - // Insert the iframe into the form
182 - $( '#payment' ).append(
183 - '<iframe src="'+data.result.formaction+'" width="318" height="300" frameborder="0"></iframe>'
184 - );
185 -
 171+ if ( typeof data.result !== 'undefined' ) {
 172+ if ( data.result.errors ) {
 173+ var errors = new Array();
 174+ $.each( data.result.errors, function( index, value ) {
 175+ alert( value ); // Show them the error
 176+ $( "#paymentContinue" ).show(); // Show continue button in 2nd section
 177+ showStep2(); // Switch back to 2nd section of form
 178+ } );
 179+ } else {
 180+ if ( data.result.formaction ) {
 181+ $( '#payment' ).empty();
 182+ // Insert the iframe into the form
 183+ $( '#payment' ).append(
 184+ '<iframe src="'+data.result.formaction+'" width="318" height="300" frameborder="0"></iframe>'
 185+ );
 186+
 187+ }
186188 }
187189 }
188190 }
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/donation.api.php
@@ -21,6 +21,7 @@
2222 }
2323
2424 $method = $this->donationData['payment_method'];
 25+ $submethod = $this->donationData['payment_submethod'];
2526
2627 if ( $this->gateway == 'payflowpro' ) {
2728 $gatewayObj = new PayflowProAdapter();
@@ -78,6 +79,10 @@
7980 $this->getResult()->addValue( 'data', 'result', $result );
8081 */
8182 }
 83+
 84+ public function isReadMode() {
 85+ return false;
 86+ }
8287
8388 public function getAllowedParams() {
8489 return array(
@@ -99,6 +104,7 @@
100105 'expiration' => $this->defineParam( false ),
101106 'cvv' => $this->defineParam( false ),
102107 'payment_method' => $this->defineParam( false ),
 108+ 'payment_submethod' => $this->defineParam( false ),
103109 'language' => $this->defineParam( false ),
104110 'order_id' => $this->defineParam( false ),
105111 );
@@ -161,6 +167,7 @@
162168 'expiration' => 'Expiration date',
163169 'cvv' => 'CVV security code',
164170 'payment_method' => 'Payment method to use',
 171+ 'payment_submethod' => 'Payment submethod to use',
165172 'language' => 'Language code',
166173 'order_id' => 'Order ID (if a donation has already been started)',
167174 );
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/DonationData.php
@@ -92,7 +92,13 @@
9393 $this->normalizeAndSanitize();
9494
9595 //TODO: test with _cache_ on.
96 - if ( !empty( $this->normalized ) && ( $this->getVal( 'numAttempt' ) == '0' && ((!$this->getVal( 'utm_source_id' ) == false ) || is_null($this->getVal( '_cache_' )) ) ) ) {
 96+// if ( !empty( $this->normalized ) &&
 97+// ( $this->getVal( 'numAttempt' ) == '0' &&
 98+// ((!$this->getVal( 'utm_source_id' ) == false ) ||
 99+// is_null($this->getVal( '_cache_' )) ) ) ) {
 100+// error_log('about to save contribution tracking from an initial populate: ' . $this->getVal('contribution_tracking_id'));
 101+
 102+ if (!$this->isSomething( 'contribution_tracking_id' )){
97103 $this->saveContributionTracking();
98104 }
99105 }
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface
___________________________________________________________________
Modified: svn:mergeinfo
100106 Merged /trunk/extensions/DonationInterface:r101056,101071-101072,101099

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r101056using safer js for webitects formkaldari21:17, 27 October 2011
r101071some AJAX/API fixes for globalcollectkaldari21:56, 27 October 2011
r101072false, not truekaldari22:05, 27 October 2011
r101099Temporary fix so ContributionTracking stops leaking numbers in DonationData.khorn00:26, 28 October 2011

Status & tagging log