http://www.mediawiki.org/wiki/Special:Code/MediaWiki/95917
Revision: 95917
Author: jamesur
Date: 2011-08-31 23:11:43 +0000 (Wed, 31 Aug 2011)
Log Message:
-----------
adding address_override for paypal if wanted and adding new fields to processor
(followup from r95908)
Modified Paths:
--------------
trunk/extensions/ContributionTracking/ContributionTracking.processor.php
trunk/extensions/ContributionTracking/ContributionTracking_body.php
Modified:
trunk/extensions/ContributionTracking/ContributionTracking.processor.php
===================================================================
--- trunk/extensions/ContributionTracking/ContributionTracking.processor.php
2011-08-31 23:04:30 UTC (rev 95916)
+++ trunk/extensions/ContributionTracking/ContributionTracking.processor.php
2011-08-31 23:11:43 UTC (rev 95917)
@@ -253,7 +253,14 @@
'amount_given' => '',
'contribution_tracking_id' => '',
'notify_url' => '',
- 'item_name' => ''
+ 'item_name' => '',
+ 'address1' => '',
+ 'city' => '',
+ 'state' => '',
+ 'zip' => '',
+ 'country' => 'US',
+ 'address_override' => '0'
+
);
}
@@ -329,7 +336,7 @@
$repost['fields']['return'] = $returnto;
$repost['fields']['currency_code'] =
$input['currency_code'];
- // additional fields to pass to PayPal from single-step
credit card form
+ // additional fields to pass to PayPal from single-step
credit card form and 1st step with address fields
if ( array_key_exists( 'fname', $input ) && !empty(
$input['fname'] ) ) {
$repost['fields']['first_name'] =
$input['fname'];
}
@@ -340,6 +347,32 @@
$repost['fields']['email'] = $input['email'];
}
+ if ( array_key_exists( 'address1', $input ) && !empty(
$input['address1'] ) ) {
+ $repost['fields']['address1'] =
$input['address1'];
+ }
+
+ if ( array_key_exists( 'city', $input ) && !empty(
$input['city'] ) ) {
+ $repost['fields']['city'] = $input['city'];
+ }
+
+ if ( array_key_exists( 'state', $input ) && !empty(
$input['state'] ) ) {
+ $repost['fields']['state'] = $input['state'];
+ }
+
+ if ( array_key_exists( 'zip', $input ) && !empty(
$input['zip'] ) ) {
+ $repost['fields']['zip'] = $input['zip'];
+ }
+
+
+ if ( array_key_exists( 'country', $input ) && !empty(
$input['country'] ) ) {
+ $repost['fields']['country'] =
$input['country'];
+ }
+
+ if ( array_key_exists( 'address_override', $input ) &&
!empty( $input['address_override'] ) ) {
+ $repost['fields']['address_override'] =
$input['address_override'];
+ }
+
+
// if this is a recurring donation, we have add'l
fields to send to paypal
if ( $input['recurring_paypal'] &&
$input['recurring_paypal'] != 0 ) {
Modified: trunk/extensions/ContributionTracking/ContributionTracking_body.php
===================================================================
--- trunk/extensions/ContributionTracking/ContributionTracking_body.php
2011-08-31 23:04:30 UTC (rev 95916)
+++ trunk/extensions/ContributionTracking/ContributionTracking_body.php
2011-08-31 23:11:43 UTC (rev 95917)
@@ -39,7 +39,7 @@
'owa_ref' => $wgRequest->getVal( 'owa_ref',
null ),
//'ts' => $ts,
);
- $contribution_tracking_id =
ContributionTrackingProcessor::saveNewContribution( $tracked_contribution );
+ #$contribution_tracking_id =
ContributionTrackingProcessor::saveNewContribution( $tracked_contribution );
}
$params = array(
@@ -55,6 +55,7 @@
'state' => $wgRequest->getText( 'state', null ),
'zip' => $wgRequest->getText( 'zip', null ),
'country' => $wgRequest->getText( 'country', null ),
+ 'address_override' => $wgRequest->getText(
'address_override', '0' ),
'recurring_paypal' => $wgRequest->getText(
'recurring_paypal' ),
'amount' => $wgRequest->getVal( 'amount' ),
'amount_given' => $wgRequest->getVal( 'amountGiven' ),
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs