r102033 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102032‎ | r102033 | r102034 >
Date:19:42, 4 November 2011
Author:jpostlethwaite
Status:ok (Comments)
Tags:fundraising 
Comment:
Added display helper for GlobalCollect bank transfer.
Modified paths:
  • /trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.body.php
@@ -124,6 +124,16 @@
125125 return;
126126 }
127127 }
 128+ elseif ( $payment_method == 'bt' ) {
 129+
 130+ $this->adapter->do_transaction( 'INSERT_ORDERWITHPAYMENT' );
 131+
 132+ if ( in_array( $this->adapter->getTransactionWMFStatus(), $this->adapter->getGoToThankYouOn() ) ) {
 133+
 134+ return $this->displayBankTransferInformation();
 135+ }
 136+
 137+ }
128138 elseif ( $payment_method == 'rtbt' ) {
129139
130140 $this->adapter->do_transaction( 'INSERT_ORDERWITHPAYMENT' );
@@ -212,6 +222,61 @@
213223 return false;
214224 }
215225
 226+ /**
 227+ * Display information for bank transfer
 228+ */
 229+ protected function displayBankTransferInformation() {
 230+
 231+ global $wgOut;
 232+
 233+ $results = $this->adapter->getTransactionAllResults();
 234+
 235+ $return = '';
 236+ $fields = array(
 237+ 'ACCOUNTHOLDER' => array('translation' => 'donate_interface-bt-account_holder', ),
 238+ 'BANKNAME' => array('translation' => 'donate_interface-dd-bank_name', ),
 239+ 'BANKACCOUNTNUMBER' => array('translation' => 'donate_interface-bt-bank_account_number', ),
 240+ 'CITY' => array('translation' => 'donate_interface-donor-city', ),
 241+ 'COUNTRYDESCRIPTION' => array('translation' => 'donate_interface-bt-country_description', ),
 242+ 'IBAN' => array('translation' => 'donate_interface-dd-iban', ),
 243+ 'PAYMENTREFERENCE' => array('translation' => 'donate_interface-bt-payment_reference', ),
 244+ 'SWIFTCODE' => array('translation' => 'donate_interface-bt-swift_code', ),
 245+ 'SPECIALID' => array('translation' => 'donate_interface-bt-special_id', ),
 246+ );
 247+
 248+ $id = 'bank_transfer_information';
 249+
 250+ $return .= Xml::openElement( 'div', array( 'id' => $id ) ); // $id
 251+
 252+ $return .= Xml::tags( 'h2', array(), wfMsg( 'donate_interface-bt-information' ) );
 253+
 254+ $return .= Xml::openElement( 'table', array( 'id' => $id . '_table' ) );
 255+
 256+ foreach ( $fields as $field => $meta ) {
 257+
 258+ if ( isset( $results['data'][ $field ] ) ) {
 259+ $return .= Xml::openElement( 'tr', array() );
 260+
 261+ $return .= Xml::tags( 'th', array(), wfMsg( $meta['translation'] ) );
 262+ $return .= Xml::tags( 'td', array(), $results['data'][ $field ] );
 263+
 264+ $return .= Xml::closeElement( 'tr' );
 265+ }
 266+ }
 267+
 268+ $return .= Xml::closeElement( 'table' ); // close $id . '_table'
 269+
 270+ $url = $this->adapter->getGlobal( 'ThankYouPage' ) . '/' . $this->adapter->getTransactionDataLanguage();
 271+
 272+ $link = Xml::tags( 'a', array( 'href' => $url ), wfMsg( 'donate_interface-bt-finished' ) );
 273+
 274+ $return .= Xml::tags( 'p', array(), $link );
 275+
 276+ $return .= Xml::closeElement( 'div' ); // $id
 277+
 278+ return $wgOut->addHTML( $return );
 279+ }
 280+
216281 }
217282
218283 // end class

Follow-up revisions

RevisionCommit summaryAuthorDate
r102236MFT r90286, r100671, r100837, r100950, r101060, r101063, r101064, r101073, r1......khorn03:06, 7 November 2011
r102237MFT r90286, r100671, r100837, r100950, r101060, r101063, r101064, r101073, r1......khorn03:07, 7 November 2011

Comments

#Comment by Khorn (WMF) (talk | contribs)   04:48, 6 November 2011

Please see the note about handling cases where (for instance) GlobalCollect just disappears, on r101960: The 'bt' do_transaction sequence will need that as well.

#Comment by Awjrichards (talk | contribs)   21:36, 6 November 2011

Marking as OK as this is not a blocker for launch. Jeremy, please take note and we'll clean this up

Status & tagging log