Ejegg has uploaded a new change for review.

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

Change subject: donation.api cleanup, no test code in prod
......................................................................

donation.api cleanup, no test code in prod

TestingGlobalCollectAdapter wouldn't work even if was autoloading

Change-Id: If99b24c017175dc3f41b568a1af788b23367516d
---
M gateway_common/donation.api.php
1 file changed, 3 insertions(+), 10 deletions(-)


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

diff --git a/gateway_common/donation.api.php b/gateway_common/donation.api.php
index 0e6ccba..51447b2 100644
--- a/gateway_common/donation.api.php
+++ b/gateway_common/donation.api.php
@@ -12,8 +12,6 @@
                $this->gateway = $this->donationData['gateway'];
 
                $method = $this->donationData['payment_method'];
-               // @todo FIXME: Unused local variable.
-               $submethod = $this->donationData['payment_submethod'];
 
                $gatewayObj = $this->getGatewayObject();
 
@@ -29,6 +27,7 @@
                        return;
                }
 
+               // FIXME: gateway adapters should have a handleApiRequest method
                if ( $this->gateway == 'globalcollect' ) {
                        switch ( $method ) {
                                // TODO: add other payment methods
@@ -38,7 +37,7 @@
                                default:
                                        $result = $gatewayObj->do_transaction( 
'TEST_CONNECTION' );
                        }
-               } elseif ( $this->gateway == 'adyen' ) {
+               } else if ( $this->gateway == 'adyen' ) {
                        $result = $gatewayObj->do_transaction( 'donate' );
                }
 
@@ -195,19 +194,13 @@
        }
 
        private function getGatewayObject() {
-               global $wgDonationInterfaceTestMode;
 
                $gateway_opts = array(
                        'api_request' => 'true'
                );
 
                if ( $this->gateway == 'globalcollect' ) {
-                       // FIXME: no test code path in prod
-                       if ( $wgDonationInterfaceTestMode === true ) {
-                               return new TestingGlobalCollectAdapter( 
$gateway_opts );
-                       } else {
-                               return new GlobalCollectAdapter( $gateway_opts 
);
-                       }
+                       return new GlobalCollectAdapter( $gateway_opts );
                } elseif ( $this->gateway == 'adyen' ) {
                        return new AdyenAdapter( $gateway_opts );
                } else {

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

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

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

Reply via email to