r71058 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71057‎ | r71058 | r71059 >
Date:01:37, 14 August 2010
Author:awjrichards
Status:ok
Tags:
Comment:
Fixed country insertion into minfraud query\nFixed typo in method call ->fnpayflowGenerateFormBody to ->fnPayflowGenerateFormBody
Modified paths:
  • /trunk/extensions/DonationInterface/payflowpro_gateway/extras/minfraud/minfraud.php (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php
@@ -231,7 +231,7 @@
232232 global $wgOut, $wgLang, $wgWikipediaForeverTheme;
233233
234234 // save contrib tracking id early to track abondonment
235 - if ( $data[ 'numAttempt' ] == 0 ) {
 235+ if ( $data[ 'numAttempt' ] == '0' ) {
236236 if ( !$tracked = $this->fnPayflowSaveContributionTracking( $data ) ) {
237237 $when = time();
238238 wfDebugLog( 'payflowpro_gateway', 'Unable to save data to the contribution_tracking table ' . $when );
@@ -477,7 +477,7 @@
478478 */
479479 public function fnPayflowDisplayForm( $data, &$error ) {
480480 global $wgOut;
481 - $form = $this->fnpayflowGenerateFormBody( &$data, &$error );
 481+ $form = $this->fnPayflowGenerateFormBody( &$data, &$error );
482482 $form .= $this->fnPayflowGenerateFormSubmit( &$data, &$error );
483483 $wgOut->addHTML( $form );
484484 }
Index: trunk/extensions/DonationInterface/payflowpro_gateway/extras/minfraud/minfraud.php
@@ -18,6 +18,7 @@
1919
2020 $dir = dirname( __FILE__ ) . "/";
2121 require_once( $dir . "../extras.php" );
 22+require_once( $dir . "../../includes/countryCodes.inc" );
2223 class PayflowProGateway_Extras_MinFraud extends PayflowProGateway_Extras {
2324
2425 /**
@@ -175,6 +176,9 @@
176177 // user's user agent
177178 $minfraud_hash[ "user_agent" ] = $_SERVER[ 'HTTP_USER_AGENT' ];
178179
 180+ // fetch the array of country codes
 181+ $country_codes = countryCodes();
 182+
179183 // loop through the map and add pertinent values from $data to the hash
180184 foreach ( $map as $key => $value ) {
181185
@@ -186,6 +190,9 @@
187191 case "bin": // get just the first 6 digits from CC#
188192 $newdata[ $value ] = substr( $data[ $value ], 0, 6 );
189193 break;
 194+ case "country":
 195+ $newdata[ $value ] = $country_codes[ $data[ $value ]];
 196+ break;
190197 default:
191198 $newdata[ $value ] = $data[ $value ];
192199 }

Status & tagging log