Index: branches/fundraising/extensions/DonationInterface/donationinterface.php |
— | — | @@ -78,6 +78,7 @@ |
79 | 79 | /** |
80 | 80 | * Default Thank You and Fail pages for all of donationinterface - language will be calc'd and appended at runtime. |
81 | 81 | */ |
| 82 | +//$wgDonationInterfaceThankYouPage = 'https://wikimediafoundation.org/wiki/Thank_You'; |
82 | 83 | $wgDonationInterfaceThankYouPage = 'Donate-thanks'; |
83 | 84 | $wgDonationInterfaceFailPage = 'Donate-error'; |
84 | 85 | |
Index: branches/fundraising/extensions/DonationInterface/payflowpro_gateway/payflowpro.adapter.php |
— | — | @@ -78,6 +78,8 @@ |
79 | 79 | 'TENDER' => 'C', |
80 | 80 | 'VERBOSITY' => 'MEDIUM', |
81 | 81 | ), |
| 82 | + 'do_validation' => 'true', |
| 83 | + 'do_processhooks' => 'true', |
82 | 84 | ); |
83 | 85 | } |
84 | 86 | |
Index: branches/fundraising/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.body.php |
— | — | @@ -95,11 +95,11 @@ |
96 | 96 | break; |
97 | 97 | |
98 | 98 | case 'INSERT_ORDERWITHPAYMENT': |
99 | | - $options['creditCard'] = true; |
| 99 | + $options['creditCard'] = false; |
100 | 100 | break; |
101 | 101 | |
102 | 102 | default: |
103 | | - $options['creditCard'] = true; |
| 103 | + $options['creditCard'] = false; |
104 | 104 | } |
105 | 105 | |
106 | 106 | $form_errors = $this->validateForm( $data, $this->errors, $options ); |
Index: branches/fundraising/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php |
— | — | @@ -155,6 +155,8 @@ |
156 | 156 | 'HOSTEDINDICATOR' => '1', |
157 | 157 | //'PAYMENTPRODUCTID' => '11', |
158 | 158 | ), |
| 159 | + 'do_validation' => 'true', |
| 160 | + 'do_processhooks' => 'true', |
159 | 161 | ); |
160 | 162 | |
161 | 163 | $this->transactions['TEST_CONNECTION'] = array( |
Index: branches/fundraising/extensions/DonationInterface/gateway_common/gateway.adapter.php |
— | — | @@ -158,9 +158,9 @@ |
159 | 159 | global $wgLang; |
160 | 160 | $language = $wgLang->getCode(); |
161 | 161 | $page = self::getGlobal( "ThankYouPage" ) . "/$language"; |
162 | | - $returnTitle = Title::newFromText( $page ); |
163 | | - $returnto = $returnTitle->getFullURL(); |
164 | | - return $returnto; |
| 162 | +// $returnTitle = Title::newFromText( $page ); |
| 163 | +// $returnto = $returnTitle->getFullURL(); |
| 164 | + return $page; |
165 | 165 | } |
166 | 166 | |
167 | 167 | function getFailPage() { |
— | — | @@ -352,26 +352,27 @@ |
353 | 353 | ); |
354 | 354 | } |
355 | 355 | |
356 | | - // expose a hook for external handling of trxns ready for processing |
357 | | - wfRunHooks( 'GatewayProcess', array( &$this ) ); //don't think anybody is using this yet, but you could! |
| 356 | + // expose a hook for external handling of trxns ready for processing |
| 357 | + if (array_key_exists('do_processhooks', $this->transactions[$this->currentTransaction()]) && |
| 358 | + $this->transactions[$this->currentTransaction()]['do_processhooks'] === 'true'){ |
| 359 | + wfRunHooks( 'GatewayProcess', array( &$this ) ); //don't think anybody is using this yet, but you could! |
| 360 | + } |
358 | 361 | |
359 | 362 | $this->dataObj->updateContributionTracking( defined( 'OWA' ) ); |
360 | 363 | if ( $this->getCommunicationType() === 'xml' ) { |
361 | 364 | $this->getStopwatch( "buildRequestXML" ); |
362 | | - $xml = $this->buildRequestXML(); |
| 365 | + $curlme = $this->buildRequestXML(); |
363 | 366 | $this->saveCommunicationStats( "buildRequestXML", $transaction ); |
364 | | - $txn_ok = $this->curl_transaction( $xml ); |
365 | | - //put the response in a universal form, and return it. |
366 | 367 | } |
367 | 368 | |
368 | 369 | if ( $this->getCommunicationType() === 'namevalue' ) { |
369 | 370 | //buildRequestNameValueString() |
370 | 371 | $this->getStopwatch( "buildRequestNameValueString" ); |
371 | | - $namevalstring = $this->buildRequestNameValueString(); |
| 372 | + $curlme = $this->buildRequestNameValueString(); |
372 | 373 | $this->saveCommunicationStats( "buildRequestNameValueString", $transaction ); |
373 | | - $txn_ok = $this->curl_transaction( $namevalstring ); |
374 | | - //put the response in a universal form, and return it. |
375 | 374 | } |
| 375 | + |
| 376 | + $txn_ok = $this->curl_transaction( $curlme ); |
376 | 377 | |
377 | 378 | if ( $txn_ok === false ) { //nothing to process, so we have to build it manually |
378 | 379 | self::log( "Transaction Communication failed" . print_r( $this->getTransactionAllResults(), true ) ); |
— | — | @@ -400,7 +401,10 @@ |
401 | 402 | $this->setTransactionResult( $pulled_data, 'data' ); |
402 | 403 | |
403 | 404 | // expose a hook for any post processing |
404 | | - wfRunHooks( 'GatewayPostProcess', array( &$this ) ); //conversion log (at least) |
| 405 | + if (array_key_exists('do_processhooks', $this->transactions[$this->currentTransaction()]) && |
| 406 | + $this->transactions[$this->currentTransaction()]['do_processhooks'] === 'true'){ |
| 407 | + wfRunHooks( 'GatewayPostProcess', array( &$this ) ); //conversion log (at least) |
| 408 | + } |
405 | 409 | |
406 | 410 | $this->processResponse( $pulled_data ); |
407 | 411 | $this->dataObj->unsetEditToken(); |
— | — | @@ -967,30 +971,34 @@ |
968 | 972 | } |
969 | 973 | |
970 | 974 | function runPreProcess() { |
| 975 | + if (array_key_exists('do_validation', $this->transactions[$this->currentTransaction()]) && |
| 976 | + $this->transactions[$this->currentTransaction()]['do_validation'] === 'true'){ |
| 977 | + // allow any external validators to have their way with the data |
| 978 | + self::log( $this->getData( 'order_id' ) . " Preparing to query MaxMind" ); |
| 979 | + wfRunHooks( 'GatewayValidate', array( &$this ) ); |
| 980 | + self::log( $this->getData( 'order_id' ) . ' Finished querying Maxmind' ); |
971 | 981 | |
972 | | - // allow any external validators to have their way with the data |
973 | | - self::log( $this->getData( 'order_id' ) . " Preparing to query MaxMind" ); |
974 | | - wfRunHooks( 'GatewayValidate', array( &$this ) ); |
975 | | - self::log( $this->getData( 'order_id' ) . ' Finished querying Maxmind' ); |
| 982 | + // if the transaction was flagged for review |
| 983 | + if ( $this->action == 'review' ) { |
| 984 | + // expose a hook for external handling of trxns flagged for review |
| 985 | + wfRunHooks( 'GatewayReview', array( &$this ) ); |
| 986 | + } |
976 | 987 | |
977 | | - // if the transaction was flagged for review |
978 | | - if ( $this->action == 'review' ) { |
979 | | - // expose a hook for external handling of trxns flagged for review |
980 | | - wfRunHooks( 'GatewayReview', array( &$this ) ); |
981 | | - } |
| 988 | + // if the transaction was flagged to be 'challenged' |
| 989 | + if ( $this->action == 'challenge' ) { |
| 990 | + // expose a hook for external handling of trxns flagged for challenge (eg captcha) |
| 991 | + wfRunHooks( 'GatewayChallenge', array( &$this ) ); |
| 992 | + } |
982 | 993 | |
983 | | - // if the transaction was flagged to be 'challenged' |
984 | | - if ( $this->action == 'challenge' ) { |
985 | | - // expose a hook for external handling of trxns flagged for challenge (eg captcha) |
986 | | - wfRunHooks( 'GatewayChallenge', array( &$this ) ); |
| 994 | + // if the transaction was flagged for rejection |
| 995 | + if ( $this->action == 'reject' ) { |
| 996 | + // expose a hook for external handling of trxns flagged for rejection |
| 997 | + wfRunHooks( 'GatewayReject', array( &$this ) ); |
| 998 | + $this->dataObj->unsetEditToken(); |
| 999 | + } |
| 1000 | + } else { |
| 1001 | + $this->action = 'process'; |
987 | 1002 | } |
988 | | - |
989 | | - // if the transaction was flagged for rejection |
990 | | - if ( $this->action == 'reject' ) { |
991 | | - // expose a hook for external handling of trxns flagged for rejection |
992 | | - wfRunHooks( 'GatewayReject', array( &$this ) ); |
993 | | - $this->dataObj->unsetEditToken(); |
994 | | - } |
995 | 1003 | } |
996 | 1004 | |
997 | 1005 | } |
Index: branches/fundraising/extensions/DonationInterface/gateway_common/GatewayForm.php |
— | — | @@ -234,7 +234,7 @@ |
235 | 235 | |
236 | 236 | if ( empty( $data['email'] ) ) { |
237 | 237 | |
238 | | - $error['email'] = wfMsg( $gateway_identifier . '_gateway-error-email-empty' ); |
| 238 | + $error['email'] = wfMsg( $this->adapter->getIdentifier() . '_gateway-error-email-empty' ); |
239 | 239 | |
240 | 240 | $this->setValidateFormResult( false ); |
241 | 241 | } |