Index: trunk/extensions/ContributionTracking/ContributionTracking_body.php |
— | — | @@ -7,7 +7,7 @@ |
8 | 8 | |
9 | 9 | function get_owa_ref_id($ref){ |
10 | 10 | // Replication lag means sometimes a new event will not exist in the table yet |
11 | | - $dbw = wfGetDB( DB_MASTER ); |
| 11 | + $dbw = contributionTrackingConnection(); //wfGetDB( DB_MASTER ); |
12 | 12 | $id_num = $dbw->selectField( |
13 | 13 | 'contribution_tracking_owa_ref', |
14 | 14 | 'id', |
— | — | @@ -28,7 +28,8 @@ |
29 | 29 | |
30 | 30 | |
31 | 31 | function execute( $language ) { |
32 | | - global $wgRequest, $wgOut; |
| 32 | + global $wgRequest, $wgOut, $wgContributionTrackingPayPalIPN, $wgContributionTrackingReturnToURLDefault, |
| 33 | + $wgContributionTrackingPayPalRecurringIPN, $wgContributionTrackingPayPalBusiness; |
33 | 34 | |
34 | 35 | if ( !preg_match( '/^[a-z-]+$/', $language ) ) { |
35 | 36 | $language = 'en'; |
— | — | @@ -84,7 +85,7 @@ |
85 | 86 | if( $returnTitle ) { |
86 | 87 | $returnto = $returnTitle->getFullUrl(); |
87 | 88 | } else { |
88 | | - $returnto = "http://wikimediafoundation.org/wiki/Thank_You/$language"; |
| 89 | + $returnto = $wgContributionTrackingReturnToURLDefault . "/$language"; |
89 | 90 | } |
90 | 91 | |
91 | 92 | // Set the action and tracking ID fields |
— | — | @@ -92,6 +93,7 @@ |
93 | 94 | $action = 'http://wikimediafoundation.org/'; |
94 | 95 | $amount_field_name = 'amount'; // the amount fieldname may be different depending on the service |
95 | 96 | if ( $gateway == 'paypal' ) { |
| 97 | + |
96 | 98 | $action = 'https://www.paypal.com/cgi-bin/webscr'; |
97 | 99 | |
98 | 100 | // Premiums |
— | — | @@ -102,7 +104,7 @@ |
103 | 105 | } |
104 | 106 | |
105 | 107 | // PayPal |
106 | | - $repost['business'] = 'donations@wikimedia.org'; |
| 108 | + $repost['business'] = $wgContributionTrackingPayPalBusiness; |
107 | 109 | $repost['item_name'] = 'One-time donation'; |
108 | 110 | $repost['item_number'] = 'DONATE'; |
109 | 111 | $repost['no_note'] = '0'; |
— | — | @@ -123,9 +125,10 @@ |
124 | 126 | $repost[ 'sra' ] = '1'; // Turn on re-attempt on failure |
125 | 127 | $repost[ 'cmd' ] = '_xclick-subscriptions'; |
126 | 128 | $amount_field_name = 'a3'; |
| 129 | + $repost['notify_url'] = $wgContributionTrackingPayPalRecurringIPN; |
127 | 130 | } else { |
128 | 131 | $repost['cmd'] = '_xclick'; |
129 | | - $repost['notify_url'] = 'https://civicrm.wikimedia.org/fundcore_gateway/paypal'; |
| 132 | + $repost['notify_url'] = $wgContributionTrackingPayPalIPN; |
130 | 133 | } |
131 | 134 | } |
132 | 135 | else if ( $gateway == 'moneybookers' ) { |
Index: trunk/extensions/ContributionTracking/ContributionTracking.php |
— | — | @@ -26,11 +26,33 @@ |
27 | 27 | //this only works if contribution tracking is inside a mediawiki DB, which typically it isn't. |
28 | 28 | //$wgHooks['LoadExtensionSchemaUpdates'][] = 'efContributionTrackingLoadUpdates'; |
29 | 29 | |
| 30 | +/** |
| 31 | + * The default 'return to' URL for a thank you page after posting to the contribution |
| 32 | + * |
| 33 | + * NO trailing slash, please |
| 34 | + */ |
| 35 | +$wgContributionTrackingReturnToURLDefault = 'http://wikimediafoundation.org/wiki/Thank_You'; |
| 36 | + |
30 | 37 | $wgContributionTrackingDBserver = $wgDBserver; |
31 | 38 | $wgContributionTrackingDBname = $wgDBname; |
32 | 39 | $wgContributionTrackingDBuser = $wgDBuser; |
33 | 40 | $wgContributionTrackingDBpassword = $wgDBpassword; |
34 | 41 | |
| 42 | +/** |
| 43 | + * IPN listener address for regular PayPal trxns |
| 44 | + */ |
| 45 | +$wgContributionTrackingPayPalIPN = 'https://civicrm.wikimedia.org/fundcore_gateway/paypal'; |
| 46 | + |
| 47 | +/** |
| 48 | + * IPN listener address for recurring payment PayPal trxns |
| 49 | + */ |
| 50 | +$wgContributionTrackingPayPalRecurringIPN = 'https://civicrm.wikimedia.org/fundcore_gateway/paypal'; |
| 51 | + |
| 52 | +/** |
| 53 | + * 'Business' string for PayPal |
| 54 | + */ |
| 55 | +$wgContributionTrackingPayPalBusiness = 'donations@wikimedia.org'; |
| 56 | + |
35 | 57 | function efContributionTrackingLoadUpdates(){ |
36 | 58 | global $wgExtNewTables, $wgExtNewFields; |
37 | 59 | $dir = dirname( __FILE__ ) . '/'; |