Index: branches/fundraising/extensions/DonationInterface/gateway_forms/TwoStepAmount.php |
— | — | @@ -27,7 +27,6 @@ |
28 | 28 | global $wgOut; |
29 | 29 | |
30 | 30 | $form_data['transaction_type'] = 'BANK_TRANSFER'; |
31 | | - //Debug::puke($form_data, eval(DUMP) . "\$form_data"); |
32 | 31 | parent::__construct( $form_data, $form_errors, $gateway ); |
33 | 32 | |
34 | 33 | // we only want to load this JS if the form is being rendered |
Index: branches/fundraising/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php |
— | — | @@ -296,15 +296,40 @@ |
297 | 297 | $this->setTransactionResult( "Response Status: " . $response['STATUSID'], 'txn_message' ); //TODO: Translate for GC. |
298 | 298 | } |
299 | 299 | |
| 300 | + /** |
| 301 | + * The default section of the switch will be hit on first time forms. This |
| 302 | + * should be okay, because we are only concerned with staged_vars that have |
| 303 | + * been posted. |
| 304 | + * |
| 305 | + * Credit cards staged_vars are set to ensure form failures on validation in |
| 306 | + * the default case. This should prevent accidental form submission with |
| 307 | + * unknown transaction types. |
| 308 | + */ |
300 | 309 | function defineStagedVars() { |
| 310 | + |
301 | 311 | //OUR field names. |
302 | 312 | $this->staged_vars = array( |
303 | 313 | 'amount', |
304 | | - 'card_type', |
305 | | - 'card_num', |
| 314 | + //'card_type', |
| 315 | + //'card_num', |
306 | 316 | 'returnto', |
307 | 317 | 'order_id', //This may or may not oughta-be-here... |
308 | 318 | ); |
| 319 | + |
| 320 | + switch ( $this->getTransactionType() ) { |
| 321 | + |
| 322 | + case 'BANK_TRANSFER': |
| 323 | + break; |
| 324 | + |
| 325 | + case 'INSERT_ORDERWITHPAYMENT': |
| 326 | + $this->staged_vars[] = 'card_type'; |
| 327 | + $this->staged_vars[] = 'card_num'; |
| 328 | + break; |
| 329 | + |
| 330 | + default: |
| 331 | + $this->staged_vars[] = 'card_type'; |
| 332 | + $this->staged_vars[] = 'card_num'; |
| 333 | + } |
309 | 334 | } |
310 | 335 | |
311 | 336 | protected function stage_amount( $type = 'request' ) { |