Awight has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/162173

Change subject: (FR #1995) Fix bad renormalization of recurring
......................................................................

(FR #1995) Fix bad renormalization of recurring

We normalize donation data three times (TODO: stop that), and on
the third time through, we would set the recurring field to false,
because boolean true was not normalized correctly.

Change-Id: I98a557b69c896d30114cb35576883d09f5c98686
---
M gateway_common/DonationData.php
1 file changed, 4 insertions(+), 2 deletions(-)


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

diff --git a/gateway_common/DonationData.php b/gateway_common/DonationData.php
index 26807d4..04c4ab5 100644
--- a/gateway_common/DonationData.php
+++ b/gateway_common/DonationData.php
@@ -552,7 +552,8 @@
                        $this->setVal( 'recurring', true );
                        $this->expunge('recurring_paypal');
                }
-               if ( $this->isSomething( 'recurring' ) && ( $this->getVal( 
'recurring' ) === '1' || $this->getVal( 'recurring' ) === 'true' ) ) {
+               if ( $this->isSomething( 'recurring' ) && ( $this->getVal( 
'recurring' ) === '1' || $this->getVal( 'recurring' ) === 'true' || 
$this->getVal( 'recurring' ) === true )
+               ) {
                        $this->setVal( 'recurring', true );
                }
                else{
@@ -796,7 +797,8 @@
                        $this->getVal( 'recurring' )
                );
 
-               $this->log( "Setting utm_source payment method to 
{$payment_method_family}", LOG_INFO );
+               $recurring = ($this->getVal( 'recurring' ) ? 'true' : 'false');
+               $this->log( "Payment method is {$this->getVal( 'payment_method' 
)}, recurring = {$recurring}, utm_source = {$payment_method_family}", LOG_INFO 
);
 
                // split the utm_source into its parts for easier manipulation
                $source_parts = explode( ".", $utm_source );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I98a557b69c896d30114cb35576883d09f5c98686
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Awight <[email protected]>

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

Reply via email to