Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php |
— | — | @@ -352,7 +352,7 @@ |
353 | 353 | * include in string (i.e. Vendor, password) |
354 | 354 | */ |
355 | 355 | private function fnPayflowProcessTransaction( $data, $payflow_data ) { |
356 | | - global $wgOut, $wgDonationTestingMode; |
| 356 | + global $wgOut, $wgDonationTestingMode, $wgPayflowGatewayUseHTTPProxy, $wgPayflowGatewayHTTPProxy; |
357 | 357 | |
358 | 358 | // create payflow query string, include string lengths |
359 | 359 | $queryArray = array( |
— | — | @@ -405,6 +405,12 @@ |
406 | 406 | curl_setopt( $ch, CURLOPT_FORBID_REUSE, true ); |
407 | 407 | curl_setopt( $ch, CURLOPT_POST, 1 ); |
408 | 408 | |
| 409 | + // set proxy settings if necessary |
| 410 | + if ( $wgPayflowGatewayUseHTTPProxy ) { |
| 411 | + curl_setopt( $ch, CURLOPT_HTTPPROXYTUNNEL, 1 ); |
| 412 | + curl_setopt( $ch, CURLOPT_PROXY, $wgPayflowGatewayHTTPProxy ); |
| 413 | + } |
| 414 | + |
409 | 415 | // As suggested in the PayPal developer forum sample code, try more than once to get a response |
410 | 416 | // in case there is a general network issue |
411 | 417 | $i = 1; |
Index: trunk/extensions/DonationInterface/payflowpro_gateway/extras/minfraud/ccfd/HTTPBase.php |
— | — | @@ -238,6 +238,8 @@ |
239 | 239 | |
240 | 240 | // this function queries a single server |
241 | 241 | function querySingleServer($server) { |
| 242 | + global $wgPayflowGatewayUseHTTPProxy, $wgPayflowGatewayHTTPProxy; |
| 243 | + |
242 | 244 | // check if we using the Secure HTTPS proctol |
243 | 245 | if ($this->isSecure == 1) { |
244 | 246 | $scheme = "https://"; // Secure HTTPS proctol |
— | — | @@ -298,6 +300,12 @@ |
299 | 301 | curl_setopt($ch, CURLOPT_POST, 1); |
300 | 302 | curl_setopt($ch, CURLOPT_POSTFIELDS, $query_string); |
301 | 303 | |
| 304 | + // set proxy settings if necessary |
| 305 | + if ( $wgPayflowGatewayUseHTTPProxy ) { |
| 306 | + curl_setopt( $ch, CURLOPT_HTTPPROXYTUNNEL, 1 ); |
| 307 | + curl_setopt( $ch, CURLOPT_PROXY, $wgPayflowGatewayHTTPProxy ); |
| 308 | + } |
| 309 | + |
302 | 310 | //get the content |
303 | 311 | $content = curl_exec($ch); |
304 | 312 | |
Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.php |
— | — | @@ -72,6 +72,19 @@ |
73 | 73 | */ |
74 | 74 | $wgPayflowGatewayHeader = NULL; |
75 | 75 | |
| 76 | +/** |
| 77 | + * Proxy settings |
| 78 | + * |
| 79 | + * If you need to use an HTTP proxy for outgoing traffic, |
| 80 | + * set wgPayflowGatweayUseHTTPProxy=TRUE and set $wgPayflowGatewayHTTPProxy |
| 81 | + * to the proxy desination. |
| 82 | + * eg: |
| 83 | + * $wgPayflowGatewayUseHTTPProxy=TRUE; |
| 84 | + * $wgPayflowGatewayHTTPProxy='192.168.1.1:3128' |
| 85 | + */ |
| 86 | +$wgPayflowGatewayUseHTTPProxy = FALSE; |
| 87 | +$wgPayflowGatewayHTTPProxy = ''; |
| 88 | + |
76 | 89 | function payflowGatewayConnection() { |
77 | 90 | global $wgPayflowGatewayDBserver, $wgPayflowGatewayDBname; |
78 | 91 | global $wgPayflowGatewayDBuser, $wgPayflowGatewayDBpassword; |