http://www.mediawiki.org/wiki/Special:Code/MediaWiki/73421
Revision: 73421
Author: awjrichards
Date: 2010-09-20 23:21:14 +0000 (Mon, 20 Sep 2010)
Log Message:
-----------
Added proxy options for PayPal and MaxMind
Modified Paths:
--------------
trunk/extensions/DonationInterface/payflowpro_gateway/extras/minfraud/ccfd/HTTPBase.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/ccfd/HTTPBase.php
===================================================================
---
trunk/extensions/DonationInterface/payflowpro_gateway/extras/minfraud/ccfd/HTTPBase.php
2010-09-20 23:15:40 UTC (rev 73420)
+++
trunk/extensions/DonationInterface/payflowpro_gateway/extras/minfraud/ccfd/HTTPBase.php
2010-09-20 23:21:14 UTC (rev 73421)
@@ -238,6 +238,8 @@
// this function queries a single server
function querySingleServer($server) {
+ global $wgPayflowGatewayUseHTTPProxy, $wgPayflowGatewayHTTPProxy;
+
// check if we using the Secure HTTPS proctol
if ($this->isSecure == 1) {
$scheme = "https://"; // Secure HTTPS proctol
@@ -298,6 +300,12 @@
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $query_string);
+ // set proxy settings if necessary
+ if ( $wgPayflowGatewayUseHTTPProxy ) {
+ curl_setopt( $ch, CURLOPT_HTTPPROXYTUNNEL, 1 );
+ curl_setopt( $ch, CURLOPT_PROXY, $wgPayflowGatewayHTTPProxy );
+ }
+
//get the content
$content = curl_exec($ch);
Modified:
trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php
===================================================================
---
trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php
2010-09-20 23:15:40 UTC (rev 73420)
+++
trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php
2010-09-20 23:21:14 UTC (rev 73421)
@@ -352,7 +352,7 @@
* include in string (i.e.
Vendor, password)
*/
private function fnPayflowProcessTransaction( $data, $payflow_data ) {
- global $wgOut, $wgDonationTestingMode;
+ global $wgOut, $wgDonationTestingMode,
$wgPayflowGatewayUseHTTPProxy, $wgPayflowGatewayHTTPProxy;
// create payflow query string, include string lengths
$queryArray = array(
@@ -405,6 +405,12 @@
curl_setopt( $ch, CURLOPT_FORBID_REUSE, true );
curl_setopt( $ch, CURLOPT_POST, 1 );
+ // set proxy settings if necessary
+ if ( $wgPayflowGatewayUseHTTPProxy ) {
+ curl_setopt( $ch, CURLOPT_HTTPPROXYTUNNEL, 1 );
+ curl_setopt( $ch, CURLOPT_PROXY,
$wgPayflowGatewayHTTPProxy );
+ }
+
// As suggested in the PayPal developer forum sample code, try
more than once to get a response
// in case there is a general network issue
$i = 1;
Modified:
trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.php
===================================================================
---
trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.php
2010-09-20 23:15:40 UTC (rev 73420)
+++
trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.php
2010-09-20 23:21:14 UTC (rev 73421)
@@ -72,6 +72,19 @@
*/
$wgPayflowGatewayHeader = NULL;
+/**
+ * Proxy settings
+ *
+ * If you need to use an HTTP proxy for outgoing traffic,
+ * set wgPayflowGatweayUseHTTPProxy=TRUE and set $wgPayflowGatewayHTTPProxy
+ * to the proxy desination.
+ * eg:
+ * $wgPayflowGatewayUseHTTPProxy=TRUE;
+ * $wgPayflowGatewayHTTPProxy='192.168.1.1:3128'
+ */
+$wgPayflowGatewayUseHTTPProxy = FALSE;
+$wgPayflowGatewayHTTPProxy = '';
+
function payflowGatewayConnection() {
global $wgPayflowGatewayDBserver, $wgPayflowGatewayDBname;
global $wgPayflowGatewayDBuser, $wgPayflowGatewayDBpassword;
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs