Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php |
— | — | @@ -1161,7 +1161,7 @@ |
1162 | 1162 | * This would make this a lot less hack-ish |
1163 | 1163 | */ |
1164 | 1164 | public function paypalRedirect( &$data ) { |
1165 | | - global $wgPayflowGatewayPaypalURL; |
| 1165 | + global $wgPayflowGatewayPaypalURL, $wgPayflowGatewayTest; |
1166 | 1166 | |
1167 | 1167 | // if we don't have a URL enabled throw a graceful error to the user |
1168 | 1168 | if ( !strlen( $wgPayflowGatewayPaypalURL ) ) { |
— | — | @@ -1180,12 +1180,14 @@ |
1181 | 1181 | $this->updateContributionTracking( $data, true ); |
1182 | 1182 | |
1183 | 1183 | $wgPayflowGatewayPaypalURL .= "/" . $data[ 'language' ] . "?gateway=paypal"; |
| 1184 | + |
1184 | 1185 | // submit the data to the paypal redirect URL |
1185 | | - // @fixme add some error checking!!! |
1186 | 1186 | $ch = curl_init(); |
1187 | 1187 | curl_setopt( $ch, CURLOPT_URL, $wgPayflowGatewayPaypalURL ); |
| 1188 | + curl_setopt( $ch, CURLOPT_USERAGENT, 'Donation_Interface PayflowPro Gateway PayPal Redirecter 1.0' ); |
1188 | 1189 | curl_setopt( $ch, CURLOPT_POST, count( $data ) ); |
1189 | 1190 | curl_setopt( $ch, CURLOPT_POSTFIELDS, http_build_query( $data ) ); |
| 1191 | + if ( $wgPayflowGatewayTest ) curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, false ); |
1190 | 1192 | $curl_result = curl_exec( $ch ); |
1191 | 1193 | $curl_error = ( !$curl_result ) ? curl_error( $ch ) : null; |
1192 | 1194 | curl_close( $ch ); |
— | — | @@ -1196,4 +1198,4 @@ |
1197 | 1199 | } |
1198 | 1200 | |
1199 | 1201 | } |
1200 | | -} // end class |
\ No newline at end of file |
| 1202 | +} // end class |