Index: trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.body.php |
— | — | @@ -124,6 +124,16 @@ |
125 | 125 | return; |
126 | 126 | } |
127 | 127 | } |
| 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 | + } |
128 | 138 | elseif ( $payment_method == 'rtbt' ) { |
129 | 139 | |
130 | 140 | $this->adapter->do_transaction( 'INSERT_ORDERWITHPAYMENT' ); |
— | — | @@ -212,6 +222,61 @@ |
213 | 223 | return false; |
214 | 224 | } |
215 | 225 | |
| 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 | + |
216 | 281 | } |
217 | 282 | |
218 | 283 | // end class |