Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php |
— | — | @@ -279,6 +279,8 @@ |
280 | 280 | * Checks posted form data for errors and returns array of messages |
281 | 281 | */ |
282 | 282 | private function fnPayflowValidateForm( &$data, &$error ) { |
| 283 | + global $wgPayflowPriceFloor, $wgPayflowPriceCieling; |
| 284 | + |
283 | 285 | // begin with no errors |
284 | 286 | $error_result = '0'; |
285 | 287 | |
— | — | @@ -310,7 +312,9 @@ |
311 | 313 | } |
312 | 314 | |
313 | 315 | // check amount |
314 | | - if ( !preg_match( '/^\d+(\.(\d+)?)?$/', $data['amount'] ) || $data['amount'] == "0.00" ) { |
| 316 | + if ( !preg_match( '/^\d+(\.(\d+)?)?$/', $data[ 'amount' ] ) || |
| 317 | + ( (float) $data[ 'amount' ] < (float) $wgPayflowPriceFloor || |
| 318 | + (float) $data[ 'amount' ] > (float) $wgPayflowPriceCieling ) ) { |
315 | 319 | $error['invalidamount'] = wfMsg( 'payflowpro_gateway-error-msg-invalid-amount' ); |
316 | 320 | $error_result = '1'; |
317 | 321 | } |
Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.php |
— | — | @@ -147,6 +147,12 @@ |
148 | 148 | $wgPayflowGatewayUseSyslog = false; |
149 | 149 | |
150 | 150 | /** |
| 151 | + * Configure price cieling and floor for valid contribution amount |
| 152 | + */ |
| 153 | +$wgPayflowPriceFloor = '1.00'; |
| 154 | +$wgPayflowPriceCieling = '10000.00'; |
| 155 | + |
| 156 | +/** |
151 | 157 | * Hooks required to interface with the donation extension (include <donate> on page) |
152 | 158 | * |
153 | 159 | * gwValue supplies the value of the form option, the name that appears on the form |