Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php |
— | — | @@ -216,7 +216,8 @@ |
217 | 217 | |
218 | 218 | // save contrib tracking id early to track abondonment |
219 | 219 | if ( $data[ 'numAttempt' ] == '0' && ( !$wgRequest->getText( 'utm_source_id', false ) || $wgRequest->getText( '_nocache_' ) == 'true' ) ) { |
220 | | - if ( !$tracked = $this->fnPayflowSaveContributionTracking( $data ) ) { |
| 220 | + $tracked = $this->fnPayflowSaveContributionTracking( $data ); |
| 221 | + if ( !$tracked ) { |
221 | 222 | $when = time(); |
222 | 223 | wfDebugLog( 'payflowpro_gateway', 'Unable to save data to the contribution_tracking table ' . $when ); |
223 | 224 | } |
Index: trunk/extensions/DonationInterface/payflowpro_gateway/extras/minfraud/ccfd/HTTPBase.php |
— | — | @@ -20,21 +20,21 @@ |
21 | 21 | */ |
22 | 22 | |
23 | 23 | class HTTPBase { |
24 | | - var $server; |
25 | | - var $numservers; |
26 | | - var $url; |
27 | | - var $queries; |
28 | | - var $allowed_fields; |
29 | | - var $num_allowed_fields; |
30 | | - var $outputstr; |
31 | | - var $isSecure; |
32 | | - var $timeout; |
33 | | - var $debug; |
34 | | - var $check_field; |
35 | | - var $wsIpaddrRefreshTimeout; |
36 | | - var $wsIpaddrCacheFile; |
37 | | - var $useDNS; |
38 | | - var $ipstr; |
| 24 | + var $server; |
| 25 | + var $numservers; |
| 26 | + var $url; |
| 27 | + var $queries; |
| 28 | + var $allowed_fields; |
| 29 | + var $num_allowed_fields; |
| 30 | + var $outputstr; |
| 31 | + var $isSecure; |
| 32 | + var $timeout; |
| 33 | + var $debug; |
| 34 | + var $check_field; |
| 35 | + var $wsIpaddrRefreshTimeout; |
| 36 | + var $wsIpaddrCacheFile; |
| 37 | + var $useDNS; |
| 38 | + var $ipstr; |
39 | 39 | function __construct() { |
40 | 40 | $this->isSecure = 0; |
41 | 41 | $this->debug = 0; |
— | — | @@ -51,7 +51,7 @@ |
52 | 52 | |
53 | 53 | // this function sets the checked field |
54 | 54 | function set_check_field( $f ) { |
55 | | - $check_field = $f; |
| 55 | + $this->check_field = $f; |
56 | 56 | } |
57 | 57 | |
58 | 58 | // this function sets the allowed fields |
— | — | @@ -344,7 +344,7 @@ |
345 | 345 | $url3 = parse_url( $url ); |
346 | 346 | $host = $url3["host"]; |
347 | 347 | $path = $url3["path"]; |
348 | | - $query = $url3["query"]; |
| 348 | + $query = $url3["query"]; |
349 | 349 | |
350 | 350 | // open the connection |
351 | 351 | $fp = fsockopen ( $host, 80, $errno, $errstr, $this->timeout ); |
Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.php |
— | — | @@ -125,21 +125,21 @@ |
126 | 126 | $wgAutoloadClasses[ 'ApiPayflowProGateway' ] = $dir . 'api_payflowpro_gateway.php'; |
127 | 127 | |
128 | 128 | function payflowGatewayConnection() { |
129 | | - global $wgPayflowGatewayDBserver, $wgPayflowGatewayDBname; |
130 | | - global $wgPayflowGatewayDBuser, $wgPayflowGatewayDBpassword; |
| 129 | + global $wgPayflowGatewayDBserver, $wgPayflowGatewayDBname; |
| 130 | + global $wgPayflowGatewayDBuser, $wgPayflowGatewayDBpassword; |
131 | 131 | |
132 | | - static $db; |
| 132 | + static $db; |
133 | 133 | |
134 | | - if ( !$db ) { |
135 | | - $db = new DatabaseMysql( |
136 | | - $wgPayflowGatewayDBserver, |
137 | | - $wgPayflowGatewayDBuser, |
138 | | - $wgPayflowGatewayDBpassword, |
139 | | - $wgPayflowGatewayDBname ); |
140 | | - $db->query( "SET names utf8" ); |
141 | | - } |
| 134 | + if ( !$db ) { |
| 135 | + $db = new DatabaseMysql( |
| 136 | + $wgPayflowGatewayDBserver, |
| 137 | + $wgPayflowGatewayDBuser, |
| 138 | + $wgPayflowGatewayDBpassword, |
| 139 | + $wgPayflowGatewayDBname ); |
| 140 | + $db->query( "SET names utf8" ); |
| 141 | + } |
142 | 142 | |
143 | | - return $db; |
| 143 | + return $db; |
144 | 144 | } |
145 | 145 | |
146 | 146 | /** |
— | — | @@ -147,22 +147,21 @@ |
148 | 148 | * also supplies currencies supported by this gateway |
149 | 149 | */ |
150 | 150 | function pfpGatewayValue( &$values ) { |
| 151 | + $values['payflow'] = array( |
| 152 | + 'gateway' => 'payflow', |
| 153 | + 'display_name' => 'Credit Card', |
| 154 | + 'form_value' => 'payflow', |
| 155 | + 'currencies' => array( |
| 156 | + 'GBP' => 'GBP: British Pound', |
| 157 | + 'EUR' => 'EUR: Euro', |
| 158 | + 'USD' => 'USD: U.S. Dollar', |
| 159 | + 'AUD' => 'AUD: Australian Dollar', |
| 160 | + 'CAD' => 'CAD: Canadian Dollar', |
| 161 | + 'JPY' => 'JPY: Japanese Yen', |
| 162 | + ), |
| 163 | + ); |
151 | 164 | |
152 | | - $values['payflow'] = array( |
153 | | - 'gateway' => 'payflow', |
154 | | - 'display_name' => 'Credit Card', |
155 | | - 'form_value' => 'payflow', |
156 | | - 'currencies' => array( |
157 | | - 'GBP' => 'GBP: British Pound', |
158 | | - 'EUR' => 'EUR: Euro', |
159 | | - 'USD' => 'USD: U.S. Dollar', |
160 | | - 'AUD' => 'AUD: Australian Dollar', |
161 | | - 'CAD' => 'CAD: Canadian Dollar', |
162 | | - 'JPY' => 'JPY: Japanese Yen', |
163 | | - ), |
164 | | - ); |
165 | | - |
166 | | - return true; |
| 165 | + return true; |
167 | 166 | } |
168 | 167 | |
169 | 168 | /** |
— | — | @@ -173,15 +172,8 @@ |
174 | 173 | * the result might look like this: http://www.yourdomain.com/index.php?title=Special:PayflowPro&amount=75.00¤cy_code=USD&payment_method=payflow |
175 | 174 | */ |
176 | 175 | function pfpGatewayPage( &$url ) { |
177 | | - global $wgScript; |
| 176 | + global $wgScript; |
178 | 177 | |
179 | | - $url['payflow'] = $wgScript . "?title=Special:PayflowProGateway"; |
180 | | - return true; |
| 178 | + $url['payflow'] = $wgScript . "?title=Special:PayflowProGateway"; |
| 179 | + return true; |
181 | 180 | } |
182 | | - |
183 | | -// Add JQuery |
184 | | -$wgHooks['BeforePageDisplay'][] = 'pfpAddJQuery'; |
185 | | -function pfpAddJQuery( $out, $sk ) { |
186 | | - $out->includeJQuery(); |
187 | | - return true; |
188 | | -} |
Index: trunk/extensions/DonationInterface/donate_interface/donate_interface.php |
— | — | @@ -60,7 +60,7 @@ |
61 | 61 | |
62 | 62 | if ( !$formProcessed ) { |
63 | 63 | // process form |
64 | | - wfRunHooks( 'DonationInterface_DisplayForm' ); |
| 64 | + wfRunHooks( 'DonationInterface_DisplayForm' ); |
65 | 65 | $formProcessed = true; |
66 | 66 | } |
67 | 67 | |
— | — | @@ -89,13 +89,13 @@ |
90 | 90 | $url = $wgRequest->getRequestURL(); |
91 | 91 | |
92 | 92 | if ( $url ) { |
93 | | - $getLang = explode( '/', $url ); |
94 | | - $language = substr( $getLang[3], 0, 2 ); |
| 93 | + $getLang = explode( '/', $url ); |
| 94 | + $language = substr( $getLang[3], 0, 2 ); |
95 | 95 | } |
96 | 96 | |
97 | 97 | // error check and set "en" as default |
98 | 98 | if ( !preg_match( '/^[a-z-]+$/', $language ) ) { |
99 | | - $language = 'en'; |
| 99 | + $language = 'en'; |
100 | 100 | } |
101 | 101 | |
102 | 102 | // get payment method gateway value and name from each gateway and create menu of options |
— | — | @@ -105,7 +105,7 @@ |
106 | 106 | $gatewayMenu = ''; |
107 | 107 | |
108 | 108 | foreach ( $values as $current ) { |
109 | | - $gatewayMenu .= Xml::option( $current['display_name'], $current['form_value'] ); |
| 109 | + $gatewayMenu .= Xml::option( $current['display_name'], $current['form_value'] ); |
110 | 110 | } |
111 | 111 | |
112 | 112 | // get available currencies |
— | — | @@ -113,9 +113,9 @@ |
114 | 114 | $currencies = array( 'USD' => "USD: U.S. Dollar" ); |
115 | 115 | // FIXME: It uses the currencies of the last gateway to be loaded. It should probably use the union of currencies, (currencies allowed by any gateway). |
116 | 116 | foreach ( $values as $key ) { |
117 | | - if ( isset( $key['currencies'] ) ) { |
118 | | - $currencies = $key['currencies']; |
119 | | - } |
| 117 | + if ( isset( $key['currencies'] ) ) { |
| 118 | + $currencies = $key['currencies']; |
| 119 | + } |
120 | 120 | } |
121 | 121 | |
122 | 122 | $currencyMenu = ''; |
— | — | @@ -156,15 +156,15 @@ |
157 | 157 | |
158 | 158 | $currency_options = ''; |
159 | 159 | foreach ( $currencies as $code => $name ) { |
160 | | - $selected = ''; |
161 | | - if ( $code == $default_currency ) { |
162 | | - $selected = ' selected="selected"'; |
163 | | - } |
164 | | - $currency_options .= '<option value="' . $code . '"' . $selected . '>' . wfMsg( 'donate_interface-' . $code ) . '</option>'; |
| 160 | + $selected = ''; |
| 161 | + if ( $code == $default_currency ) { |
| 162 | + $selected = ' selected="selected"'; |
| 163 | + } |
| 164 | + $currency_options .= '<option value="' . $code . '"' . $selected . '>' . wfMsg( 'donate_interface-' . $code ) . '</option>'; |
165 | 165 | } |
166 | 166 | |
167 | 167 | $currencyFields = Xml::openElement( 'select', array( 'name' => 'currency_code', 'id' => "input_currency_code" ) ) . |
168 | | - $currency_options . |
| 168 | + $currency_options . |
169 | 169 | Xml::closeElement( 'select' ); |
170 | 170 | |
171 | 171 | $output .= Xml::fieldset( wfMsg( 'donate_interface-currency' ), $currencyFields, array( 'class' => "mw-donation-currency" ) ); |
Index: trunk/extensions/DonationInterface/activemq_stomp/activemq_stomp.php |
— | — | @@ -29,25 +29,24 @@ |
30 | 30 | * Create <donate /> tag to include landing page donation form |
31 | 31 | */ |
32 | 32 | function efStompSetup( &$parser ) { |
33 | | - global $wgParser, ; |
| 33 | + global $wgParser; |
34 | 34 | |
35 | | - // redundant and causes Fatal Error |
36 | | - // $parser->disableCache(); |
| 35 | + // redundant and causes Fatal Error |
| 36 | + // $parser->disableCache(); |
37 | 37 | |
38 | | - $wgParser->setHook( 'stomp', 'efStompTest' ); |
| 38 | + $wgParser->setHook( 'stomp', 'efStompTest' ); |
39 | 39 | |
40 | | - return true; |
| 40 | + return true; |
41 | 41 | } |
42 | 42 | |
43 | 43 | function efStompTest( $input, $args, &$parser ) { |
| 44 | + $parser->disableCache(); |
44 | 45 | |
45 | | - $parser->disableCache(); |
| 46 | + $output = "STOMP Test page"; |
46 | 47 | |
47 | | - $output = "STOMP Test page"; |
| 48 | + wfRunHooks( 'gwStomp', array( &$transaction ) ); |
48 | 49 | |
49 | | - wfRunHooks( 'gwStomp', array( &$transaction ) ); |
50 | | - |
51 | | - return $output; |
| 50 | + return $output; |
52 | 51 | } |
53 | 52 | |
54 | 53 | /** |
— | — | @@ -61,62 +60,62 @@ |
62 | 61 | * Hook to send transaction information to ActiveMQ server |
63 | 62 | */ |
64 | 63 | function sendSTOMP( $transaction ) { |
65 | | - global $wgStompServer, $wgStompQueueName; |
| 64 | + global $wgStompServer, $wgStompQueueName; |
66 | 65 | |
67 | | - $queueName = isset ( $wgStompQueueName ) ? $wgStompQueueName : 'test'; |
| 66 | + $queueName = isset ( $wgStompQueueName ) ? $wgStompQueueName : 'test'; |
68 | 67 | |
69 | | - // include a library |
70 | | - require_once( "Stomp.php" ); |
| 68 | + // include a library |
| 69 | + require_once( "Stomp.php" ); |
71 | 70 | |
72 | | - $message = json_encode( createQueueMessage( $transaction ) ); |
| 71 | + $message = json_encode( createQueueMessage( $transaction ) ); |
73 | 72 | |
74 | | - // make a connection |
75 | | - $con = new Stomp( $wgStompServer ); |
| 73 | + // make a connection |
| 74 | + $con = new Stomp( $wgStompServer ); |
76 | 75 | |
77 | | - // connect |
78 | | - $con->connect(); |
| 76 | + // connect |
| 77 | + $con->connect(); |
79 | 78 | |
80 | | - // send a message to the queue |
81 | | - $result = $con->send( "/queue/$queueName", $message, array( 'persistent' => 'true' ) ); |
| 79 | + // send a message to the queue |
| 80 | + $result = $con->send( "/queue/$queueName", $message, array( 'persistent' => 'true' ) ); |
82 | 81 | |
83 | | - if ( !$result ) { |
84 | | - wfDebugLog( 'activemq_stomp', 'Send to Q failed for this message: ' . $message ); |
85 | | -} |
| 82 | + if ( !$result ) { |
| 83 | + wfDebugLog( 'activemq_stomp', 'Send to Q failed for this message: ' . $message ); |
| 84 | + } |
86 | 85 | |
87 | | - $con->disconnect(); |
| 86 | + $con->disconnect(); |
88 | 87 | |
89 | | - return true; |
| 88 | + return true; |
90 | 89 | } |
91 | 90 | |
92 | 91 | /* |
93 | 92 | * Hook to send transaction information to ActiveMQ server |
94 | 93 | */ |
95 | 94 | function sendPendingSTOMP( $transaction ) { |
96 | | - global $wgStompServer, $wgPendingStompQueueName; |
| 95 | + global $wgStompServer, $wgPendingStompQueueName; |
97 | 96 | |
98 | | - $queueName = isset ( $wgPendingStompQueueName ) ? $wgPendingStompQueueName : 'pending'; |
| 97 | + $queueName = isset ( $wgPendingStompQueueName ) ? $wgPendingStompQueueName : 'pending'; |
99 | 98 | |
100 | | - // include a library |
101 | | - require_once( "Stomp.php" ); |
| 99 | + // include a library |
| 100 | + require_once( "Stomp.php" ); |
102 | 101 | |
103 | | - $message = json_encode( createQueueMessage( $transaction ) ); |
| 102 | + $message = json_encode( createQueueMessage( $transaction ) ); |
104 | 103 | |
105 | | - // make a connection |
106 | | - $con = new Stomp( $wgStompServer ); |
| 104 | + // make a connection |
| 105 | + $con = new Stomp( $wgStompServer ); |
107 | 106 | |
108 | | - // connect |
109 | | - $con->connect(); |
| 107 | + // connect |
| 108 | + $con->connect(); |
110 | 109 | |
111 | | - // send a message to the queue |
112 | | - $result = $con->send( "/queue/$queueName", $message, array( 'persistent' => 'true' ) ); |
| 110 | + // send a message to the queue |
| 111 | + $result = $con->send( "/queue/$queueName", $message, array( 'persistent' => 'true' ) ); |
113 | 112 | |
114 | | - if ( !$result ) { |
115 | | - wfDebugLog( 'activemq_stomp', 'Send to Pending Q failed for this message: ' . $message ); |
116 | | -} |
| 113 | + if ( !$result ) { |
| 114 | + wfDebugLog( 'activemq_stomp', 'Send to Pending Q failed for this message: ' . $message ); |
| 115 | + } |
117 | 116 | |
118 | | - $con->disconnect(); |
| 117 | + $con->disconnect(); |
119 | 118 | |
120 | | - return true; |
| 119 | + return true; |
121 | 120 | } |
122 | 121 | |
123 | 122 | /** |
— | — | @@ -133,41 +132,40 @@ |
134 | 133 | * Response from Payflow is assigned to 'response' |
135 | 134 | */ |
136 | 135 | function createQueueMessage( $transaction ) { |
137 | | - // specifically designed to match the CiviCRM API that will handle it |
138 | | - // edit this array to include/ignore transaction data sent to the server |
139 | | - $message = array( |
140 | | - 'contribution_tracking_id' => $transaction['contribution_tracking_id'], |
141 | | - 'optout' => $transaction['optout'], |
142 | | - 'anonymous' => $transaction['anonymous'], |
143 | | - 'comment' => $transaction['comment'], |
144 | | - 'utm_source' => $transaction['utm_source'], |
145 | | - 'utm_medium' => $transaction['utm_medium'], |
146 | | - 'utm_campaign' => $transaction['utm_campaign'], |
147 | | - 'language' => $transaction['language'], |
148 | | - 'referrer' => $transaction['referrer'], |
149 | | - 'email' => $transaction['email'], |
150 | | - 'first_name' => $transaction['fname'], |
151 | | - 'middle_name' => $transaction['mname'], |
152 | | - 'last_name' => $transaction['lname'], |
153 | | - 'street_address' => $transaction['street'], |
154 | | - 'supplemental_address_1' => '', |
155 | | - 'city' => $transaction['city'], |
156 | | - 'state_province' => $transaction['state'], |
157 | | - 'country' => $transaction['country_name'], |
158 | | - 'countryID' => $transaction['country_code'], |
159 | | - 'postal_code' => $transaction['zip'], |
160 | | - 'gateway' => $transaction[ 'gateway' ], |
161 | | - 'gateway_txn_id' => $transaction['PNREF'], |
162 | | - 'response' => $transaction['RESPMSG'], |
163 | | - 'currency' => $transaction['currency'], |
164 | | - 'original_currency' => $transaction['currency'], |
165 | | - 'original_gross' => $transaction['amount'], |
166 | | - 'fee' => '0', |
167 | | - 'gross' => $transaction['amount'], |
168 | | - 'net' => $transaction['amount'], |
169 | | - 'date' => $transaction['date'], |
| 136 | + // specifically designed to match the CiviCRM API that will handle it |
| 137 | + // edit this array to include/ignore transaction data sent to the server |
| 138 | + $message = array( |
| 139 | + 'contribution_tracking_id' => $transaction['contribution_tracking_id'], |
| 140 | + 'optout' => $transaction['optout'], |
| 141 | + 'anonymous' => $transaction['anonymous'], |
| 142 | + 'comment' => $transaction['comment'], |
| 143 | + 'utm_source' => $transaction['utm_source'], |
| 144 | + 'utm_medium' => $transaction['utm_medium'], |
| 145 | + 'utm_campaign' => $transaction['utm_campaign'], |
| 146 | + 'language' => $transaction['language'], |
| 147 | + 'referrer' => $transaction['referrer'], |
| 148 | + 'email' => $transaction['email'], |
| 149 | + 'first_name' => $transaction['fname'], |
| 150 | + 'middle_name' => $transaction['mname'], |
| 151 | + 'last_name' => $transaction['lname'], |
| 152 | + 'street_address' => $transaction['street'], |
| 153 | + 'supplemental_address_1' => '', |
| 154 | + 'city' => $transaction['city'], |
| 155 | + 'state_province' => $transaction['state'], |
| 156 | + 'country' => $transaction['country_name'], |
| 157 | + 'countryID' => $transaction['country_code'], |
| 158 | + 'postal_code' => $transaction['zip'], |
| 159 | + 'gateway' => $transaction[ 'gateway' ], |
| 160 | + 'gateway_txn_id' => $transaction['PNREF'], |
| 161 | + 'response' => $transaction['RESPMSG'], |
| 162 | + 'currency' => $transaction['currency'], |
| 163 | + 'original_currency' => $transaction['currency'], |
| 164 | + 'original_gross' => $transaction['amount'], |
| 165 | + 'fee' => '0', |
| 166 | + 'gross' => $transaction['amount'], |
| 167 | + 'net' => $transaction['amount'], |
| 168 | + 'date' => $transaction['date'], |
| 169 | + ); |
170 | 170 | |
171 | | - ); |
172 | | - |
173 | | - return $message; |
| 171 | + return $message; |
174 | 172 | } |