r99255 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99254‎ | r99255 | r99256 >
Date:21:06, 7 October 2011
Author:jpostlethwaite
Status:deferred
Tags:fundraising 
Comment:
Adding transaction type code and optional parameters for unit testing.
Modified paths:
  • /branches/fundraising/extensions/DonationInterface/gateway_forms/TwoStepAmount.php (modified) (history)
  • /branches/fundraising/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php (modified) (history)

Diff [purge]

Index: branches/fundraising/extensions/DonationInterface/gateway_forms/TwoStepAmount.php
@@ -27,7 +27,6 @@
2828 global $wgOut;
2929
3030 $form_data['transaction_type'] = 'BANK_TRANSFER';
31 - //Debug::puke($form_data, eval(DUMP) . "\$form_data");
3231 parent::__construct( $form_data, $form_errors, $gateway );
3332
3433 // 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 @@
297297 $this->setTransactionResult( "Response Status: " . $response['STATUSID'], 'txn_message' ); //TODO: Translate for GC.
298298 }
299299
 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+ */
300309 function defineStagedVars() {
 310+
301311 //OUR field names.
302312 $this->staged_vars = array(
303313 'amount',
304 - 'card_type',
305 - 'card_num',
 314+ //'card_type',
 315+ //'card_num',
306316 'returnto',
307317 'order_id', //This may or may not oughta-be-here...
308318 );
 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+ }
309334 }
310335
311336 protected function stage_amount( $type = 'request' ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r100052We need this variable to be staged, or cc transactions won't work. After r977......khorn16:53, 17 October 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r99253Adding transaction type code and optional parameters for unit testing.jpostlethwaite21:05, 7 October 2011

Status & tagging log