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

Change subject: Allow old keys in session values
......................................................................

Allow old keys in session values

Transitional code, revert after deploy.

Bug: T165818
Change-Id: If784e7d4f398d98a943acdcf6bcbbd0d2b7c16c9
(cherry picked from commit 021d456cc08007396eac7268ed7bc670b96afb66)
---
M gateway_common/DonationData.php
1 file changed, 17 insertions(+), 4 deletions(-)


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

diff --git a/gateway_common/DonationData.php b/gateway_common/DonationData.php
index 128eb03..8b2c418 100644
--- a/gateway_common/DonationData.php
+++ b/gateway_common/DonationData.php
@@ -189,14 +189,27 @@
                if ( is_null( $donorData ) ) {
                        return;
                }
+               // Transitional code, used for a few hours after deploy.
+               // Please delete before next deploy
+               $rekey = array(
+                       'amount' => 'gross',
+                       'currency_code' => 'currency',
+                       'fname' => 'first_name',
+                       'lname' => 'last_name',
+                       'state' => 'state_province',
+               );
                //fields that should always overwrite with their original values
                $overwrite = array( 'referrer', 'contribution_tracking_id' );
                foreach ( $donorData as $key => $val ) {
-                       if ( !$this->isSomething( $key ) ) {
-                               $this->setVal( $key, $val );
+                       $newKey = $key;
+                       if ( isset( $rekey[$key] ) ) {
+                               $newKey = $rekey[$key];
+                       }
+                       if ( !$this->isSomething( $newKey ) ) {
+                               $this->setVal( $newKey, $val );
                        } else {
-                               if ( in_array( $key, $overwrite ) ) {
-                                       $this->setVal( $key, $val );
+                               if ( in_array( $newKey, $overwrite ) ) {
+                                       $this->setVal( $newKey, $val );
                                }
                        }
                }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If784e7d4f398d98a943acdcf6bcbbd0d2b7c16c9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: wmf/1.30.0-wmf.2
Gerrit-Owner: Ejegg <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to