r100237 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100236‎ | r100237 | r100238 >
Date:16:42, 19 October 2011
Author:jpostlethwaite
Status:deferred
Tags:fundraising 
Comment:
Added REAL_TIME_BANK_TRANSFER_IDEAL. Also put in comments on how we can turn this into a factory.
Modified paths:
  • /branches/fundraising/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php (modified) (history)

Diff [purge]

Index: branches/fundraising/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php
@@ -56,10 +56,35 @@
5757 $this->addCodeRange( 'GET_ORDERSTATUS', 'STATUSID', 'complete', 1000, 1050 );
5858 $this->addCodeRange( 'GET_ORDERSTATUS', 'STATUSID', 'failed', 1100, 99999 );
5959 }
 60+
 61+ /**
 62+ * Define Transactions
 63+ *
 64+ * @todo
 65+ * - This is going to get really big. It might be appropriate to turn this into a factory.
 66+ *
 67+ */
 68+ public function defineTransactions() {
6069
61 - function defineTransactions() {
 70+ /*
 71+ // Example factory pattern
 72+
 73+ // $this->defineTransaction( $transactionType = 'BANK_TRANSFER', $options = array() );
 74+
 75+ // $this->transactionTypes = array( 'BANK_TRANSFER', 'INSERT_ORDERWITHPAYMENT', 'TEST_CONNECTION', 'GET_ORDERSTATUS');
 76+
 77+ // foreach ( $this->transactionTypes as $transactionType ) { $this->defineTransaction( $transactionType); }
 78+
 79+ // $this->transactions[ $transactionType ] = GlobalCollectTransactionFactory::factory( $transactionType, $options );
 80+
 81+ //*/
 82+
 83+ // Initialize the array
6284 $this->transactions = array( );
6385
 86+ /* BANK_TRANSFER
 87+ *
 88+ */
6489 $this->transactions['BANK_TRANSFER'] = array(
6590 'request' => array(
6691 'REQUEST' => array(
@@ -109,6 +134,9 @@
110135 ),
111136 );
112137
 138+ /* INSERT_ORDERWITHPAYMENT
 139+ *
 140+ */
113141 $this->transactions['INSERT_ORDERWITHPAYMENT'] = array(
114142 'request' => array(
115143 'REQUEST' => array(
@@ -158,6 +186,9 @@
159187 'addDonorDataToSession' => true,
160188 );
161189
 190+ /* TEST_CONNECTION
 191+ *
 192+ */
162193 $this->transactions['TEST_CONNECTION'] = array(
163194 'request' => array(
164195 'REQUEST' => array(
@@ -175,6 +206,9 @@
176207 )
177208 );
178209
 210+ /* GET_ORDERSTATUS
 211+ *
 212+ */
179213 $this->transactions['GET_ORDERSTATUS'] = array(
180214 'request' => array(
181215 'REQUEST' => array(
@@ -205,6 +239,60 @@
206240 'revised',
207241 )
208242 );
 243+
 244+ /* REAL_TIME_BANK_TRANSFER_IDEAL
 245+ *
 246+ * PAYMENTPRODUCTID: 809
 247+ */
 248+ $this->transactions['REAL_TIME_BANK_TRANSFER_IDEAL'] = array(
 249+ 'request' => array(
 250+ 'REQUEST' => array(
 251+ 'ACTION',
 252+ 'META' => array(
 253+ 'MERCHANTID',
 254+ // 'IPADDRESS',
 255+ 'VERSION'
 256+ ),
 257+ 'PARAMS' => array(
 258+ 'ORDER' => array(
 259+ 'ORDERID',
 260+ 'AMOUNT',
 261+ 'CURRENCYCODE',
 262+ 'LANGUAGECODE',
 263+ 'COUNTRYCODE',
 264+ 'MERCHANTREFERENCE'
 265+ ),
 266+ 'PAYMENT' => array(
 267+ 'PAYMENTPRODUCTID',
 268+ 'AMOUNT',
 269+ 'CURRENCYCODE',
 270+ 'LANGUAGECODE',
 271+ 'COUNTRYCODE',
 272+ 'HOSTEDINDICATOR',
 273+ 'RETURNURL',
 274+ 'ISSUERID',
 275+// 'INVOICENUMBER',
 276+// 'CUSTOMERBANKNAME',
 277+// 'CUSTOMERACCOUNTHOLDERNAME',
 278+// 'CUSTOMERBANKACCOUNT',
 279+// 'CUSTOMERBANKCITY',
 280+ 'FIRSTNAME',
 281+ 'SURNAME',
 282+ 'STREET',
 283+ 'CITY',
 284+ 'STATE', // Optional
 285+ 'ZIP',
 286+ 'EMAIL',
 287+ )
 288+ )
 289+ )
 290+ ),
 291+ 'values' => array(
 292+ 'ACTION' => 'INSERT_ORDERWITHPAYMENT',
 293+ 'HOSTEDINDICATOR' => '1',
 294+ 'PAYMENTPRODUCTID' => '809',
 295+ ),
 296+ );
209297 }
210298
211299 /**
@@ -279,6 +367,11 @@
280368 $data['ORDER'] = $this->xmlChildrenToArray( $response, 'ORDER' );
281369 $data['PAYMENT'] = $this->xmlChildrenToArray( $response, 'PAYMENT' );
282370 break;
 371+ case 'REAL_TIME_BANK_TRANSFER_IDEAL':
 372+ $data = $this->xmlChildrenToArray( $response, 'ROW' );
 373+ $data['ORDER'] = $this->xmlChildrenToArray( $response, 'ORDER' );
 374+ $data['PAYMENT'] = $this->xmlChildrenToArray( $response, 'PAYMENT' );
 375+ break;
283376 case 'GET_ORDERSTATUS':
284377 $data = $this->xmlChildrenToArray( $response, 'STATUS' );
285378 $this->setTransactionWMFStatus( $this->findCodeAction( 'GET_ORDERSTATUS', 'STATUSID', $data['STATUSID'] ) );

Status & tagging log