Index: branches/fundraising/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php |
— | — | @@ -56,10 +56,35 @@ |
57 | 57 | $this->addCodeRange( 'GET_ORDERSTATUS', 'STATUSID', 'complete', 1000, 1050 ); |
58 | 58 | $this->addCodeRange( 'GET_ORDERSTATUS', 'STATUSID', 'failed', 1100, 99999 ); |
59 | 59 | } |
| 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() { |
60 | 69 | |
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 |
62 | 84 | $this->transactions = array( ); |
63 | 85 | |
| 86 | + /* BANK_TRANSFER |
| 87 | + * |
| 88 | + */ |
64 | 89 | $this->transactions['BANK_TRANSFER'] = array( |
65 | 90 | 'request' => array( |
66 | 91 | 'REQUEST' => array( |
— | — | @@ -109,6 +134,9 @@ |
110 | 135 | ), |
111 | 136 | ); |
112 | 137 | |
| 138 | + /* INSERT_ORDERWITHPAYMENT |
| 139 | + * |
| 140 | + */ |
113 | 141 | $this->transactions['INSERT_ORDERWITHPAYMENT'] = array( |
114 | 142 | 'request' => array( |
115 | 143 | 'REQUEST' => array( |
— | — | @@ -158,6 +186,9 @@ |
159 | 187 | 'addDonorDataToSession' => true, |
160 | 188 | ); |
161 | 189 | |
| 190 | + /* TEST_CONNECTION |
| 191 | + * |
| 192 | + */ |
162 | 193 | $this->transactions['TEST_CONNECTION'] = array( |
163 | 194 | 'request' => array( |
164 | 195 | 'REQUEST' => array( |
— | — | @@ -175,6 +206,9 @@ |
176 | 207 | ) |
177 | 208 | ); |
178 | 209 | |
| 210 | + /* GET_ORDERSTATUS |
| 211 | + * |
| 212 | + */ |
179 | 213 | $this->transactions['GET_ORDERSTATUS'] = array( |
180 | 214 | 'request' => array( |
181 | 215 | 'REQUEST' => array( |
— | — | @@ -205,6 +239,60 @@ |
206 | 240 | 'revised', |
207 | 241 | ) |
208 | 242 | ); |
| 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 | + ); |
209 | 297 | } |
210 | 298 | |
211 | 299 | /** |
— | — | @@ -279,6 +367,11 @@ |
280 | 368 | $data['ORDER'] = $this->xmlChildrenToArray( $response, 'ORDER' ); |
281 | 369 | $data['PAYMENT'] = $this->xmlChildrenToArray( $response, 'PAYMENT' ); |
282 | 370 | 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; |
283 | 376 | case 'GET_ORDERSTATUS': |
284 | 377 | $data = $this->xmlChildrenToArray( $response, 'STATUS' ); |
285 | 378 | $this->setTransactionWMFStatus( $this->findCodeAction( 'GET_ORDERSTATUS', 'STATUSID', $data['STATUSID'] ) ); |