Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php |
— | — | @@ -1180,14 +1180,17 @@ |
1181 | 1181 | $this->updateContributionTracking( $data, true ); |
1182 | 1182 | |
1183 | 1183 | $wgPayflowGatewayPaypalURL .= "/" . $data[ 'language' ] . "?gateway=paypal"; |
1184 | | - |
1185 | 1184 | // submit the data to the paypal redirect URL |
1186 | 1185 | // @fixme add some error checking!!! |
1187 | 1186 | $ch = curl_init(); |
1188 | 1187 | curl_setopt( $ch, CURLOPT_URL, $wgPayflowGatewayPaypalURL ); |
1189 | 1188 | curl_setopt( $ch, CURLOPT_POST, count( $data ) ); |
1190 | 1189 | curl_setopt( $ch, CURLOPT_POSTFIELDS, http_build_query( $data ) ); |
1191 | | - curl_exec( $ch ); |
| 1190 | + $curl_result = curl_exec( $ch ); |
1192 | 1191 | curl_close( $ch ); |
| 1192 | + // throw an exception if there was a curl error |
| 1193 | + if ( !$curl_result ) { |
| 1194 | + throw new MWException( 'There was a cURL error submitting information to ' . $wgPayflowGatewayPaypalURL . ': ' . curl_error( $ch ) ); |
| 1195 | + } |
1193 | 1196 | } |
1194 | 1197 | } // end class |
\ No newline at end of file |