r95917 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95916‎ | r95917 | r95918 >
Date:23:11, 31 August 2011
Author:jamesur
Status:resolved (Comments)
Tags:
Comment:
adding address_override for paypal if wanted and adding new fields to processor (followup from r95908)
Modified paths:
  • /trunk/extensions/ContributionTracking/ContributionTracking.processor.php (modified) (history)
  • /trunk/extensions/ContributionTracking/ContributionTracking_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ContributionTracking/ContributionTracking_body.php
@@ -39,7 +39,7 @@
4040 'owa_ref' => $wgRequest->getVal( 'owa_ref', null ),
4141 //'ts' => $ts,
4242 );
43 - $contribution_tracking_id = ContributionTrackingProcessor::saveNewContribution( $tracked_contribution );
 43+ #$contribution_tracking_id = ContributionTrackingProcessor::saveNewContribution( $tracked_contribution );
4444 }
4545
4646 $params = array(
@@ -55,6 +55,7 @@
5656 'state' => $wgRequest->getText( 'state', null ),
5757 'zip' => $wgRequest->getText( 'zip', null ),
5858 'country' => $wgRequest->getText( 'country', null ),
 59+ 'address_override' => $wgRequest->getText( 'address_override', '0' ),
5960 'recurring_paypal' => $wgRequest->getText( 'recurring_paypal' ),
6061 'amount' => $wgRequest->getVal( 'amount' ),
6162 'amount_given' => $wgRequest->getVal( 'amountGiven' ),
Index: trunk/extensions/ContributionTracking/ContributionTracking.processor.php
@@ -253,7 +253,14 @@
254254 'amount_given' => '',
255255 'contribution_tracking_id' => '',
256256 'notify_url' => '',
257 - 'item_name' => ''
 257+ 'item_name' => '',
 258+ 'address1' => '',
 259+ 'city' => '',
 260+ 'state' => '',
 261+ 'zip' => '',
 262+ 'country' => 'US',
 263+ 'address_override' => '0'
 264+
258265 );
259266 }
260267
@@ -329,7 +336,7 @@
330337 $repost['fields']['return'] = $returnto;
331338 $repost['fields']['currency_code'] = $input['currency_code'];
332339
333 - // additional fields to pass to PayPal from single-step credit card form
 340+ // additional fields to pass to PayPal from single-step credit card form and 1st step with address fields
334341 if ( array_key_exists( 'fname', $input ) && !empty( $input['fname'] ) ) {
335342 $repost['fields']['first_name'] = $input['fname'];
336343 }
@@ -340,6 +347,32 @@
341348 $repost['fields']['email'] = $input['email'];
342349 }
343350
 351+ if ( array_key_exists( 'address1', $input ) && !empty( $input['address1'] ) ) {
 352+ $repost['fields']['address1'] = $input['address1'];
 353+ }
 354+
 355+ if ( array_key_exists( 'city', $input ) && !empty( $input['city'] ) ) {
 356+ $repost['fields']['city'] = $input['city'];
 357+ }
 358+
 359+ if ( array_key_exists( 'state', $input ) && !empty( $input['state'] ) ) {
 360+ $repost['fields']['state'] = $input['state'];
 361+ }
 362+
 363+ if ( array_key_exists( 'zip', $input ) && !empty( $input['zip'] ) ) {
 364+ $repost['fields']['zip'] = $input['zip'];
 365+ }
 366+
 367+
 368+ if ( array_key_exists( 'country', $input ) && !empty( $input['country'] ) ) {
 369+ $repost['fields']['country'] = $input['country'];
 370+ }
 371+
 372+ if ( array_key_exists( 'address_override', $input ) && !empty( $input['address_override'] ) ) {
 373+ $repost['fields']['address_override'] = $input['address_override'];
 374+ }
 375+
 376+
344377 // if this is a recurring donation, we have add'l fields to send to paypal
345378 if ( $input['recurring_paypal'] && $input['recurring_paypal'] != 0 ) {
346379

Follow-up revisions

RevisionCommit summaryAuthorDate
r95920uncommenting that had been commented out for testing (followup from r95908)jamesur23:14, 31 August 2011
r96037MFT r95917awjrichards20:35, 1 September 2011
r96038MFT r95908, r95917, r95920:awjrichards20:37, 1 September 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r95908adding address fields to allow testing new first step with fields being passe...jamesur20:38, 31 August 2011

Comments

#Comment by Awjrichards (talk | contribs)   23:13, 31 August 2011
-			$contribution_tracking_id = ContributionTrackingProcessor::saveNewContribution( $tracked_contribution );
+			#$contribution_tracking_id = ContributionTrackingProcessor::saveNewContribution( $tracked_contribution );<

No bueno :(

Status & tagging log