Index: branches/wmf/1.18wmf1/extensions/ContributionTracking/ContributionTracking_body.php |
— | — | @@ -76,7 +76,7 @@ |
77 | 77 | |
78 | 78 | $repost = ContributionTrackingProcessor::getRepostFields( $params ); |
79 | 79 | |
80 | | - $wgOut->addWikiText( "{{2009/Donate-banner/$language}}" ); |
| 80 | + #$wgOut->addWikiText( "{{2009/Donate-banner/$language}}" ); |
81 | 81 | $wgOut->addHTML( $this->msgWiki( 'contrib-tracking-submitting' ) ); |
82 | 82 | |
83 | 83 | // Output the repost form |
Property changes on: branches/wmf/1.18wmf1/extensions/ContributionTracking/ContributionTracking_body.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
84 | 84 | Merged /trunk/extensions/ContributionTracking/ContributionTracking_body.php:r103622,104210,104368,106136,106367 |
Index: branches/wmf/1.18wmf1/extensions/ContributionTracking/ContributionTracking.processor.php |
— | — | @@ -151,7 +151,7 @@ |
152 | 152 | |
153 | 153 | /** |
154 | 154 | * Effectively changes the name of a key in an array. If the key does not |
155 | | - * exist, no change is made. |
| 155 | + * exist, no change is made. |
156 | 156 | * @param array $array The array to rekey (by reference) |
157 | 157 | * @param string $oldkey The key to change |
158 | 158 | * @param string $newkey The new value for the key |
— | — | @@ -169,7 +169,7 @@ |
170 | 170 | * table. |
171 | 171 | * For these values, if the key exists (and is not explicit false), it is |
172 | 172 | * received as "true". Therefore, the rekey'd value should be false. |
173 | | - * However, the old key not existing isn't exactly conclusive. |
| 173 | + * However, the old key not existing isn't exactly conclusive. |
174 | 174 | * @param array $array The array to rekey (by reference) |
175 | 175 | * @param string $oldkey The key to change |
176 | 176 | * @param string $invertedkey The key meant to contain the inverted boolean |
— | — | @@ -255,12 +255,12 @@ |
256 | 256 | 'notify_url' => '', |
257 | 257 | 'item_name' => '', |
258 | 258 | 'address1' => '', |
259 | | - 'city' => '', |
| 259 | + 'city' => '', |
260 | 260 | 'state' => '', |
261 | 261 | 'zip' => '', |
262 | 262 | 'country' => 'US', |
263 | 263 | 'address_override' => '0' |
264 | | - |
| 264 | + |
265 | 265 | ); |
266 | 266 | } |
267 | 267 | |
— | — | @@ -301,7 +301,7 @@ |
302 | 302 | * gateway to complete the transaction. |
303 | 303 | */ |
304 | 304 | static function getRepostFields( $input ) { |
305 | | - global $wgContributionTrackingPayPalBusiness, $wgContributionTrackingReturnToURLDefault; |
| 305 | + global $wgContributionTrackingPayPalBusiness, $wgContributionTrackingReturnToURLDefault, $wgContributionTrackingRPPLength; |
306 | 306 | // Set the action and tracking ID fields |
307 | 307 | $input = ContributionTrackingProcessor::stage_repost( $input ); |
308 | 308 | |
— | — | @@ -331,7 +331,7 @@ |
332 | 332 | if ( $returnTitle ) { |
333 | 333 | $returnto = wfExpandUrl( $returnTitle->getFullUrl(), PROTO_CURRENT ); |
334 | 334 | } else { |
335 | | - $returnto = $wgContributionTrackingReturnToURLDefault . "/$language"; |
| 335 | + $returnto = $wgContributionTrackingReturnToURLDefault . "/$language"; // FIXME: $language is undefined |
336 | 336 | } |
337 | 337 | $repost['fields']['return'] = $returnto; |
338 | 338 | $repost['fields']['currency_code'] = $input['currency_code']; |
— | — | @@ -378,7 +378,7 @@ |
379 | 379 | |
380 | 380 | $repost['fields']['t3'] = "M"; // The unit of measurement for for p3 (M = month) |
381 | 381 | $repost['fields']['p3'] = '1'; // Billing cycle duration |
382 | | - $repost['fields']['srt'] = '12'; // # of billing cycles |
| 382 | + $repost['fields']['srt'] = $wgContributionTrackingRPPLength; // # of billing cycles |
383 | 383 | $repost['fields']['src'] = '1'; // Make this 'recurring' |
384 | 384 | $repost['fields']['sra'] = '1'; // Turn on re-attempt on failure |
385 | 385 | $repost['fields']['cmd'] = '_xclick-subscriptions'; |
— | — | @@ -390,7 +390,7 @@ |
391 | 391 | $repost['fields']['notify_url'] = $input['notify_url']; |
392 | 392 | $repost['fields']['item_name'] = $input['item_name']; |
393 | 393 | } |
394 | | - } else if ( $input['gateway'] == 'moneybookers' ) { |
| 394 | + } elseif ( $input['gateway'] == 'moneybookers' ) { |
395 | 395 | $repost['action'] = 'https://www.moneybookers.com/app/payment.pl'; |
396 | 396 | |
397 | 397 | // Tracking |
— | — | @@ -408,10 +408,12 @@ |
409 | 409 | } |
410 | 410 | |
411 | 411 | // Normalized amount |
412 | | - $repost['fields'][$amount_field_name] = $input['amount']; |
413 | | - if ( $input['amount_given'] ) { |
414 | | - $repost['fields'][$amount_field_name] = $input['amount_given']; |
| 412 | + $amount = $input['amount']; |
| 413 | + // If amount is not a number, use amount_given |
| 414 | + if ( !( preg_match( '/^\d+(\.(\d+)?)?$/', $amount ) ) && $input['amount_given'] ) { |
| 415 | + $amount = $input['amount_given']; |
415 | 416 | } |
| 417 | + $repost['fields'][$amount_field_name] = $amount; |
416 | 418 | |
417 | 419 | // Tracking |
418 | 420 | $repost['fields']['custom'] = $input['contribution_tracking_id']; |
Property changes on: branches/wmf/1.18wmf1/extensions/ContributionTracking/ContributionTracking.processor.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
419 | 421 | Merged /trunk/extensions/ContributionTracking/ContributionTracking.processor.php:r103611,103620,103622,104210,104368,106136,106367 |
Index: branches/wmf/1.18wmf1/extensions/ContributionTracking/ContributionTracking.php |
— | — | @@ -12,7 +12,7 @@ |
13 | 13 | $wgExtensionCredits['specialpage'][] = array( |
14 | 14 | 'path' => __FILE__, |
15 | 15 | 'name' => 'ContributionTracking', |
16 | | - 'url' => 'http://www.mediawiki.org/wiki/Extension:ContributionTracking', |
| 16 | + 'url' => 'https://www.mediawiki.org/wiki/Extension:ContributionTracking', |
17 | 17 | 'author' => 'David Strauss', |
18 | 18 | 'descriptionmsg' => 'contributiontracking-desc', |
19 | 19 | ); |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | |
35 | 35 | $wgAutoloadClasses['ApiContributionTracking'] = $dir . 'ApiContributionTracking.php'; |
36 | 36 | $wgAutoloadClasses['ContributionTrackingProcessor'] = $dir . 'ContributionTracking.processor.php'; |
37 | | - |
| 37 | + |
38 | 38 | //this only works if contribution tracking is inside a mediawiki DB, which typically it isn't. |
39 | 39 | $wgHooks['LoadExtensionSchemaUpdates'][] = 'efContributionTrackingLoadUpdates'; |
40 | 40 | |
— | — | @@ -75,6 +75,12 @@ |
76 | 76 | */ |
77 | 77 | $wgContributionTrackingPayPalBusiness = 'donations@wikimedia.org'; |
78 | 78 | |
| 79 | +/** |
| 80 | + * Recurring PayPal subscription Length. Default of 0 is unlimited until canceled |
| 81 | + */ |
| 82 | + |
| 83 | +$wgContributionTrackingRPPLength = '0'; |
| 84 | + |
79 | 85 | # Unit tests |
80 | 86 | $wgHooks['UnitTestsList'][] = 'efContributionTrackingUnitTests'; |
81 | 87 | |
— | — | @@ -109,7 +115,7 @@ |
110 | 116 | } else { |
111 | 117 | global $wgContributionTrackingDBname; |
112 | 118 | |
113 | | - if($updater->getDB()->getDBName() === $wgContributionTrackingDBname) { |
| 119 | + if( $updater->getDB()->getDBname() === $wgContributionTrackingDBname ) { |
114 | 120 | $updater->addExtensionTable( 'contribution_tracking', $dir . 'ContributionTracking.sql' ); |
115 | 121 | $updater->addExtensionTable( 'contribution_tracking_owa_ref', $dir . 'ContributionTracking_OWA_ref.sql' ); |
116 | 122 | $updater->addExtensionUpdate( array( 'addField', 'contribution_tracking', 'owa_session', |
Property changes on: branches/wmf/1.18wmf1/extensions/ContributionTracking |
___________________________________________________________________ |
Modified: svn:mergeinfo |
117 | 123 | Merged /trunk/extensions/ContributionTracking:r103611,103620,103622,104210,104368,106136,106367 |