r73421 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73420‎ | r73421 | r73422 >
Date:23:21, 20 September 2010
Author:awjrichards
Status:deferred
Tags:
Comment:
Added proxy options for PayPal and MaxMind
Modified paths:
  • /trunk/extensions/DonationInterface/payflowpro_gateway/extras/minfraud/ccfd/HTTPBase.php (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php
@@ -352,7 +352,7 @@
353353 * include in string (i.e. Vendor, password)
354354 */
355355 private function fnPayflowProcessTransaction( $data, $payflow_data ) {
356 - global $wgOut, $wgDonationTestingMode;
 356+ global $wgOut, $wgDonationTestingMode, $wgPayflowGatewayUseHTTPProxy, $wgPayflowGatewayHTTPProxy;
357357
358358 // create payflow query string, include string lengths
359359 $queryArray = array(
@@ -405,6 +405,12 @@
406406 curl_setopt( $ch, CURLOPT_FORBID_REUSE, true );
407407 curl_setopt( $ch, CURLOPT_POST, 1 );
408408
 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+
409415 // As suggested in the PayPal developer forum sample code, try more than once to get a response
410416 // in case there is a general network issue
411417 $i = 1;
Index: trunk/extensions/DonationInterface/payflowpro_gateway/extras/minfraud/ccfd/HTTPBase.php
@@ -238,6 +238,8 @@
239239
240240 // this function queries a single server
241241 function querySingleServer($server) {
 242+ global $wgPayflowGatewayUseHTTPProxy, $wgPayflowGatewayHTTPProxy;
 243+
242244 // check if we using the Secure HTTPS proctol
243245 if ($this->isSecure == 1) {
244246 $scheme = "https://"; // Secure HTTPS proctol
@@ -298,6 +300,12 @@
299301 curl_setopt($ch, CURLOPT_POST, 1);
300302 curl_setopt($ch, CURLOPT_POSTFIELDS, $query_string);
301303
 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+
302310 //get the content
303311 $content = curl_exec($ch);
304312
Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.php
@@ -72,6 +72,19 @@
7373 */
7474 $wgPayflowGatewayHeader = NULL;
7575
 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+
7689 function payflowGatewayConnection() {
7790 global $wgPayflowGatewayDBserver, $wgPayflowGatewayDBname;
7891 global $wgPayflowGatewayDBuser, $wgPayflowGatewayDBpassword;

Status & tagging log