http://www.mediawiki.org/wiki/Special:Code/MediaWiki/76426

Revision: 76426
Author:   awjrichards
Date:     2010-11-10 04:01:14 +0000 (Wed, 10 Nov 2010)
Log Message:
-----------
Adding timeout settings for curlopts for communicating with maxmind and payflow

Modified Paths:
--------------
    
trunk/extensions/DonationInterface/payflowpro_gateway/extras/minfraud/minfraud.body.php
    
trunk/extensions/DonationInterface/payflowpro_gateway/extras/minfraud/minfraud.php
    
trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php
    trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.php

Modified: 
trunk/extensions/DonationInterface/payflowpro_gateway/extras/minfraud/minfraud.body.php
===================================================================
--- 
trunk/extensions/DonationInterface/payflowpro_gateway/extras/minfraud/minfraud.body.php
     2010-11-10 03:07:08 UTC (rev 76425)
+++ 
trunk/extensions/DonationInterface/payflowpro_gateway/extras/minfraud/minfraud.body.php
     2010-11-10 04:01:14 UTC (rev 76426)
@@ -215,6 +215,8 @@
         * Perform the min fraud query and capture the response
         */
        public function query_minfraud( array $minfraud_query ) {
+               global $wgMinFraudTimeout;
+               $this->get_ccfd()->timeout = $wgMinFraudTimeout;
                $this->get_ccfd()->input( $minfraud_query );
                $this->get_ccfd()->query();
                $this->minfraud_response = $this->get_ccfd()->output();

Modified: 
trunk/extensions/DonationInterface/payflowpro_gateway/extras/minfraud/minfraud.php
===================================================================
--- 
trunk/extensions/DonationInterface/payflowpro_gateway/extras/minfraud/minfraud.php
  2010-11-10 03:07:08 UTC (rev 76425)
+++ 
trunk/extensions/DonationInterface/payflowpro_gateway/extras/minfraud/minfraud.php
  2010-11-10 04:01:14 UTC (rev 76426)
@@ -48,6 +48,9 @@
        'reject' => array( -1, -1 )
 );
 
+// Timeout in seconds for communicating with MaxMind
+$wgMinFraudTimeout = 2;
+
 /**
  * Define whether or not to run minFraud in stand alone mode
  *

Modified: 
trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php
===================================================================
--- 
trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php
   2010-11-10 03:07:08 UTC (rev 76425)
+++ 
trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php
   2010-11-10 04:01:14 UTC (rev 76426)
@@ -381,7 +381,7 @@
         *                                              include in string (i.e. 
Vendor, password)
         */
        private function fnPayflowProcessTransaction( $data, $payflow_data ) {
-               global $wgOut, $wgDonationTestingMode, 
$wgPayflowGatewayUseHTTPProxy, $wgPayflowGatewayHTTPProxy;
+               global $wgOut, $wgDonationTestingMode, 
$wgPayflowGatewayUseHTTPProxy, $wgPayflowGatewayHTTPProxy, $wgPayflowProTimeout;
 
                // update contribution tracking
                $this->updateContributionTracking( $data, defined( 'OWA' ) );
@@ -429,7 +429,7 @@
                curl_setopt( $ch, CURLOPT_USERAGENT, $user_agent );
                curl_setopt( $ch, CURLOPT_HEADER, 1 );
                curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
-               curl_setopt( $ch, CURLOPT_TIMEOUT, 5 );
+               curl_setopt( $ch, CURLOPT_TIMEOUT, $wgPayflowProTimeout );
                curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 0 );
                curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, 0 );
                curl_setopt( $ch, CURLOPT_POSTFIELDS, $payflow_query );

Modified: 
trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.php
===================================================================
--- 
trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.php    
    2010-11-10 03:07:08 UTC (rev 76425)
+++ 
trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.php    
    2010-11-10 04:01:14 UTC (rev 76426)
@@ -54,6 +54,9 @@
 // a boolean to determine if we're in testing mode
 $wgPayflowGatewayTest = FALSE;
 
+// timeout in seconds for communicating with paypal
+$wgPayflowProTimeout = 2;
+
 /**
  * The default form to use
  */


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to