Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/335371 )

Change subject: Fix paypal result routing
......................................................................

Fix paypal result routing

Need to unstage the language if we stage it. Also, we were missing
an alias for the result page, which makes some wikis cry.

Bug: T152626
Change-Id: Ic20ee718fb045886e188c98c8c8cb04806413aa6
---
M gateway_common/DonorLocale.php
M paypal_gateway/paypal_gateway.alias.php
2 files changed, 9 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface 
refs/changes/71/335371/1

diff --git a/gateway_common/DonorLocale.php b/gateway_common/DonorLocale.php
index d5ff029..6ad0d3b 100644
--- a/gateway_common/DonorLocale.php
+++ b/gateway_common/DonorLocale.php
@@ -4,7 +4,7 @@
  * Set staged language to a locale ID with country information
  */
 class DonorLocale
-       implements StagingHelper
+       implements StagingHelper, UnstagingHelper
 {
        public function stage( GatewayType $adapter, $normalized, &$staged_data 
) {
                if ( isset( $normalized['language'] ) && isset( 
$normalized['country'] ) ) {
@@ -12,4 +12,11 @@
                        $staged_data['language'] = 
"{$parts[0]}_{$normalized['country']}";
                }
        }
+
+       public function unstage( GatewayType $adapter, $stagedData, 
&$unstagedData ) {
+               if ( isset( $stagedData['language'] ) ) {
+                       $parts = explode( '_', $stagedData['language'] );
+                       $unstagedData['language'] = $parts[0];
+               }
+       }
 }
diff --git a/paypal_gateway/paypal_gateway.alias.php 
b/paypal_gateway/paypal_gateway.alias.php
index 7ab1573..600a299 100644
--- a/paypal_gateway/paypal_gateway.alias.php
+++ b/paypal_gateway/paypal_gateway.alias.php
@@ -7,6 +7,7 @@
 /** English */
 $specialPageAliases['en'] = array(
        'PaypalExpressGateway' => array( 'PaypalExpressGateway' ),
+       'PaypalExpressGatewayResult' => array( 'PaypalExpressGatewayResult' ),
        'PaypalLegacyGateway' => array(
                'PaypalLegacyGateway',
                'PaypalGateway', // deprecated

-- 
To view, visit https://gerrit.wikimedia.org/r/335371
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic20ee718fb045886e188c98c8c8cb04806413aa6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Ejegg <eeggles...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to