Index: trunk/extensions/ContributionTracking/ContributionTracking_body.php |
— | — | @@ -39,7 +39,7 @@ |
40 | 40 | 'owa_ref' => $wgRequest->getVal( 'owa_ref', null ), |
41 | 41 | //'ts' => $ts, |
42 | 42 | ); |
43 | | - $contribution_tracking_id = ContributionTrackingProcessor::saveNewContribution( $tracked_contribution ); |
| 43 | + #$contribution_tracking_id = ContributionTrackingProcessor::saveNewContribution( $tracked_contribution ); |
44 | 44 | } |
45 | 45 | |
46 | 46 | $params = array( |
— | — | @@ -55,6 +55,7 @@ |
56 | 56 | 'state' => $wgRequest->getText( 'state', null ), |
57 | 57 | 'zip' => $wgRequest->getText( 'zip', null ), |
58 | 58 | 'country' => $wgRequest->getText( 'country', null ), |
| 59 | + 'address_override' => $wgRequest->getText( 'address_override', '0' ), |
59 | 60 | 'recurring_paypal' => $wgRequest->getText( 'recurring_paypal' ), |
60 | 61 | 'amount' => $wgRequest->getVal( 'amount' ), |
61 | 62 | 'amount_given' => $wgRequest->getVal( 'amountGiven' ), |
Index: trunk/extensions/ContributionTracking/ContributionTracking.processor.php |
— | — | @@ -253,7 +253,14 @@ |
254 | 254 | 'amount_given' => '', |
255 | 255 | 'contribution_tracking_id' => '', |
256 | 256 | 'notify_url' => '', |
257 | | - 'item_name' => '' |
| 257 | + 'item_name' => '', |
| 258 | + 'address1' => '', |
| 259 | + 'city' => '', |
| 260 | + 'state' => '', |
| 261 | + 'zip' => '', |
| 262 | + 'country' => 'US', |
| 263 | + 'address_override' => '0' |
| 264 | + |
258 | 265 | ); |
259 | 266 | } |
260 | 267 | |
— | — | @@ -329,7 +336,7 @@ |
330 | 337 | $repost['fields']['return'] = $returnto; |
331 | 338 | $repost['fields']['currency_code'] = $input['currency_code']; |
332 | 339 | |
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 |
334 | 341 | if ( array_key_exists( 'fname', $input ) && !empty( $input['fname'] ) ) { |
335 | 342 | $repost['fields']['first_name'] = $input['fname']; |
336 | 343 | } |
— | — | @@ -340,6 +347,32 @@ |
341 | 348 | $repost['fields']['email'] = $input['email']; |
342 | 349 | } |
343 | 350 | |
| 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 | + |
344 | 377 | // if this is a recurring donation, we have add'l fields to send to paypal |
345 | 378 | if ( $input['recurring_paypal'] && $input['recurring_paypal'] != 0 ) { |
346 | 379 | |