Index: trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.body.php |
— | — | @@ -150,6 +150,16 @@ |
151 | 151 | } |
152 | 152 | |
153 | 153 | } |
| 154 | + elseif ( $payment_method == 'obt' ) { |
| 155 | + |
| 156 | + $this->adapter->do_transaction( 'INSERT_ORDERWITHPAYMENT' ); |
| 157 | + |
| 158 | + if ( in_array( $this->adapter->getTransactionWMFStatus(), $this->adapter->getGoToThankYouOn() ) ) { |
| 159 | + |
| 160 | + return $this->displayOnlineBankTransferInformation(); |
| 161 | + } |
| 162 | + |
| 163 | + } |
154 | 164 | else { |
155 | 165 | $this->adapter->do_transaction( 'INSERT_ORDERWITHPAYMENT' ); |
156 | 166 | } |
— | — | @@ -279,6 +289,58 @@ |
280 | 290 | return $wgOut->addHTML( $return ); |
281 | 291 | } |
282 | 292 | |
| 293 | + /** |
| 294 | + * Display information for online bank transfer |
| 295 | + */ |
| 296 | + protected function displayOnlineBankTransferInformation() { |
| 297 | + |
| 298 | + global $wgOut; |
| 299 | + |
| 300 | + $results = $this->adapter->getTransactionAllResults(); |
| 301 | + |
| 302 | + $return = ''; |
| 303 | + $fields = array( |
| 304 | + 'CUSTOMERPAYMENTREFERENCE' => array('translation' => 'donate_interface-obt-customer_payment_reference', ), |
| 305 | + 'BILLERID' => array('translation' => 'donate_interface-obt-biller_id', ), |
| 306 | + ); |
| 307 | + |
| 308 | + $id = 'bank_transfer_information'; |
| 309 | + |
| 310 | + $return .= Xml::openElement( 'div', array( 'id' => $id ) ); // $id |
| 311 | + |
| 312 | + $return .= Xml::tags( 'h2', array(), wfMsg( 'donate_interface-obt-information' ) ); |
| 313 | + |
| 314 | + $return .= Xml::openElement( 'table', array( 'id' => $id . '_table' ) ); |
| 315 | + |
| 316 | + foreach ( $fields as $field => $meta ) { |
| 317 | + |
| 318 | + if ( isset( $results['data'][ $field ] ) ) { |
| 319 | + $return .= Xml::openElement( 'tr', array() ); |
| 320 | + |
| 321 | + $return .= Xml::tags( 'th', array(), wfMsg( $meta['translation'] ) ); |
| 322 | + $return .= Xml::tags( 'td', array(), $results['data'][ $field ] ); |
| 323 | + |
| 324 | + $return .= Xml::closeElement( 'tr' ); |
| 325 | + } |
| 326 | + } |
| 327 | + |
| 328 | + $return .= Xml::closeElement( 'table' ); // close $id . '_table' |
| 329 | + |
| 330 | + $return .= Xml::tags( 'p', array(), wfMsg( 'donate_interface-online_bank_transfer_message' ) ); |
| 331 | + |
| 332 | + $queryString = '?payment_method=' . $this->adapter->getPaymentMethod() . '&payment_submethod=' . $this->adapter->getPaymentSubmethod(); |
| 333 | + |
| 334 | + $url = $this->adapter->getThankYouPage() . $queryString; |
| 335 | + |
| 336 | + $link = Xml::tags( 'a', array( 'href' => $url ), wfMsg( 'donate_interface-bt-finished' ) ); |
| 337 | + |
| 338 | + $return .= Xml::tags( 'p', array(), $link ); |
| 339 | + |
| 340 | + $return .= Xml::closeElement( 'div' ); // $id |
| 341 | + |
| 342 | + return $wgOut->addHTML( $return ); |
| 343 | + } |
| 344 | + |
283 | 345 | } |
284 | 346 | |
285 | 347 | // end class |