r102479 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102478‎ | r102479 | r102480 >
Date:01:57, 9 November 2011
Author:khorn
Status:ok
Tags:fundraising 
Comment:
Made sure everybody is getting the correctly formatted Thank You and Fail pages straight from the adapter, instead of trying to build it on the outside when it's already built internally.
Modified paths:
  • /trunk/extensions/DonationInterface/gateway_common/GatewayForm.php (modified) (history)
  • /trunk/extensions/DonationInterface/gateway_common/gateway.adapter.php (modified) (history)
  • /trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.body.php (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php
@@ -133,7 +133,7 @@
134134 $thankyoupage = $this->adapter->getGlobal( 'ThankYouPage' );
135135
136136 if ( $thankyoupage ) {
137 - $wgOut->redirect( $thankyoupage . "/" . $data['language'] );
 137+ $wgOut->redirect( $thankyoupage );
138138 } else {
139139 // display response message
140140 $wgOut->addHTML( '<h3 class="response_message">' . $responseMsg . '</h3>' );
@@ -161,10 +161,10 @@
162162 */
163163 function fnPayflowDisplayDeclinedResults( $responseMsg ) {
164164 global $wgOut;
165 - $failpage = $this->adapter->getGlobal( 'FailPage' );
 165+ $failpage = $this->adapter->getFailPage();
166166
167167 if ( $failpage ) {
168 - $wgOut->redirect( $failpage . "/" . $data['language'] );
 168+ $wgOut->redirect( $failpage );
169169 } else {
170170 // general decline message
171171 $declinedDefault = wfMsg( 'php-response-declined' );
Index: trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.body.php
@@ -268,7 +268,7 @@
269269
270270 $queryString = '?payment_method=' . $this->adapter->getPaymentMethod() . '&payment_submethod=' . $this->adapter->getPaymentSubmethod();
271271
272 - $url = $this->adapter->getGlobal( 'ThankYouPage' ) . '/' . $this->adapter->getTransactionDataLanguage() . $queryString;
 272+ $url = $this->adapter->getThankYouPage() . $queryString;
273273
274274 $link = Xml::tags( 'a', array( 'href' => $url ), wfMsg( 'donate_interface-bt-finished' ) );
275275
Index: trunk/extensions/DonationInterface/gateway_common/gateway.adapter.php
@@ -252,7 +252,7 @@
253253 * @global type $wgLang
254254 * @return mixed Page URL in string format, or false if none is set.
255255 */
256 - function getThankYouPage() {
 256+ public function getThankYouPage() {
257257 $page = self::getGlobal( "ThankYouPage" );
258258 if ( $page ) {
259259 $page = $this->appendLanguageAndMakeURL( $page );
@@ -265,7 +265,7 @@
266266 * @global type $wgLang
267267 * @return mixed Page URL in string format, or false if none is set.
268268 */
269 - function getFailPage() {
 269+ public function getFailPage() {
270270 $page = self::getGlobal( "FailPage" );
271271 if ( $page ) {
272272 $page = $this->appendLanguageAndMakeURL( $page );
@@ -281,7 +281,7 @@
282282 * page title.
283283 * @return string A URL
284284 */
285 - function appendLanguageAndMakeURL( $url ){
 285+ protected function appendLanguageAndMakeURL( $url ){
286286 $language = $this->getData_Raw( 'language' );
287287 //make sure we don't already have the language in there...
288288 $dirs = explode('/', $url);
@@ -334,7 +334,7 @@
335335 * @return mixed All the staged data held by the adapter, or if a key was
336336 * set, the staged value for that key.
337337 */
338 - function getData_Staged( $val = '' ) {
 338+ protected function getData_Staged( $val = '' ) {
339339 if ( $val === '' ) {
340340 return $this->staged_data;
341341 } else {
@@ -1701,19 +1701,6 @@
17021702 }
17031703
17041704 /**
1705 - * Returns false if language does not exist or string if it does exist
1706 - *
1707 - * @todo
1708 - * - Can we just get the language from somewhere else to make this simpler?
1709 - *
1710 - * @return false|string
1711 - */
1712 - public function getTransactionDataLanguage() {
1713 -
1714 - return $this->getData_Raw( 'language' );
1715 - }
1716 -
1717 - /**
17181705 * Returns an array of errors. This should be an empty array on success.
17191706 *
17201707 * @return array
Index: trunk/extensions/DonationInterface/gateway_common/GatewayForm.php
@@ -545,13 +545,13 @@
546546
547547 if ( in_array( $this->adapter->getTransactionWMFStatus(), $this->adapter->getGoToThankYouOn() ) ) {
548548
549 - $thankyoupage = $this->adapter->getGlobal( 'ThankYouPage' );
 549+ $thankyoupage = $this->adapter->getThankYouPage();
550550
551551 if ( $thankyoupage ) {
552552
553553 $queryString = '?payment_method=' . $this->adapter->getPaymentMethod() . '&payment_submethod=' . $this->adapter->getPaymentSubmethod();
554554
555 - return $wgOut->redirect( $thankyoupage . '/' . $this->adapter->getTransactionDataLanguage() . $queryString );
 555+ return $wgOut->redirect( $thankyoupage . $queryString );
556556 }
557557 }
558558

Follow-up revisions

RevisionCommit summaryAuthorDate
r102732MFT r100644, r100785, r101785, r102120, r102318, r102332, r102341, r102342, r...awjrichards01:31, 11 November 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r102476As part of the language cleanup, fixes the way we calculate the thank you and...khorn01:37, 9 November 2011

Status & tagging log